14 extern char *mem2hex (void *mem, char *buf, int count, int may_fault);
15 extern char *hex2mem (char *buf, void *mem, int count, int may_fault);
16 extern int computeSignal (int exceptionVector);
23 /* Get the registers out of the frame information. */
26 frame_to_registers (frame, regs)
27 struct StackFrame *frame;
31 mem2hex (&frame->ExceptionEAX, ®s[0 * 4 * 2], 4 * 8, 0);
34 mem2hex (&frame->ExceptionPC, ®s[8 * 4 * 2], 4 * 2, 0);
37 mem2hex (&frame->ExceptionCS, ®s[10 * 4 * 2], 4 * 3, 0);
40 mem2hex (&frame->ExceptionES, ®s[13 * 4 * 2], 4 * 1, 0);
43 mem2hex (&frame->ExceptionFS, ®s[14 * 4 * 2], 4 * 2, 0);
46 /* Put the registers back into the frame information. */
49 registers_to_frame (regs, frame)
51 struct StackFrame *frame;
54 hex2mem (®s[0 * 4 * 2], &frame->ExceptionEAX, 4 * 8, 0);
57 hex2mem (®s[8 * 4 * 2], &frame->ExceptionPC, 4 * 2, 0);
60 hex2mem (®s[10 * 4 * 2], &frame->ExceptionCS, 4 * 3, 0);
63 hex2mem (®s[13 * 4 * 2], &frame->ExceptionES, 4 * 1, 0);
66 hex2mem (®s[14 * 4 * 2], &frame->ExceptionFS, 4 * 2, 0);
70 set_step_traps (frame)
71 struct StackFrame *frame;
73 frame->ExceptionSystemFlags |= 0x100;
77 clear_step_traps (frame)
78 struct StackFrame *frame;
80 frame->ExceptionSystemFlags &= ~0x100;
84 do_status (ptr, frame)
86 struct StackFrame *frame;
90 sigval = computeSignal (frame->ExceptionNumber);
92 sprintf (ptr, "T%02x", sigval);
95 sprintf (ptr, "%02x:", PC_REGNUM);
96 ptr = mem2hex (&frame->ExceptionPC, ptr + 3, 4, 0);
99 sprintf (ptr, "%02x:", SP_REGNUM);
100 ptr = mem2hex (&frame->ExceptionESP, ptr + 3, 4, 0);
103 sprintf (ptr, "%02x:", FP_REGNUM);
104 ptr = mem2hex (&frame->ExceptionEBP, ptr + 3, 4, 0);