- bugfix
Committed on the Free edition of March Hare Software CVSNT Server. Upgrade to CVS Suite for more features and support: http://march-hare.com/cvsnt/ git-svn-id: http://moon:8086/svn/vhdl/trunk@695 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
@@ -124,12 +124,12 @@ void dbg_handler(struct xcptcontext * xcp)
|
||||
case BP_MGMT_BASE_SS:
|
||||
|
||||
// Restore original instructions after single-step
|
||||
sputs("1. Restore after single-step at ");print_word((long)mgmt_bp_ss[0].pAddr);sputs("\n");
|
||||
// sputs("1. Restore after single-step at ");print_word((long)mgmt_bp_ss[0].pAddr);sputs("\n");
|
||||
*(mgmt_bp_ss[0].pAddr) = mgmt_bp_ss[0].instr;
|
||||
ICACHE_invalidate_at(mgmt_bp_ss[0].pAddr);
|
||||
if (mgmt_bp_ss[1].pAddr)
|
||||
{
|
||||
sputs("2. Restore after single-step at ");print_word((long)mgmt_bp_ss[1].pAddr);sputs("\n");
|
||||
// sputs("2. Restore after single-step at ");print_word((long)mgmt_bp_ss[1].pAddr);sputs("\n");
|
||||
*(mgmt_bp_ss[1].pAddr) = mgmt_bp_ss[1].instr;
|
||||
ICACHE_invalidate_at(mgmt_bp_ss[1].pAddr);
|
||||
}
|
||||
@@ -139,19 +139,19 @@ void dbg_handler(struct xcptcontext * xcp)
|
||||
case BP_MGMT_BASE_RU:
|
||||
|
||||
bp_index = BP_GET_ID(*pAddr_curr);
|
||||
sputs("Restore user break at ");print_word((long)user_bp[bp_index].pAddr);sputs("\n");
|
||||
// sputs("Restore user break at ");print_word((long)user_bp[bp_index].pAddr);sputs("\n");
|
||||
|
||||
*(user_bp[bp_index].pAddr) = BP_USER(bp_index);
|
||||
ICACHE_invalidate_at(user_bp[bp_index].pAddr);
|
||||
|
||||
*(mgmt_bp_ru[0].pAddr) = mgmt_bp_ru[0].instr;
|
||||
ICACHE_invalidate_at(mgmt_bp_ru[0].pAddr);
|
||||
sputs("1. Restore after RU at ");print_word((long)mgmt_bp_ru[0].pAddr);sputs("\n");
|
||||
// sputs("1. Restore after RU at ");print_word((long)mgmt_bp_ru[0].pAddr);sputs("\n");
|
||||
if (mgmt_bp_ru[1].pAddr)
|
||||
{
|
||||
*(mgmt_bp_ru[1].pAddr) = mgmt_bp_ru[1].instr;
|
||||
ICACHE_invalidate_at(mgmt_bp_ru[1].pAddr);
|
||||
sputs("2. Restore after RU at ");print_word((long)mgmt_bp_ru[1].pAddr);sputs("\n");
|
||||
// sputs("2. Restore after RU at ");print_word((long)mgmt_bp_ru[1].pAddr);sputs("\n");
|
||||
}
|
||||
if (!g_is_ss)
|
||||
return;
|
||||
@@ -162,12 +162,13 @@ void dbg_handler(struct xcptcontext * xcp)
|
||||
|
||||
is_user_bp = 1;
|
||||
bp_index = BP_GET_ID(*pAddr_curr);
|
||||
sputs("Restore instruction at ");print_word((long)user_bp[bp_index].pAddr);sputs("\n");
|
||||
// sputs("Restore instruction at ");print_word((long)user_bp[bp_index].pAddr);sputs("\n");
|
||||
*(user_bp[bp_index].pAddr) = user_bp[bp_index].instr;
|
||||
ICACHE_invalidate_at(user_bp[bp_index].pAddr);
|
||||
break;
|
||||
|
||||
default:
|
||||
// sputs("Found ordinary break at ");print_word((long)pAddr_curr);sputs("\n");
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -209,7 +210,7 @@ void dbg_handler(struct xcptcontext * xcp)
|
||||
ICACHE_invalidate_at(mgmt_bp_ru[0].pAddr);
|
||||
mgmt_bp_ru[1].pAddr = NULL;
|
||||
mgmt_bp_ru[1].pAddr = 0;
|
||||
sputs("1. Insert RU-break at ");print_word((long)mgmt_bp_ru[0].pAddr);sputs("\n");
|
||||
// sputs("1. Insert RU-break at ");print_word((long)mgmt_bp_ru[0].pAddr);sputs("\n");
|
||||
|
||||
// We have two possible management breaks, if previous instruction was branch or jump
|
||||
if (is_branch_shadow)
|
||||
@@ -226,7 +227,7 @@ void dbg_handler(struct xcptcontext * xcp)
|
||||
// Replace instruction with managment breakpoint
|
||||
*(mgmt_bp_ru[1].pAddr) = BP_MGMT_RU(bp_index);
|
||||
ICACHE_invalidate_at(mgmt_bp_ru[1].pAddr);
|
||||
sputs("2. Insert RU-break at ");print_word((long)mgmt_bp_ru[1].pAddr);sputs("\n");
|
||||
// sputs("2. Insert RU-break at ");print_word((long)mgmt_bp_ru[1].pAddr);sputs("\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,6 +239,13 @@ void dbg_handler(struct xcptcontext * xcp)
|
||||
case 'g':
|
||||
leave_isr = 1;
|
||||
g_is_ss = 0;
|
||||
if (IsBreak(*pAddr_curr))
|
||||
{
|
||||
if (BreakGetType(*pAddr_curr) != BP_USER_BASE)
|
||||
{
|
||||
xcp->epc += 4; // Skip ordinary program breaks
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
@@ -258,12 +266,23 @@ void dbg_handler(struct xcptcontext * xcp)
|
||||
g_is_ss = 1;
|
||||
leave_isr = 1;
|
||||
// Don't overwrite RU breaks
|
||||
// printf("is_user_bp = %d, IsBreak = %d, pAddr_curr = %08X, *pAddr_curr = %08X\n", is_user_bp, IsBreak(*pAddr_curr), pAddr_curr, *pAddr_curr);
|
||||
|
||||
if (is_user_bp)
|
||||
break;
|
||||
// Don't overwrite user breaks
|
||||
if (IsBreak(*pInstr) && (BreakGetType(*pInstr) == BP_USER_BASE))
|
||||
break;
|
||||
|
||||
// Don't overwrite user breaks
|
||||
if (IsBreak(*pAddr_curr))
|
||||
{
|
||||
if (BreakGetType(*pAddr_curr) == BP_USER_BASE)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
xcp->epc += 4; // Skip ordinary program breaks
|
||||
}
|
||||
}
|
||||
// Save original instruction
|
||||
mgmt_bp_ss[0].pAddr = pAddr_next;
|
||||
mgmt_bp_ss[0].instr = *(mgmt_bp_ss[0].pAddr);
|
||||
@@ -297,7 +316,7 @@ void dbg_handler(struct xcptcontext * xcp)
|
||||
if (is_user_bp)
|
||||
break;
|
||||
// Don't overwrite user breaks
|
||||
if (IsBreak(*pInstr) && (BreakGetType(*pInstr) == BP_USER_BASE))
|
||||
if (IsBreak(*pAddr_curr) && (BreakGetType(*pAddr_curr) == BP_USER_BASE))
|
||||
break;
|
||||
|
||||
// Save original instruction
|
||||
|
||||
Reference in New Issue
Block a user