PERFORCE change 54796 for review

Marcel Moolenaar marcel at FreeBSD.org
Sun Jun 13 07:21:42 GMT 2004


http://perforce.freebsd.org/chv.cgi?CH=54796

Change 54796 by marcel at marcel_nfs on 2004/06/13 07:20:13

	Replace trapframe references with PCB references.

Affected files ...

.. //depot/projects/gdb/sys/i386/i386/gdb_machdep.c#7 edit

Differences ...

==== //depot/projects/gdb/sys/i386/i386/gdb_machdep.c#7 (text+ko) ====

@@ -34,10 +34,8 @@
 #include <sys/proc.h>
 #include <sys/signal.h>
 
-#include <machine/frame.h>
 #include <machine/gdb_machdep.h>
-#include <machine/psl.h>
-#include <machine/reg.h>
+#include <machine/pcb.h>
 #include <machine/trap.h>
 
 #include <gdb/gdb.h>
@@ -45,30 +43,15 @@
 void *
 gdb_cpu_getreg(int regnum, size_t *regsz)
 {
-	static register_t synth;
-	struct trapframe *tf = kdb_frame;
 
 	*regsz = gdb_cpu_regsz(regnum);
 	switch (regnum) {
-	case 0:  return (&tf->tf_eax);
-	case 1:  return (&tf->tf_ecx);
-	case 2:  return (&tf->tf_edx);
-	case 3:  return (&tf->tf_ebx);
-	case 5:  return (&tf->tf_ebp);
-	case 6:  return (&tf->tf_esi);
-	case 7:  return (&tf->tf_edi);
-	case 8:  return (&tf->tf_eip);
-	case 9:  return (&tf->tf_eflags);
-	case 10: return (&tf->tf_cs);
-	case 12: return (&tf->tf_ds);
-	case 13: return (&tf->tf_es);
-	case 4:
-		synth = (!ISPL(tf->tf_cs)) ?
-		    (int)&(kdb_thread->td_frame->tf_esp) : tf->tf_esp;
-		return (&synth);
-	case 11:
-		synth = (!ISPL(tf->tf_cs)) ? rss() : tf->tf_ss;
-		return (&synth);
+	case 3:  return (&kdb_thrctx->pcb_ebx);
+	case 4:  return (&kdb_thrctx->pcb_esp);
+	case 5:  return (&kdb_thrctx->pcb_ebp);
+	case 6:  return (&kdb_thrctx->pcb_esi);
+	case 7:  return (&kdb_thrctx->pcb_edi);
+	case 8:  return (&kdb_thrctx->pcb_eip);
 	}
 	return (NULL);
 }
@@ -76,10 +59,9 @@
 void
 gdb_cpu_setreg(int regnum, register_t val)
 {
-	struct trapframe *tf = kdb_frame;
 
 	switch (regnum) {
-	case GDB_REG_PC: tf->tf_eip = val; break;
+	case GDB_REG_PC: kdb_thrctx->pcb_eip = val; break;
 	}
 }
 


More information about the p4-projects mailing list