rpcsx/rpcs3/rpcs3qt/debugger_list.h

61 lines
1.6 KiB
C
Raw Normal View History

2020-12-05 13:08:24 +01:00
#pragma once
#include "util/types.hpp"
#include <QListWidget>
#include <memory>
2020-02-22 20:42:49 +01:00
class breakpoint_handler;
class CPUDisAsm;
class cpu_thread;
class gui_settings;
2021-01-22 09:11:54 +01:00
class QLabel;
2020-02-22 20:42:49 +01:00
class debugger_list : public QListWidget
{
Q_OBJECT
public:
u32 m_pc = 0;
u32 m_item_count = 30;
bool m_follow_thread = true; // If true, follow the selected thread to wherever it goes in code
2022-05-01 14:48:37 +02:00
u32 m_selected_instruction = -1;
QColor m_color_bp;
QColor m_color_pc;
QColor m_text_color_bp;
QColor m_text_color_pc;
Q_SIGNALS:
void BreakpointRequested(u32 loc);
public:
debugger_list(QWidget* parent, std::shared_ptr<gui_settings> settings, breakpoint_handler* handler);
2021-01-22 09:11:54 +01:00
void UpdateCPUData(cpu_thread* cpu, CPUDisAsm* disasm);
void EnableThreadFollowing(bool enable = true);
public Q_SLOTS:
void ShowAddress(u32 addr, bool select_addr = true, bool force = false);
void RefreshView();
protected:
void keyPressEvent(QKeyEvent* event) override;
void mouseDoubleClickEvent(QMouseEvent* event) override;
void wheelEvent(QWheelEvent* event) override;
void resizeEvent(QResizeEvent* event) override;
2021-01-22 09:11:54 +01:00
void showEvent(QShowEvent* event) override;
void hideEvent(QHideEvent* event) override;
void scroll(s32 steps);
void create_rsx_command_detail(u32 pc, int row);
private:
/**
* It really upsetted me I had to copy this code to make debugger_list/frame not circularly dependent.
*/
u32 GetCenteredAddress(u32 address) const;
2021-03-23 20:39:39 +01:00
std::shared_ptr<gui_settings> m_gui_settings;
breakpoint_handler* m_breakpoint_handler;
2021-01-22 09:11:54 +01:00
cpu_thread* m_cpu = nullptr;
2021-04-07 23:05:18 +02:00
CPUDisAsm* m_disasm = nullptr;
2021-01-22 09:11:54 +01:00
QDialog* m_cmd_detail = nullptr;
QLabel* m_detail_label = nullptr;
};