- 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:
2017-01-21 17:46:50 +00:00
parent d1f91b7282
commit c6962aef49
5 changed files with 12 additions and 7 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ else
ENDIAN_FLAGS=-EB ENDIAN_FLAGS=-EB
endif 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 LFLAGS=$(ENDIAN_FLAGS) -Os -flto
ifeq ($(TLB),yes) ifeq ($(TLB),yes)
+8 -2
View File
@@ -13,11 +13,17 @@
extern uart_if_t uart_if[]; extern uart_if_t uart_if[];
extern void handle_exception (unsigned long *registers); extern void handle_exception (unsigned long *registers);
extern int gdb_stub(struct xcptcontext * xcp) __attribute__ ((section (".gdb"))) __attribute__ ((used)); extern int dbg_stub(struct xcptcontext * xcp) __attribute__ ((section (".dbg_stub"))) __attribute__ ((used));
int gdb_stub(struct xcptcontext * xcp)
int dbg_stub(struct xcptcontext * xcp)
{ {
#ifdef WITH_GDB_STUB
handle_exception((unsigned long *)xcp); handle_exception((unsigned long *)xcp);
return 0; return 0;
#else
return dbg_handler(xcp);
#endif
} }
void dbg_putchar(char c) void dbg_putchar(char c)
+1 -1
View File
@@ -22,7 +22,7 @@ SECTIONS
*(.text*) *(.text*)
*(.rodata*) *(.rodata*)
. = ORIGIN(rom) + 0x1F00; . = ORIGIN(rom) + 0x1F00;
*(.gdb*) *(.dbg_stub*)
} > rom } > rom
.data ORIGIN(ram) : .data ORIGIN(ram) :
+1 -1
View File
@@ -116,7 +116,7 @@ void flush_i_cache()
/* at least NUMREGBYTES*2 are needed for register packets */ /* at least NUMREGBYTES*2 are needed for register packets */
#define BUFMAX 2048 #define BUFMAX 2048
static const char hexchars[]="0123456789abcdef"; const char hexchars[]="0123456789abcdef";
#define NUMREGS 72 #define NUMREGS 72
+1 -2
View File
@@ -5,8 +5,7 @@
.section .exc_vect, "ax" .section .exc_vect, "ax"
.align 2 .align 2
_xcpt_vector_tbl: _xcpt_vector_tbl:
la k0, _xcpt_handler j _xcpt_handler
jr k0
nop nop
.text .text