- refactored debugger
- jump to exc-handler instead of call git-svn-id: http://moon:8086/svn/mips@115 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
@@ -12,7 +12,7 @@ else
|
||||
ENDIAN_FLAGS=-EB
|
||||
endif
|
||||
|
||||
CFLAGS=$(ENDIAN_FLAGS) -Os -flto -Wl,-M -I. -I../libsys -msoft-float -march=r3000 -G0 -I../libsys/boards/$(BOARD) -D$(BOARD)
|
||||
CFLAGS=$(ENDIAN_FLAGS) -Os -flto -Wl,-M -I. -I../libsys -msoft-float -march=r3000 -G0 -I../libsys/boards/$(BOARD) -D$(BOARD) -DWITH_GDB_STUB
|
||||
LFLAGS=$(ENDIAN_FLAGS) -Os -flto
|
||||
|
||||
ifeq ($(TLB),yes)
|
||||
|
||||
@@ -13,11 +13,17 @@
|
||||
extern uart_if_t uart_if[];
|
||||
extern void handle_exception (unsigned long *registers);
|
||||
|
||||
extern int gdb_stub(struct xcptcontext * xcp) __attribute__ ((section (".gdb"))) __attribute__ ((used));
|
||||
int gdb_stub(struct xcptcontext * xcp)
|
||||
extern int dbg_stub(struct xcptcontext * xcp) __attribute__ ((section (".dbg_stub"))) __attribute__ ((used));
|
||||
|
||||
int dbg_stub(struct xcptcontext * xcp)
|
||||
{
|
||||
#ifdef WITH_GDB_STUB
|
||||
handle_exception((unsigned long *)xcp);
|
||||
return 0;
|
||||
#else
|
||||
return dbg_handler(xcp);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void dbg_putchar(char c)
|
||||
|
||||
@@ -22,7 +22,7 @@ SECTIONS
|
||||
*(.text*)
|
||||
*(.rodata*)
|
||||
. = ORIGIN(rom) + 0x1F00;
|
||||
*(.gdb*)
|
||||
*(.dbg_stub*)
|
||||
} > rom
|
||||
|
||||
.data ORIGIN(ram) :
|
||||
|
||||
@@ -116,7 +116,7 @@ void flush_i_cache()
|
||||
/* at least NUMREGBYTES*2 are needed for register packets */
|
||||
#define BUFMAX 2048
|
||||
|
||||
static const char hexchars[]="0123456789abcdef";
|
||||
const char hexchars[]="0123456789abcdef";
|
||||
|
||||
#define NUMREGS 72
|
||||
|
||||
|
||||
+1
-2
@@ -5,8 +5,7 @@
|
||||
.section .exc_vect, "ax"
|
||||
.align 2
|
||||
_xcpt_vector_tbl:
|
||||
la k0, _xcpt_handler
|
||||
jr k0
|
||||
j _xcpt_handler
|
||||
nop
|
||||
.text
|
||||
|
||||
|
||||
Reference in New Issue
Block a user