Debian Codegraph @

Source/Core/DolphinQt/Debugger/BreakpointWidget.h

raw symbols SCIP
1 // Copyright 2017 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <optional>
7
8 #include <QDockWidget>
9 #include <QString>
10
11 #include "Common/CommonTypes.h"
12
13 class QAction;
14 class QCloseEvent;
15 class QPoint;
16 class QShowEvent;
17 class QTableWidget;
18 class QTableWidgetItem;
19 class QToolBar;
20 class QWidget;
21
22 namespace Core
23 {
24 class System;
25 }
26
27 class CustomDelegate;
28
29 class BreakpointWidget : public QDockWidget
30 {
31 Q_OBJECT
32 public:
33 explicit BreakpointWidget(QWidget* parent = nullptr);
34 ~BreakpointWidget() override;
35
36 void AddBP(u32 addr);
37 void AddBP(u32 addr, bool break_on_hit, bool log_on_hit, const QString& condition);
38 void AddAddressMBP(u32 addr, bool on_read = true, bool on_write = true, bool do_log = true,
39 bool do_break = true, const QString& condition = {});
40 void AddRangedMBP(u32 from, u32 to, bool do_read = true, bool do_write = true, bool do_log = true,
41 bool do_break = true, const QString& condition = {});
42 void UpdateButtonsEnabled();
43 void Update();
44
45 signals:
46 void ShowCode(u32 address);
47 void ShowMemory(u32 address);
48
49 protected:
50 void closeEvent(QCloseEvent*) override;
51 void showEvent(QShowEvent* event) override;
52
53 private:
54 void CreateWidgets();
55
56 void EditBreakpoint(u32 address, int edit, std::optional<QString> = std::nullopt);
57 void EditMBP(u32 address, int edit, std::optional<QString> = std::nullopt);
58
59 void OnClear();
60 void OnClicked(QTableWidgetItem* item);
61 void OnToggleBreaking();
62 void OnNewBreakpoint();
63 void OnEditBreakpoint(u32 address, bool is_instruction_bp);
64 void OnLoad();
65 void OnSave();
66 void OnContextMenu(const QPoint& pos);
67 void OnItemChanged(QTableWidgetItem* item);
68 void OnDebugFontChanged(const QFont& font);
69
70 void UpdateIcons();
71
72 Core::System& m_system;
73
74 QToolBar* m_toolbar;
75 QTableWidget* m_table;
76 QAction* m_enabled;
77 QAction* m_new;
78 QAction* m_clear;
79 QAction* m_load;
80 QAction* m_save;
81 };