- added and use gdb-stub
git-svn-id: http://moon:8086/svn/mips@87 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
+9
-18
@@ -42,10 +42,9 @@ enum
|
||||
STATE_NUM_ENTRIES
|
||||
};
|
||||
|
||||
static int g_state;
|
||||
static int g_state = STATE_INIT;
|
||||
static char *g_state_names[STATE_NUM_ENTRIES] = {"Init", "Run", "Single step", "Precedure step"};
|
||||
|
||||
|
||||
typedef struct _sbp_t
|
||||
{
|
||||
uint32_t *pAddr;
|
||||
@@ -285,7 +284,7 @@ void singlestep(struct xcptcontext * xcp, uint32_t *pAddr_curr, uint32_t is_bran
|
||||
|
||||
}
|
||||
|
||||
void dbg_handler(struct xcptcontext * xcp)
|
||||
int dbg_handler(struct xcptcontext * xcp)
|
||||
{
|
||||
|
||||
uint32_t bp_addr, bp_index = 0, branch_addr, reg, result, bp_type;
|
||||
@@ -302,8 +301,13 @@ void dbg_handler(struct xcptcontext * xcp)
|
||||
pAddr_prev = pAddr_curr - 1;
|
||||
pAddr_next = pAddr_curr + 1;
|
||||
|
||||
if (g_state = STATE_INIT)
|
||||
{
|
||||
memset(&xcp_last, 0, sizeof(EXCEPTION_CONTEXT));
|
||||
}
|
||||
|
||||
dbg_puts_d("\n");dbg_puts_d(g_state_names[g_state]);dbg_puts_d("\n");
|
||||
|
||||
|
||||
if (IsBreak(*pAddr_curr))
|
||||
{
|
||||
bp_type = BreakGetType(*pAddr_curr);
|
||||
@@ -582,19 +586,6 @@ void dbg_handler(struct xcptcontext * xcp)
|
||||
} while (!leave_isr);
|
||||
|
||||
memcpy(&xcp_last, xcp, sizeof(EXCEPTION_CONTEXT));
|
||||
}
|
||||
|
||||
int debug_break(struct xcptcontext * xcp)
|
||||
{
|
||||
dbg_handler(xcp);
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
void dbg_init(void)
|
||||
{
|
||||
memset(&xcp_last, 0, sizeof(EXCEPTION_CONTEXT));
|
||||
g_state = STATE_INIT;
|
||||
xcpt_register(EXC_BP, debug_break);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user