2020-12-05 13:08:24 +01:00
|
|
|
#pragma once
|
2018-03-02 22:40:29 +01:00
|
|
|
|
2020-12-22 09:42:57 +01:00
|
|
|
#include "util/types.hpp"
|
2018-03-02 22:40:29 +01:00
|
|
|
|
|
|
|
|
#include <QListWidget>
|
|
|
|
|
|
2020-12-22 09:42:57 +01:00
|
|
|
#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
|
|
|
|
2018-03-02 22:40:29 +01:00
|
|
|
class debugger_list : public QListWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2020-02-21 13:20:10 +01:00
|
|
|
u32 m_pc = 0;
|
2022-07-29 17:58:38 +02:00
|
|
|
u32 m_start_addr = 0;
|
2020-02-21 13:20:10 +01:00
|
|
|
u32 m_item_count = 30;
|
2022-05-01 14:48:37 +02:00
|
|
|
u32 m_selected_instruction = -1;
|
2022-07-29 17:58:38 +02:00
|
|
|
bool m_follow_thread = true; // If true, follow the selected thread to wherever it goes in code
|
|
|
|
|
bool m_showing_selected_instruction = false;
|
2022-09-20 09:19:35 +02:00
|
|
|
bool m_dirty_flag = false;
|
2018-03-02 22:40:29 +01:00
|
|
|
QColor m_color_bp;
|
|
|
|
|
QColor m_color_pc;
|
|
|
|
|
QColor m_text_color_bp;
|
|
|
|
|
QColor m_text_color_pc;
|
|
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
2023-09-25 17:32:50 +02:00
|
|
|
void BreakpointRequested(u32 loc, bool only_add = false);
|
2025-04-05 21:50:45 +02:00
|
|
|
|
2018-03-02 22:40:29 +01:00
|
|
|
public:
|
|
|
|
|
debugger_list(QWidget* parent, std::shared_ptr<gui_settings> settings, breakpoint_handler* handler);
|
2024-08-21 18:41:55 +02:00
|
|
|
void UpdateCPUData(std::shared_ptr<CPUDisAsm> disasm);
|
2022-05-01 14:04:56 +02:00
|
|
|
void EnableThreadFollowing(bool enable = true);
|
2018-03-02 22:40:29 +01:00
|
|
|
public Q_SLOTS:
|
2022-07-29 17:58:38 +02:00
|
|
|
void ShowAddress(u32 addr, bool select_addr = true, bool direct = false);
|
2022-05-01 14:04:56 +02:00
|
|
|
void RefreshView();
|
2025-04-05 21:50:45 +02:00
|
|
|
|
2018-03-02 22:40:29 +01:00
|
|
|
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);
|
2022-07-29 17:58:38 +02:00
|
|
|
void create_rsx_command_detail(u32 pc);
|
2025-04-05 21:50:45 +02:00
|
|
|
|
2018-03-02 22:40:29 +01:00
|
|
|
private:
|
|
|
|
|
/**
|
2025-04-05 21:50:45 +02:00
|
|
|
* It really upsetted me I had to copy this code to make debugger_list/frame not circularly dependent.
|
|
|
|
|
*/
|
2022-07-29 17:58:38 +02:00
|
|
|
u32 GetStartAddress(u32 address);
|
2024-08-17 12:24:29 +02:00
|
|
|
bool IsSpu() const;
|
2018-03-02 22:40:29 +01:00
|
|
|
|
2021-03-23 20:39:39 +01:00
|
|
|
std::shared_ptr<gui_settings> m_gui_settings;
|
2018-03-02 22:40:29 +01:00
|
|
|
|
2025-03-01 17:08:10 +01:00
|
|
|
breakpoint_handler* m_ppu_breakpoint_handler = nullptr;
|
2021-01-22 09:11:54 +01:00
|
|
|
cpu_thread* m_cpu = nullptr;
|
2024-08-21 18:41:55 +02:00
|
|
|
std::shared_ptr<CPUDisAsm> m_disasm;
|
2021-01-22 09:11:54 +01:00
|
|
|
QDialog* m_cmd_detail = nullptr;
|
|
|
|
|
QLabel* m_detail_label = nullptr;
|
2018-03-02 22:40:29 +01:00
|
|
|
};
|