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,7 @@ void BX_CPU_C::exception(unsigned vector
6 BX_CPU_THIS_PTR curr_exception[0] = exception_type;
9 + bx_gdbstub_exception(vector);
12 BX_CPU_THIS_PTR interrupt(vector, 0, push_error, error_code);
13 Index: bochs-2.2.6/gdbstub.cc
14 diff -u bochs-2.2.6/gdbstub.cc\~ bochs-2.2.6/gdbstub.cc
15 --- bochs-2.2.6/gdbstub.cc~ 2006-09-28 15:51:39.000000000 -0700
16 +++ bochs-2.2.6/gdbstub.cc 2006-12-08 11:12:03.000000000 -0800
17 @@ -26,6 +26,7 @@ static int last_stop_reason = GDBSTUB_ST
18 #define GDBSTUB_EXECUTION_BREAKPOINT (0xac1)
19 #define GDBSTUB_TRACE (0xac2)
20 #define GDBSTUB_USER_BREAK (0xac3)
21 +#define GDBSTUB_EXCEPTION_0E (0xac4)
23 static int listen_socket_fd;
25 @@ -271,6 +272,12 @@ int bx_gdbstub_check(unsigned int eip)
26 return(GDBSTUB_STOP_NO_REASON);
29 +void bx_gdbstub_exception(unsigned int nr)
32 + last_stop_reason = GDBSTUB_EXCEPTION_0E;
35 static int remove_breakpoint(unsigned int addr, int len)
38 @@ -452,6 +459,10 @@ static void debug_loop(void)
40 write_signal(&buf[1], SIGTRAP);
42 + else if (last_stop_reason == GDBSTUB_EXCEPTION_0E)
44 + write_signal(&buf[1], SIGSEGV);
48 write_signal(&buf[1], 0);
49 @@ -476,10 +487,14 @@ static void debug_loop(void)
51 write_signal(&buf[1], SIGTRAP);
54 + else if (last_stop_reason == GDBSTUB_EXCEPTION_0E)
56 write_signal(&buf[1], SIGSEGV);
60 + write_signal(&buf[1], 0);
65 Index: bochs-2.2.6/bochs.h
66 diff -u bochs-2.2.6/bochs.h\~ bochs-2.2.6/bochs.h
67 --- bochs-2.2.6/bochs.h~ 2006-09-28 15:51:39.000000000 -0700
68 +++ bochs-2.2.6/bochs.h 2006-12-08 11:14:19.000000000 -0800
69 @@ -375,6 +375,7 @@ BOCHSAPI extern logfunc_t *genlog;
70 // defines for GDB stub
71 void bx_gdbstub_init(int argc, char* argv[]);
72 int bx_gdbstub_check(unsigned int eip);
73 +void bx_gdbstub_exception(unsigned int nr);
74 #define GDBSTUB_STOP_NO_REASON (0xac0)