svn commit: r324783 - head/sys/powerpc/powerpc

Justin Hibbits jhibbits at FreeBSD.org
Fri Oct 20 03:03:06 UTC 2017


Author: jhibbits
Date: Fri Oct 20 03:03:04 2017
New Revision: 324783
URL: https://svnweb.freebsd.org/changeset/base/324783

Log:
  Book-E debug trace fixes
  
  * Book-E can have Altivec exceptions, so move it out of the AIM-only block.
  * Print the right DSI trap mode (read vs write) for Book-E
  
  While here, fix some whitespace found while reviewing other diffs.

Modified:
  head/sys/powerpc/powerpc/db_trace.c

Modified: head/sys/powerpc/powerpc/db_trace.c
==============================================================================
--- head/sys/powerpc/powerpc/db_trace.c	Fri Oct 20 00:38:01 2017	(r324782)
+++ head/sys/powerpc/powerpc/db_trace.c	Fri Oct 20 03:03:04 2017	(r324783)
@@ -118,12 +118,12 @@ db_frame(struct db_variable *vp, db_expr_t *valuep, in
 
 	if (kdb_frame == NULL)
 		return (0);
-        reg = (register_t*)((uintptr_t)kdb_frame + (uintptr_t)vp->valuep);
-        if (op == DB_VAR_GET)
-                *valuep = *reg;
-        else
-                *reg = *valuep;
-        return (1);
+	reg = (register_t*)((uintptr_t)kdb_frame + (uintptr_t)vp->valuep);
+	if (op == DB_VAR_GET)
+		*valuep = *reg;
+	else
+		*reg = *valuep;
+	return (1);
 }
 
 
@@ -215,12 +215,17 @@ db_backtrace(struct thread *td, db_addr_t fp, int coun
 			switch (tf->exc) {
 			case EXC_DSI:
 				/* XXX take advantage of the union. */
+#ifdef BOOKE
 				db_printf("DSI %s trap @ %#zx by ",
+				    (tf->cpu.booke.esr & ESR_ST) ? "write"
+				    : "read", tf->dar);
+#else
+				db_printf("DSI %s trap @ %#zx by ",
 				    (tf->cpu.aim.dsisr & DSISR_STORE) ? "write"
 				    : "read", tf->dar);
+#endif
 				goto print_trap;
 			case EXC_ALI:
-				/* XXX take advantage of the union. */
 				db_printf("ALI trap @ %#zx (xSR %#x) ",
 				    tf->dar, (uint32_t)tf->cpu.aim.dsisr);
 				goto print_trap;
@@ -237,8 +242,8 @@ db_backtrace(struct thread *td, db_addr_t fp, int coun
 			case EXC_SC: trapstr = "SC"; break;
 			case EXC_EXI: trapstr = "EXI"; break;
 			case EXC_MCHK: trapstr = "MCHK"; break;
-#if !defined(BOOKE)
 			case EXC_VEC: trapstr = "VEC"; break;
+#if !defined(BOOKE)
 			case EXC_FPA: trapstr = "FPA"; break;
 			case EXC_BPT: trapstr = "BPT"; break;
 			case EXC_TRC: trapstr = "TRC"; break;


More information about the svn-src-all mailing list