diff options
author | 2019-09-10 15:11:00 -0400 | |
---|---|---|
committer | 2019-09-10 15:11:02 -0400 | |
commit | 53df4f447db0408d00bdcbee3105e013bdd19c3a (patch) | |
tree | 0ccccacae81b902088f16cf704345fa53b3b252b /src/osd/modules/debugger/qt/dasmwindow.cpp | |
parent | e52c9cc290a710c11fef4a08c715e46d04db9f07 (diff) |
Use std::forward_list for breakpoint and registerpoint lists (nw)
Diffstat (limited to 'src/osd/modules/debugger/qt/dasmwindow.cpp')
-rw-r--r-- | src/osd/modules/debugger/qt/dasmwindow.cpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/osd/modules/debugger/qt/dasmwindow.cpp b/src/osd/modules/debugger/qt/dasmwindow.cpp index 396f97c78bf..5c575b400b1 100644 --- a/src/osd/modules/debugger/qt/dasmwindow.cpp +++ b/src/osd/modules/debugger/qt/dasmwindow.cpp @@ -143,26 +143,17 @@ void DasmWindow::toggleBreakpointAtCursor(bool changedTo) device_debug *const cpuinfo = device->debug(); // Find an existing breakpoint at this address - int32_t bpindex = -1; - for (device_debug::breakpoint* bp = cpuinfo->breakpoint_first(); - bp != nullptr; - bp = bp->next()) - { - if (address == bp->address()) - { - bpindex = bp->index(); - break; - } - } + const device_debug::breakpoint *bp = cpuinfo->breakpoint_find(address); // If none exists, add a new one - if (bpindex == -1) + if (bp == nullptr) { - bpindex = cpuinfo->breakpoint_set(address, nullptr, nullptr); + int32_t bpindex = cpuinfo->breakpoint_set(address, nullptr, nullptr); m_machine->debugger().console().printf("Breakpoint %X set\n", bpindex); } else { + int32_t bpindex = bp->index(); cpuinfo->breakpoint_clear(bpindex); m_machine->debugger().console().printf("Breakpoint %X cleared\n", bpindex); } @@ -183,9 +174,7 @@ void DasmWindow::enableBreakpointAtCursor(bool changedTo) device_debug *const cpuinfo = device->debug(); // Find an existing breakpoint at this address - device_debug::breakpoint* bp = cpuinfo->breakpoint_first(); - while ((bp != nullptr) && (bp->address() != address)) - bp = bp->next(); + const device_debug::breakpoint *bp = cpuinfo->breakpoint_find(address); if (bp != nullptr) { @@ -241,9 +230,7 @@ void DasmWindow::dasmViewUpdated() device_debug *const cpuinfo = device->debug(); // Find an existing breakpoint at this address - device_debug::breakpoint* bp = cpuinfo->breakpoint_first(); - while ((bp != nullptr) && (bp->address() != address)) - bp = bp->next(); + const device_debug::breakpoint *bp = cpuinfo->breakpoint_find(address); if (bp != nullptr) { |