Simplified down to a single clear command that remove all watches/breakpoints at a given address; updated version to 0.42

Change-Id: I1a1f931a6d39f913610e4b58d54f102b264902e7
This commit is contained in:
David Banks 2015-06-27 11:20:49 +01:00
parent 9a68d96233
commit 401af8253a

View File

@ -337,12 +337,12 @@ char *triggerStrings[NUM_TRIGGERS] = {
}; };
#define VERSION "0.41" #define VERSION "0.42"
#ifdef CPUEMBEDDED #ifdef CPUEMBEDDED
#define NUM_CMDS 27 #define NUM_CMDS 22
#else #else
#define NUM_CMDS 19 #define NUM_CMDS 14
#endif #endif
#if (CPU == Z80) #if (CPU == Z80)
@ -436,12 +436,7 @@ char *cmdStrings[NUM_CMDS] = {
"watchi", "watchi",
"watchr", "watchr",
"watchw", "watchw",
"bcleari", "clear",
"bclearr",
"bclearw",
"wcleari",
"wclearr",
"wclearw",
"trigger" "trigger"
}; };
@ -1136,18 +1131,15 @@ void doCmdWatchW(char *params) {
doCmdBreak(params, 1 << WATCH_WRITE); doCmdBreak(params, 1 << WATCH_WRITE);
} }
void doCmdBClear(char *params, unsigned int mode) { void doCmdClear(char *params) {
int i; int i;
int n = lookupBreakpoint(params); int n = lookupBreakpoint(params);
if (n < 0) { if (n < 0) {
return; return;
} }
if (modes[n] & mode) {
log0("Removing "); log0("Removing ");
logMode(mode); logMode(modes[n]);
log0(" at %04X\n", breakpoints[n]); log0(" at %04X\n", breakpoints[n]);
modes[n] &= ~mode;
if (modes[n] == 0) {
for (i = n; i < numbkpts; i++) { for (i = n; i < numbkpts; i++) {
breakpoints[i] = breakpoints[i + 1]; breakpoints[i] = breakpoints[i + 1];
masks[i] = masks[i + 1]; masks[i] = masks[i + 1];
@ -1155,35 +1147,6 @@ void doCmdBClear(char *params, unsigned int mode) {
triggers[i] = triggers[i + 1]; triggers[i] = triggers[i + 1];
} }
numbkpts--; numbkpts--;
}
} else {
logMode(mode);
log0(" not set at %04X\n", breakpoints[n]);
}
}
void doCmdBClearI(char *params) {
doCmdBClear(params, 1 << BRKPT_EXEC);
}
void doCmdBClearR(char *params) {
doCmdBClear(params, 1 << BRKPT_READ);
}
void doCmdBClearW(char *params) {
doCmdBClear(params, 1 << BRKPT_WRITE);
}
void doCmdWClearI(char *params) {
doCmdBClear(params, 1 << WATCH_EXEC);
}
void doCmdWClearR(char *params) {
doCmdBClear(params, 1 << WATCH_READ);
}
void doCmdWClearW(char *params) {
doCmdBClear(params, 1 << WATCH_WRITE);
} }
void doCmdTrigger(char *params) { void doCmdTrigger(char *params) {
@ -1338,12 +1301,7 @@ void (*cmdFuncs[NUM_CMDS])(char *params) = {
doCmdWatchI, doCmdWatchI,
doCmdWatchR, doCmdWatchR,
doCmdWatchW, doCmdWatchW,
doCmdBClearI, doCmdClear,
doCmdBClearR,
doCmdBClearW,
doCmdWClearI,
doCmdWClearR,
doCmdWClearW,
doCmdTrigger doCmdTrigger
}; };