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 (struct StackFrame *frame, char *regs)
29 mem2hex (&frame->ExceptionEAX, ®s[0 * 4 * 2], 4 * 8, 0);
32 mem2hex (&frame->ExceptionPC, ®s[8 * 4 * 2], 4 * 2, 0);
35 mem2hex (&frame->ExceptionCS, ®s[10 * 4 * 2], 4 * 3, 0);
38 mem2hex (&frame->ExceptionES, ®s[13 * 4 * 2], 4 * 1, 0);
41 mem2hex (&frame->ExceptionFS, ®s[14 * 4 * 2], 4 * 2, 0);
44 /* Put the registers back into the frame information. */
47 registers_to_frame (char *regs, struct StackFrame *frame)
50 hex2mem (®s[0 * 4 * 2], &frame->ExceptionEAX, 4 * 8, 0);
53 hex2mem (®s[8 * 4 * 2], &frame->ExceptionPC, 4 * 2, 0);
56 hex2mem (®s[10 * 4 * 2], &frame->ExceptionCS, 4 * 3, 0);
59 hex2mem (®s[13 * 4 * 2], &frame->ExceptionES, 4 * 1, 0);
62 hex2mem (®s[14 * 4 * 2], &frame->ExceptionFS, 4 * 2, 0);
66 set_step_traps (struct StackFrame *frame)
68 frame->ExceptionSystemFlags |= 0x100;
72 clear_step_traps (struct StackFrame *frame)
74 frame->ExceptionSystemFlags &= ~0x100;
78 do_status (char *ptr, struct StackFrame *frame)
82 sigval = computeSignal (frame->ExceptionNumber);
84 sprintf (ptr, "T%02x", sigval);
87 sprintf (ptr, "%02x:", PC_REGNUM);
88 ptr = mem2hex (&frame->ExceptionPC, ptr + 3, 4, 0);
91 sprintf (ptr, "%02x:", SP_REGNUM);
92 ptr = mem2hex (&frame->ExceptionESP, ptr + 3, 4, 0);
95 sprintf (ptr, "%02x:", FP_REGNUM);
96 ptr = mem2hex (&frame->ExceptionEBP, ptr + 3, 4, 0);