Breakpoint clearing in CLI debugger

This commit is contained in:
Jeffrey Pfau 2014-02-01 15:39:30 -08:00
parent c30807117f
commit 9435226c58
1 changed files with 13 additions and 0 deletions

View File

@ -41,6 +41,7 @@ static void _readByte(struct CLIDebugger*, struct DebugVector*);
static void _readHalfword(struct CLIDebugger*, struct DebugVector*);
static void _readWord(struct CLIDebugger*, struct DebugVector*);
static void _setBreakpoint(struct CLIDebugger*, struct DebugVector*);
static void _clearBreakpoint(struct CLIDebugger*, struct DebugVector*);
static void _setWatchpoint(struct CLIDebugger*, struct DebugVector*);
static void _breakIntoDefault(int signal);
@ -53,6 +54,8 @@ static struct {
{ "break", _setBreakpoint },
{ "c", _continue },
{ "continue", _continue },
{ "d", _clearBreakpoint },
{ "delete", _clearBreakpoint },
{ "i", _printStatus },
{ "info", _printStatus },
{ "n", _next },
@ -209,6 +212,15 @@ static void _setBreakpoint(struct CLIDebugger* debugger, struct DebugVector* dv)
ARMDebuggerSetBreakpoint(&debugger->d, address);
}
static void _clearBreakpoint(struct CLIDebugger* debugger, struct DebugVector* dv) {
if (!dv || dv->type != INT_TYPE) {
printf("%s\n", ERROR_MISSING_ARGS);
return;
}
uint32_t address = dv->intValue;
ARMDebuggerClearBreakpoint(&debugger->d, address);
}
static void _setWatchpoint(struct CLIDebugger* debugger, struct DebugVector* dv) {
if (!dv || dv->type != INT_TYPE) {
printf("%s\n", ERROR_MISSING_ARGS);
@ -532,6 +544,7 @@ static void _reportEntry(struct ARMDebugger* debugger, enum DebuggerEntryReason
(void) (debugger);
switch (reason) {
case DEBUGGER_ENTER_MANUAL:
case DEBUGGER_ENTER_ATTACHED:
break;
case DEBUGGER_ENTER_BREAKPOINT:
printf("Hit breakpoint\n");