mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-06 00:59:18 +00:00
fix debugger o.O (#2903)
* fix debugger o.O * minor simplification * how did I not see this the first time
This commit is contained in:
parent
51ce8f6c20
commit
4ce8e9ba16
@ -88,9 +88,6 @@ debugger_frame::debugger_frame(QWidget *parent) : QDockWidget(tr("Debugger"), pa
|
|||||||
});
|
});
|
||||||
connect(m_choice_units, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &debugger_frame::UpdateUI);
|
connect(m_choice_units, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &debugger_frame::UpdateUI);
|
||||||
connect(m_choice_units, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &debugger_frame::OnSelectUnit);
|
connect(m_choice_units, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &debugger_frame::OnSelectUnit);
|
||||||
connect(m_choice_units, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), m_list, [=](int index) {
|
|
||||||
m_list->m_noThreadSelected = m_choice_units->itemText(index) == NoThread ? true : false;
|
|
||||||
});
|
|
||||||
connect(this, &QDockWidget::visibilityChanged, this, &debugger_frame::EnableUpdateTimer);
|
connect(this, &QDockWidget::visibilityChanged, this, &debugger_frame::EnableUpdateTimer);
|
||||||
|
|
||||||
m_list->ShowAddr(CentrePc(m_list->m_pc));
|
m_list->ShowAddr(CentrePc(m_list->m_pc));
|
||||||
@ -103,7 +100,6 @@ void debugger_frame::closeEvent(QCloseEvent *event)
|
|||||||
emit DebugFrameClosed();
|
emit DebugFrameClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
//static const int show_lines = 30;
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
std::map<u32, bool> g_breakpoints;
|
std::map<u32, bool> g_breakpoints;
|
||||||
@ -137,6 +133,8 @@ void debugger_frame::UpdateUI()
|
|||||||
{
|
{
|
||||||
UpdateUnitList();
|
UpdateUnitList();
|
||||||
|
|
||||||
|
if (m_noThreadSelected) return;
|
||||||
|
|
||||||
const auto cpu = this->cpu.lock();
|
const auto cpu = this->cpu.lock();
|
||||||
|
|
||||||
if (!cpu)
|
if (!cpu)
|
||||||
@ -228,37 +226,43 @@ void debugger_frame::UpdateUnitList()
|
|||||||
|
|
||||||
void debugger_frame::OnSelectUnit()
|
void debugger_frame::OnSelectUnit()
|
||||||
{
|
{
|
||||||
if (m_choice_units->count() < 1 || m_current_choice == m_choice_units->currentText() || m_choice_units->currentText() == NoThread) return;
|
if (m_choice_units->count() < 1 || m_current_choice == m_choice_units->currentText()) return;
|
||||||
|
|
||||||
m_current_choice = m_choice_units->currentText();
|
m_current_choice = m_choice_units->currentText();
|
||||||
|
m_noThreadSelected = m_current_choice == NoThread;
|
||||||
|
m_list->m_noThreadSelected = m_noThreadSelected;
|
||||||
|
|
||||||
m_disasm.reset();
|
m_disasm.reset();
|
||||||
|
cpu.reset();
|
||||||
|
|
||||||
const auto on_select = [&](u32, cpu_thread& cpu)
|
if (!m_noThreadSelected)
|
||||||
{
|
{
|
||||||
cpu_thread* data = (cpu_thread *)m_choice_units->currentData().value<void *>();
|
const auto on_select = [&](u32, cpu_thread& cpu)
|
||||||
return data == &cpu;
|
{
|
||||||
};
|
cpu_thread* data = (cpu_thread *)m_choice_units->currentData().value<void *>();
|
||||||
|
return data == &cpu;
|
||||||
|
};
|
||||||
|
|
||||||
if (auto ppu = idm::select<ppu_thread>(on_select))
|
if (auto ppu = idm::select<ppu_thread>(on_select))
|
||||||
{
|
{
|
||||||
m_disasm = std::make_unique<PPUDisAsm>(CPUDisAsm_InterpreterMode);
|
m_disasm = std::make_unique<PPUDisAsm>(CPUDisAsm_InterpreterMode);
|
||||||
cpu = ppu.ptr;
|
cpu = ppu.ptr;
|
||||||
}
|
}
|
||||||
else if (auto spu1 = idm::select<SPUThread>(on_select))
|
else if (auto spu1 = idm::select<SPUThread>(on_select))
|
||||||
{
|
{
|
||||||
m_disasm = std::make_unique<SPUDisAsm>(CPUDisAsm_InterpreterMode);
|
m_disasm = std::make_unique<SPUDisAsm>(CPUDisAsm_InterpreterMode);
|
||||||
cpu = spu1.ptr;
|
cpu = spu1.ptr;
|
||||||
}
|
}
|
||||||
else if (auto rspu = idm::select<RawSPUThread>(on_select))
|
else if (auto rspu = idm::select<RawSPUThread>(on_select))
|
||||||
{
|
{
|
||||||
m_disasm = std::make_unique<SPUDisAsm>(CPUDisAsm_InterpreterMode);
|
m_disasm = std::make_unique<SPUDisAsm>(CPUDisAsm_InterpreterMode);
|
||||||
cpu = rspu.ptr;
|
cpu = rspu.ptr;
|
||||||
}
|
}
|
||||||
else if (auto arm = idm::select<ARMv7Thread>(on_select))
|
else if (auto arm = idm::select<ARMv7Thread>(on_select))
|
||||||
{
|
{
|
||||||
m_disasm = std::make_unique<ARMv7DisAsm>(CPUDisAsm_InterpreterMode);
|
m_disasm = std::make_unique<ARMv7DisAsm>(CPUDisAsm_InterpreterMode);
|
||||||
cpu = arm.ptr;
|
cpu = arm.ptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DoUpdate();
|
DoUpdate();
|
||||||
@ -373,7 +377,7 @@ void debugger_frame::Show_Val()
|
|||||||
|
|
||||||
void debugger_frame::Show_PC()
|
void debugger_frame::Show_PC()
|
||||||
{
|
{
|
||||||
if (const auto cpu = this->cpu.lock()) m_list->ShowAddr(CentrePc(GetPc()));
|
m_list->ShowAddr(CentrePc(GetPc()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void debugger_frame::DoStep()
|
void debugger_frame::DoStep()
|
||||||
|
Loading…
Reference in New Issue
Block a user