Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jul 2004 22:05:38 GMT
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 56546 for review
Message-ID:  <200407052205.i65M5cPl092332@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=56546

Change 56546 by marcel@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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407052205.i65M5cPl092332>