PERFORCE change 56546 for review
Marcel Moolenaar
marcel at FreeBSD.org
Mon Jul 5 15:05:39 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=56546
Change 56546 by marcel at marcel_nfs on 2004/07/05 22:05:37
Implement makectx() on alpha. Tested and working.
Affected files ...
.. //depot/projects/gdb/sys/alpha/alpha/machdep.c#11 edit
Differences ...
==== //depot/projects/gdb/sys/alpha/alpha/machdep.c#11 (text+ko) ====
@@ -1974,6 +1974,29 @@
#endif
}
+/*
+ * Construct a PCB from a trapframe. This is called from kdb_trap() where
+ * we want to start a backtrace from the function that caused us to enter
+ * the debugger. We have the context in the trapframe, but base the trace
+ * on the PCB. The PCB doesn't have to be perfect, as long as it contains
+ * enough for a backtrace.
+ */
+void
+makectx(struct trapframe *tf, struct pcb *pcb)
+{
+
+ pcb->pcb_context[0] = tf->tf_regs[FRAME_S0];
+ pcb->pcb_context[1] = tf->tf_regs[FRAME_S1];
+ pcb->pcb_context[2] = tf->tf_regs[FRAME_S2];
+ pcb->pcb_context[3] = tf->tf_regs[FRAME_S3];
+ pcb->pcb_context[4] = tf->tf_regs[FRAME_S4];
+ pcb->pcb_context[5] = tf->tf_regs[FRAME_S5];
+ pcb->pcb_context[6] = tf->tf_regs[FRAME_S6];
+ pcb->pcb_context[7] = tf->tf_regs[FRAME_PC];
+ pcb->pcb_context[8] = tf->tf_regs[FRAME_PS];
+ pcb->pcb_hw.apcb_ksp = tf->tf_regs[FRAME_SP];
+}
+
int
fill_regs(td, regs)
struct thread *td;
More information about the p4-projects
mailing list