CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/Windows/Debugger/Debugger_Lists.h
Views: 1401
1
#pragma once
2
3
#include "../../Core/Debugger/DebugInterface.h"
4
#include "../../Core/HLE/sceKernelThread.h"
5
#include "../../Core/Debugger/Breakpoints.h"
6
#include "../../Core/Debugger/SymbolMap.h"
7
#include "../../Core/MIPS/MIPSStackWalk.h"
8
#include "Windows/W32Util/Misc.h"
9
10
enum class WatchFormat {
11
HEX,
12
INT,
13
FLOAT,
14
STR,
15
};
16
17
class CtrlThreadList: public GenericListControl
18
{
19
public:
20
CtrlThreadList(HWND hwnd);
21
void reloadThreads();
22
void showMenu(int itemIndex, const POINT &pt);
23
const char* getCurrentThreadName();
24
protected:
25
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
26
void GetColumnText(wchar_t *dest, int row, int col) override;
27
int GetRowCount() override { return (int) threads.size(); }
28
void OnDoubleClick(int itemIndex, int column) override;
29
void OnRightClick(int itemIndex, int column, const POINT &point) override;
30
private:
31
std::vector<DebugThreadInfo> threads;
32
};
33
34
class CtrlDisAsmView;
35
36
class CtrlBreakpointList: public GenericListControl
37
{
38
public:
39
CtrlBreakpointList(HWND hwnd, DebugInterface* cpu, CtrlDisAsmView* disasm);
40
void reloadBreakpoints();
41
protected:
42
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
43
void GetColumnText(wchar_t *dest, int row, int col) override;
44
int GetRowCount() override { return getTotalBreakpointCount(); }
45
void OnDoubleClick(int itemIndex, int column) override;
46
void OnRightClick(int itemIndex, int column, const POINT &point) override;
47
void OnToggle(int item, bool newValue) override;
48
private:
49
std::vector<BreakPoint> displayedBreakPoints_;
50
std::vector<MemCheck> displayedMemChecks_;
51
std::wstring breakpointText;
52
DebugInterface* cpu;
53
CtrlDisAsmView* disasm;
54
55
void editBreakpoint(int itemIndex);
56
void gotoBreakpointAddress(int itemIndex);
57
void removeBreakpoint(int itemIndex);
58
int getTotalBreakpointCount();
59
int getBreakpointIndex(int itemIndex, bool& isMemory);
60
void showBreakpointMenu(int itemIndex, const POINT &pt);
61
void toggleEnabled(int itemIndex);
62
};
63
64
class CtrlStackTraceView: public GenericListControl
65
{
66
public:
67
CtrlStackTraceView(HWND hwnd, DebugInterface* cpu, CtrlDisAsmView* disasm);
68
void loadStackTrace();
69
protected:
70
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
71
void GetColumnText(wchar_t *dest, int row, int col) override;
72
int GetRowCount() override { return (int)frames.size(); }
73
void OnDoubleClick(int itemIndex, int column) override;
74
private:
75
std::vector<MIPSStackWalk::StackFrame> frames;
76
DebugInterface* cpu;
77
CtrlDisAsmView* disasm;
78
};
79
80
class CtrlModuleList: public GenericListControl
81
{
82
public:
83
CtrlModuleList(HWND hwnd, DebugInterface* cpu);
84
void loadModules();
85
protected:
86
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
87
void GetColumnText(wchar_t *dest, int row, int col) override;
88
int GetRowCount() override { return (int)modules.size(); }
89
void OnDoubleClick(int itemIndex, int column) override;
90
private:
91
std::vector<LoadedModuleInfo> modules;
92
DebugInterface* cpu;
93
};
94
95
class CtrlWatchList : public GenericListControl {
96
public:
97
CtrlWatchList(HWND hwnd, DebugInterface *cpu);
98
void RefreshValues();
99
100
protected:
101
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
102
void GetColumnText(wchar_t *dest, int row, int col) override;
103
int GetRowCount() override { return (int)watches_.size(); }
104
void OnRightClick(int itemIndex, int column, const POINT &point) override;
105
bool ListenRowPrePaint() override { return true; }
106
bool OnRowPrePaint(int row, LPNMLVCUSTOMDRAW msg) override;
107
108
private:
109
void AddWatch();
110
void EditWatch(int pos);
111
void DeleteWatch(int pos);
112
bool HasWatchChanged(int pos);
113
114
struct WatchInfo {
115
std::string name;
116
std::string originalExpression;
117
PostfixExpression expression;
118
WatchFormat format = WatchFormat::HEX;
119
uint32_t currentValue = 0;
120
uint32_t lastValue = 0;
121
int steppingCounter = -1;
122
bool evaluateFailed = false;
123
};
124
std::vector<WatchInfo> watches_;
125
DebugInterface *cpu_;
126
};
127
128