MCPcopy Create free account
hub / github.com/TASEmulators/fceux / DeleteBreak

Function DeleteBreak

src/drivers/win/debugger.cpp:1233–1280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1231}
1232
1233void DeleteBreak(int sel)
1234{
1235 if(sel<0) return;
1236 if(sel>=numWPs) return;
1237 if (watchpoint[sel].cond)
1238 delete watchpoint[sel].cond;
1239 if (watchpoint[sel].condText)
1240 free(watchpoint[sel].condText);
1241 if (watchpoint[sel].desc)
1242 free(watchpoint[sel].desc);
1243 // move all BP items up in the list
1244 for (int i = sel; i < numWPs; i++) {
1245 watchpoint[i].address = watchpoint[i+1].address;
1246 watchpoint[i].endaddress = watchpoint[i+1].endaddress;
1247 watchpoint[i].flags = watchpoint[i+1].flags;
1248// ################################## Start of SP CODE ###########################
1249 watchpoint[i].cond = watchpoint[i+1].cond;
1250 watchpoint[i].condText = watchpoint[i+1].condText;
1251 watchpoint[i].desc = watchpoint[i+1].desc;
1252// ################################## End of SP CODE ###########################
1253 }
1254 // erase last BP item
1255 watchpoint[numWPs].address = 0;
1256 watchpoint[numWPs].endaddress = 0;
1257 watchpoint[numWPs].flags = 0;
1258 watchpoint[numWPs].cond = 0;
1259 watchpoint[numWPs].condText = 0;
1260 watchpoint[numWPs].desc = 0;
1261 numWPs--;
1262// ################################## Start of SP CODE ###########################
1263 myNumWPs--;
1264// ################################## End of SP CODE ###########################
1265 SendDlgItemMessage(hDebug,IDC_DEBUGGER_BP_LIST,LB_DELETESTRING,sel,0);
1266 // select next item in the list
1267 if (numWPs)
1268 {
1269 if (sel >= (numWPs - 1))
1270 // select last item
1271 SendDlgItemMessage(hDebug, IDC_DEBUGGER_BP_LIST, LB_SETCURSEL, numWPs - 1, 0);
1272 else
1273 SendDlgItemMessage(hDebug, IDC_DEBUGGER_BP_LIST, LB_SETCURSEL, sel, 0);
1274 } else
1275 {
1276 EnableWindow(GetDlgItem(hDebug,IDC_DEBUGGER_BP_DEL),FALSE);
1277 EnableWindow(GetDlgItem(hDebug,IDC_DEBUGGER_BP_EDIT),FALSE);
1278 }
1279 UpdateBreakpointsCaption();
1280}
1281
1282void KillDebugger() {
1283 if (hDebug)

Callers 1

DebuggerCallBFunction · 0.70

Calls 1

UpdateBreakpointsCaptionFunction · 0.85

Tested by

no test coverage detected