MCPcopy Create free account
hub / github.com/F-Stack/f-stack / makectx

Function makectx

freebsd/i386/i386/machdep.c:2747–2758  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

2745 * enough for a backtrace.
2746 */
2747void
2748makectx(struct trapframe *tf, struct pcb *pcb)
2749{
2750
2751 pcb->pcb_edi = tf->tf_edi;
2752 pcb->pcb_esi = tf->tf_esi;
2753 pcb->pcb_ebp = tf->tf_ebp;
2754 pcb->pcb_ebx = tf->tf_ebx;
2755 pcb->pcb_eip = tf->tf_eip;
2756 pcb->pcb_esp = (ISPL(tf->tf_cs)) ? tf->tf_esp : (int)(tf + 1) - 8;
2757 pcb->pcb_gs = rgs();
2758}
2759
2760int
2761ptrace_set_pc(struct thread *td, u_long addr)

Callers

nothing calls this directly

Calls 1

rgsFunction · 0.50

Tested by

no test coverage detected