diff options
author | 2020-05-25 11:15:39 -0400 | |
---|---|---|
committer | 2020-05-25 11:15:39 -0400 | |
commit | 0fa6e7eb86d3b247c46f840ef230c9331f3cc948 (patch) | |
tree | e01509e44adcff62a7d8e087c58572fce6b90e13 /src/osd/modules/debugger/qt/mainwindow.cpp | |
parent | ad7a31ad57b09e1e0e9bb1adb03767f9dd386605 (diff) |
Debugger expression and memory access overhaul
- Memory references in expressions no longer default to the console's visible CPU if no device name was specified, except when entered through the console itself. Expressions in view windows now use the context of the currently selected device instead.
- The pcatmem debug command and similar qt mouseover function now produce an error message if the initial address translation fails.
Related internal changes (nw)
- The debugger_cpu class no longer interprets memory accesses. The existing routines have been moved into symbol_table (which used to invoke them as callbacks), and reimplemented in most other places. Thecode duplication is a bit messy, but could be potentially improved in the future with new utility classes.
- The cheat engine no longer needs to hook into the debugger_cpu class or instantiate a dummy instance of it.
- The inclusion of debug/express.h within emu.h has been undone. Some debugging structures now need unique_ptr to wrap the resulting incomplete classes; hopefully the performance impact of this is negligible. Another direct consequence is that the breakpoint, watchpoint and registerpoint classes are no longer inside device_debug and have their own source file.
- The breakpoint list is now a std::multimap, using the addresses as keys to hopefully expedite lookup.
- The visible CPU pointer has been removed from the debugger_cpu class, being now considered a property of the console instead.
- Many minor bits of code have been simplified.
Diffstat (limited to 'src/osd/modules/debugger/qt/mainwindow.cpp')
-rw-r--r-- | src/osd/modules/debugger/qt/mainwindow.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/osd/modules/debugger/qt/mainwindow.cpp b/src/osd/modules/debugger/qt/mainwindow.cpp index 6a79ebf955d..f2026db67e9 100644 --- a/src/osd/modules/debugger/qt/mainwindow.cpp +++ b/src/osd/modules/debugger/qt/mainwindow.cpp @@ -14,6 +14,7 @@ #include "debug/debugcon.h" #include "debug/debugcpu.h" #include "debug/dvdisasm.h" +#include "debug/points.h" MainWindow::MainWindow(running_machine* machine, QWidget* parent) : @@ -214,13 +215,13 @@ bool MainWindow::eventFilter(QObject* obj, QEvent* event) void MainWindow::toggleBreakpointAtCursor(bool changedTo) { debug_view_disasm *const dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view()); - if (dasmView->cursor_visible() && (m_machine->debugger().cpu().get_visible_cpu() == dasmView->source()->device())) + if (dasmView->cursor_visible() && (m_machine->debugger().console().get_visible_cpu() == dasmView->source()->device())) { offs_t const address = downcast<debug_view_disasm *>(dasmView)->selected_address(); device_debug *const cpuinfo = dasmView->source()->device()->debug(); // Find an existing breakpoint at this address - const device_debug::breakpoint *bp = cpuinfo->breakpoint_find(address); + const debug_breakpoint *bp = cpuinfo->breakpoint_find(address); // If none exists, add a new one std::string command; @@ -242,13 +243,13 @@ void MainWindow::toggleBreakpointAtCursor(bool changedTo) void MainWindow::enableBreakpointAtCursor(bool changedTo) { debug_view_disasm *const dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view()); - if (dasmView->cursor_visible() && (m_machine->debugger().cpu().get_visible_cpu() == dasmView->source()->device())) + if (dasmView->cursor_visible() && (m_machine->debugger().console().get_visible_cpu() == dasmView->source()->device())) { offs_t const address = dasmView->selected_address(); device_debug *const cpuinfo = dasmView->source()->device()->debug(); // Find an existing breakpoint at this address - const device_debug::breakpoint *bp = cpuinfo->breakpoint_find(address); + const debug_breakpoint *bp = cpuinfo->breakpoint_find(address); if (bp != nullptr) { @@ -265,7 +266,7 @@ void MainWindow::enableBreakpointAtCursor(bool changedTo) void MainWindow::runToCursor(bool changedTo) { debug_view_disasm* dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view()); - if (dasmView->cursor_visible() && (m_machine->debugger().cpu().get_visible_cpu() == dasmView->source()->device())) + if (dasmView->cursor_visible() && (m_machine->debugger().console().get_visible_cpu() == dasmView->source()->device())) { offs_t address = downcast<debug_view_disasm*>(dasmView)->selected_address(); std::string command = string_format("go 0x%X", address); @@ -304,7 +305,7 @@ void MainWindow::executeCommand(bool withClear) // A blank command is a "silent step" if (command == "") { - m_machine->debugger().cpu().get_visible_cpu()->debug()->single_step(); + m_machine->debugger().console().get_visible_cpu()->debug()->single_step(); return; } @@ -396,7 +397,7 @@ void MainWindow::unmountImage(bool changedTo) void MainWindow::dasmViewUpdated() { debug_view_disasm *const dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view()); - bool const haveCursor = dasmView->cursor_visible() && (m_machine->debugger().cpu().get_visible_cpu() == dasmView->source()->device()); + bool const haveCursor = dasmView->cursor_visible() && (m_machine->debugger().console().get_visible_cpu() == dasmView->source()->device()); bool haveBreakpoint = false; bool breakpointEnabled = false; if (haveCursor) @@ -406,7 +407,7 @@ void MainWindow::dasmViewUpdated() device_debug *const cpuinfo = device->debug(); // Find an existing breakpoint at this address - const device_debug::breakpoint *bp = cpuinfo->breakpoint_find(address); + const debug_breakpoint *bp = cpuinfo->breakpoint_find(address); if (bp != nullptr) { |