mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-13 02:08:49 +12:00
ShowAtPC static method
This commit is contained in:
parent
1565462842
commit
791091ca1f
3 changed files with 27 additions and 21 deletions
|
@ -55,9 +55,6 @@ extern bool is_using_interpreter(thread_class t_class);
|
||||||
|
|
||||||
extern std::shared_ptr<CPUDisAsm> make_disasm(const cpu_thread* cpu, shared_ptr<cpu_thread> handle);
|
extern std::shared_ptr<CPUDisAsm> make_disasm(const cpu_thread* cpu, shared_ptr<cpu_thread> handle);
|
||||||
|
|
||||||
class CPUDisAsm;
|
|
||||||
std::shared_ptr<CPUDisAsm> make_basic_ppu_disasm();
|
|
||||||
|
|
||||||
debugger_frame::debugger_frame(std::shared_ptr<gui_settings> gui_settings, QWidget *parent)
|
debugger_frame::debugger_frame(std::shared_ptr<gui_settings> gui_settings, QWidget *parent)
|
||||||
: custom_dock_widget(tr("Debugger [Press F1 for Help]"), parent)
|
: custom_dock_widget(tr("Debugger [Press F1 for Help]"), parent)
|
||||||
, m_gui_settings(std::move(gui_settings))
|
, m_gui_settings(std::move(gui_settings))
|
||||||
|
@ -1749,20 +1746,5 @@ void debugger_frame::RegsShowMemoryViewerAction()
|
||||||
const quint64 value = norm.toULongLong(&ok, 16);
|
const quint64 value = norm.toULongLong(&ok, 16);
|
||||||
const u32 pc = static_cast<u32>(value);
|
const u32 pc = static_cast<u32>(value);
|
||||||
|
|
||||||
const u32 id = idm::last_id();
|
memory_viewer_panel::ShowAtPC(pc);
|
||||||
auto handle_ptr = idm::get_unlocked<memory_viewer_handle>(id);
|
|
||||||
|
|
||||||
if (!handle_ptr)
|
|
||||||
{
|
|
||||||
idm::make<memory_viewer_handle>(this, make_basic_ppu_disasm(), pc);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
handle_ptr->m_mvp->SetPC(pc);
|
|
||||||
handle_ptr->m_mvp->raise();
|
|
||||||
handle_ptr->m_mvp->scroll(0);
|
|
||||||
if (!handle_ptr->m_mvp->isVisible())
|
|
||||||
{
|
|
||||||
handle_ptr->m_mvp->show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,9 @@
|
||||||
|
|
||||||
LOG_CHANNEL(gui_log, "GUI");
|
LOG_CHANNEL(gui_log, "GUI");
|
||||||
|
|
||||||
|
class CPUDisAsm;
|
||||||
|
std::shared_ptr<CPUDisAsm> make_basic_ppu_disasm();
|
||||||
|
|
||||||
constexpr auto qstr = QString::fromStdString;
|
constexpr auto qstr = QString::fromStdString;
|
||||||
|
|
||||||
memory_viewer_panel::memory_viewer_panel(QWidget* parent, std::shared_ptr<CPUDisAsm> disasm, u32 addr, std::function<cpu_thread*()> func)
|
memory_viewer_panel::memory_viewer_panel(QWidget* parent, std::shared_ptr<CPUDisAsm> disasm, u32 addr, std::function<cpu_thread*()> func)
|
||||||
|
@ -1244,3 +1247,23 @@ void memory_viewer_panel::ShowImage(QWidget* parent, u32 addr, color_format form
|
||||||
f_image_viewer->setFixedSize(f_image_viewer->sizeHint());
|
f_image_viewer->setFixedSize(f_image_viewer->sizeHint());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void memory_viewer_panel::ShowAtPC(u32 pc)
|
||||||
|
{
|
||||||
|
const u32 id = idm::last_id();
|
||||||
|
auto handle_ptr = idm::get_unlocked<memory_viewer_handle>(id);
|
||||||
|
|
||||||
|
if (!handle_ptr)
|
||||||
|
{
|
||||||
|
idm::make<memory_viewer_handle>(nullptr, make_basic_ppu_disasm(), pc);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_ptr->m_mvp->SetPC(pc);
|
||||||
|
handle_ptr->m_mvp->raise();
|
||||||
|
handle_ptr->m_mvp->scroll(0);
|
||||||
|
if (!handle_ptr->m_mvp->isVisible())
|
||||||
|
{
|
||||||
|
handle_ptr->m_mvp->show();
|
||||||
|
}
|
||||||
|
}
|
|
@ -55,8 +55,7 @@ public:
|
||||||
memory_viewer_panel(QWidget* parent, std::shared_ptr<CPUDisAsm> disasm, u32 addr = 0, std::function<cpu_thread*()> func = []() -> cpu_thread* { return {}; });
|
memory_viewer_panel(QWidget* parent, std::shared_ptr<CPUDisAsm> disasm, u32 addr = 0, std::function<cpu_thread*()> func = []() -> cpu_thread* { return {}; });
|
||||||
~memory_viewer_panel();
|
~memory_viewer_panel();
|
||||||
|
|
||||||
void scroll(s32 steps);
|
static void ShowAtPC(u32 pc);
|
||||||
void SetPC(const uint pc);
|
|
||||||
|
|
||||||
enum class color_format : int
|
enum class color_format : int
|
||||||
{
|
{
|
||||||
|
@ -109,7 +108,9 @@ private:
|
||||||
search_mode m_modes{};
|
search_mode m_modes{};
|
||||||
|
|
||||||
std::string getHeaderAtAddr(u32 addr) const;
|
std::string getHeaderAtAddr(u32 addr) const;
|
||||||
|
void scroll(s32 steps);
|
||||||
void* to_ptr(u32 addr, u32 size = 1) const;
|
void* to_ptr(u32 addr, u32 size = 1) const;
|
||||||
|
void SetPC(const uint pc);
|
||||||
|
|
||||||
void ShowMemory();
|
void ShowMemory();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue