Link the memory viewer with the debugger

This commit is contained in:
Eladash 2020-12-17 00:11:45 +02:00 committed by Megamouse
parent ba03df8511
commit 2172974db9
3 changed files with 27 additions and 3 deletions

View file

@ -1,6 +1,7 @@
#include "debugger_frame.h"
#include "register_editor_dialog.h"
#include "instruction_editor_dialog.h"
#include "memory_viewer_panel.h"
#include "gui_settings.h"
#include "debugger_list.h"
#include "breakpoint_list.h"
@ -313,6 +314,28 @@ void debugger_frame::keyPressEvent(QKeyEvent* event)
return;
}
case Qt::Key_M:
{
// Memory viewer
u32 addr = pc;
if (auto spu = static_cast<const spu_thread*>(cpu->id_type() == 2 ? cpu.get() : nullptr))
{
if (spu->get_type() != spu_type::threaded)
{
addr += RAW_SPU_BASE_ADDR + RAW_SPU_OFFSET * spu->index;
}
else
{
addr += SPU_FAKE_BASE_ADDR + SPU_LS_SIZE * (spu->id & 0xffffff);
}
}
auto mvp = new memory_viewer_panel(this, addr);
mvp->show();
return;
}
case Qt::Key_F10:
{
DoStep(true);