diff options
-rw-r--r-- | c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c | 25 |
2 files changed, 29 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog b/c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog index 1fd3679b3f..3ee2b5418a 100644 --- a/c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog +++ b/c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog @@ -1,5 +1,11 @@ 2002-02-08 Joel Sherrill <joel@OARcorp.com> + * mips-stub.c (handle_exception): Prototype changed to be an RTEMS + entry point. Added comments about possible need to flush cache. + (mips_gdb_stub_install): New routine. + +2002-02-08 Joel Sherrill <joel@OARcorp.com> + * Makefile, stubinit.S, r46kstub.ld, ioaddr.h: Removed as unused with RTEMS. * r46kstub.c: Renamed to mips-stub.c. diff --git a/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c b/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c index 5eb8b78355..6ff496a050 100644 --- a/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c +++ b/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c @@ -779,8 +779,7 @@ computeSignal (void) * it figures out why it was activated and tells gdb, and then it * reacts to gdb's requests. */ -void -handle_exception (CPU_Interrupt_frame *frame) +void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame) { int host_has_detached = 0; int sigval; @@ -906,5 +905,27 @@ handle_exception (CPU_Interrupt_frame *frame) /* reply to the request */ putpacket (outBuffer); } + + /* + * The original code did this in the assembly wrapper. We should consider + * doing it here before we return. + * + * On exit from the exception handler invalidate each line in the I-cache + * and write back each dirty line in the D-cache. This needs to be done + * before the target program is resumed in order to ensure that software + * breakpoints and downloaded code will actually take effect. + */ + return; } + +void mips_gdb_stub_install(void) +{ + rtems_isr_entry old; + + rtems_interrupt_catch( (rtems_isr_entry) handle_exception, MIPS_EXCEPTION_SYSCALL, &old ); + /* rtems_interrupt_catch( handle_exception, MIPS_EXCEPTION_BREAK, &old ); */ + + /* get the attention of gdb */ + mips_break(); +} |