1 Index: bochs-2.2.6/cpu/exception.cc
2 diff -u bochs-2.2.6/cpu/exception.cc\~ bochs-2.2.6/cpu/exception.cc
3 --- bochs-2.2.6/cpu/exception.cc~ 2006-09-28 15:51:39.000000000 -0700
4 +++ bochs-2.2.6/cpu/exception.cc 2006-12-08 11:14:33.000000000 -0800
5 @@ -1033,6 +1033,10 @@ void BX_CPU_C::exception(unsigned vector
6 BX_CPU_THIS_PTR curr_exception[0] = exception_type;
10 + bx_gdbstub_exception(vector);
15 BX_CPU_THIS_PTR interrupt(vector, 0, push_error, error_code);
16 Index: bochs-2.2.6/gdbstub.cc
17 diff -u bochs-2.2.6/gdbstub.cc\~ bochs-2.2.6/gdbstub.cc
18 --- bochs-2.2.6/gdbstub.cc~ 2006-09-28 15:51:39.000000000 -0700
19 +++ bochs-2.2.6/gdbstub.cc 2006-12-08 11:12:03.000000000 -0800
20 @@ -26,6 +26,7 @@ static int last_stop_reason = GDBSTUB_ST
21 #define GDBSTUB_EXECUTION_BREAKPOINT (0xac1)
22 #define GDBSTUB_TRACE (0xac2)
23 #define GDBSTUB_USER_BREAK (0xac3)
24 +#define GDBSTUB_EXCEPTION_0E (0xac4)
26 static int listen_socket_fd;
28 @@ -271,6 +272,12 @@ int bx_gdbstub_check(unsigned int eip)
29 return(GDBSTUB_STOP_NO_REASON);
32 +void bx_gdbstub_exception(unsigned int nr)
35 + last_stop_reason = GDBSTUB_EXCEPTION_0E;
38 static int remove_breakpoint(unsigned int addr, int len)
41 @@ -452,6 +459,10 @@ static void debug_loop(void)
43 write_signal(&buf[1], SIGTRAP);
45 + else if (last_stop_reason == GDBSTUB_EXCEPTION_0E)
47 + write_signal(&buf[1], SIGSEGV);
51 write_signal(&buf[1], 0);
52 @@ -476,10 +487,14 @@ static void debug_loop(void)
54 write_signal(&buf[1], SIGTRAP);
57 + else if (last_stop_reason == GDBSTUB_EXCEPTION_0E)
59 write_signal(&buf[1], SIGSEGV);
63 + write_signal(&buf[1], 0);
68 Index: bochs-2.2.6/bochs.h
69 diff -u bochs-2.2.6/bochs.h\~ bochs-2.2.6/bochs.h
70 --- bochs-2.2.6/bochs.h~ 2006-09-28 15:51:39.000000000 -0700
71 +++ bochs-2.2.6/bochs.h 2006-12-08 11:14:19.000000000 -0800
72 @@ -375,6 +375,7 @@ BOCHSAPI extern logfunc_t *genlog;
73 // defines for GDB stub
74 void bx_gdbstub_init(int argc, char* argv[]);
75 int bx_gdbstub_check(unsigned int eip);
76 +void bx_gdbstub_exception(unsigned int nr);
77 #define GDBSTUB_STOP_NO_REASON (0xac0)