diff options
Diffstat (limited to 'src/osd/modules/debugger/win/disasmbasewininfo.cpp')
-rw-r--r-- | src/osd/modules/debugger/win/disasmbasewininfo.cpp | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/osd/modules/debugger/win/disasmbasewininfo.cpp b/src/osd/modules/debugger/win/disasmbasewininfo.cpp index ef4c5122ba6..c466e059f23 100644 --- a/src/osd/modules/debugger/win/disasmbasewininfo.cpp +++ b/src/osd/modules/debugger/win/disasmbasewininfo.cpp @@ -115,9 +115,7 @@ void disasmbasewin_info::update_menu() device_debug *const debug = dasmview->source_device()->debug(); // first find an existing breakpoint at this address - device_debug::breakpoint *bp = debug->breakpoint_first(); - while ((bp != nullptr) && (bp->address() != address)) - bp = bp->next(); + const device_debug::breakpoint *bp = debug->breakpoint_find(address); if (bp == nullptr) { @@ -166,28 +164,21 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam) { offs_t const address = dasmview->selected_address(); device_debug *const debug = dasmview->source_device()->debug(); - int32_t bpindex = -1; // first find an existing breakpoint at this address - for (device_debug::breakpoint *bp = debug->breakpoint_first(); bp != nullptr; bp = bp->next()) - { - if (address == bp->address()) - { - bpindex = bp->index(); - break; - } - } + const device_debug::breakpoint *bp = debug->breakpoint_find(address); // if it doesn't exist, add a new one if (!is_main_console()) { - if (bpindex == -1) + if (bp == nullptr) { - bpindex = debug->breakpoint_set(address, nullptr, nullptr); + int32_t bpindex = debug->breakpoint_set(address, nullptr, nullptr); machine().debugger().console().printf("Breakpoint %X set\n", bpindex); } else { + int32_t bpindex = bp->index(); debug->breakpoint_clear(bpindex); machine().debugger().console().printf("Breakpoint %X cleared\n", bpindex); } @@ -197,10 +188,10 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam) else if (dasmview->source_is_visible_cpu()) { std::string command; - if (bpindex == -1) + if (bp == nullptr) command = string_format("bpset 0x%X", address); else - command = string_format("bpclear 0x%X", bpindex); + command = string_format("bpclear 0x%X", bp->index()); machine().debugger().console().execute_command(command.c_str(), true); } } @@ -213,9 +204,7 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam) device_debug *const debug = dasmview->source_device()->debug(); // first find an existing breakpoint at this address - device_debug::breakpoint *bp = debug->breakpoint_first(); - while ((bp != nullptr) && (bp->address() != address)) - bp = bp->next(); + const device_debug::breakpoint *bp = debug->breakpoint_find(address); // if it doesn't exist, add a new one if (bp != nullptr) |