Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Windows/Debugger/Debugger_Lists.h
5654 views
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/Debugger/Watch.h"
8
#include "Core/MIPS/MIPSStackWalk.h"
9
#include "Windows/W32Util/Misc.h"
10
11
class CtrlThreadList: public GenericListControl
12
{
13
public:
14
CtrlThreadList(HWND hwnd);
15
void reloadThreads();
16
void showMenu(int itemIndex, const POINT &pt);
17
const char* getCurrentThreadName();
18
protected:
19
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
20
void GetColumnText(wchar_t *dest, size_t destSize, int row, int col) override;
21
int GetRowCount() override { return (int) threads.size(); }
22
void OnDoubleClick(int itemIndex, int column) override;
23
void OnRightClick(int itemIndex, int column, const POINT &point) override;
24
private:
25
std::vector<DebugThreadInfo> threads;
26
};
27
28
class CtrlDisAsmView;
29
30
class CtrlBreakpointList: public GenericListControl
31
{
32
public:
33
CtrlBreakpointList(HWND hwnd, MIPSDebugInterface* cpu, CtrlDisAsmView* disasm);
34
void reloadBreakpoints();
35
protected:
36
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
37
void GetColumnText(wchar_t *dest, size_t destSize, int row, int col) override;
38
int GetRowCount() override { return getTotalBreakpointCount(); }
39
void OnDoubleClick(int itemIndex, int column) override;
40
void OnRightClick(int itemIndex, int column, const POINT &point) override;
41
void OnToggle(int item, bool newValue) override;
42
private:
43
std::vector<BreakPoint> displayedBreakPoints_;
44
std::vector<MemCheck> displayedMemChecks_;
45
std::wstring breakpointText;
46
MIPSDebugInterface* cpu;
47
CtrlDisAsmView* disasm;
48
49
void editBreakpoint(int itemIndex);
50
void gotoBreakpointAddress(int itemIndex);
51
void removeBreakpoint(int itemIndex);
52
int getTotalBreakpointCount();
53
int getBreakpointIndex(int itemIndex, bool& isMemory);
54
void showBreakpointMenu(int itemIndex, const POINT &pt);
55
void toggleEnabled(int itemIndex);
56
};
57
58
class CtrlStackTraceView: public GenericListControl
59
{
60
public:
61
CtrlStackTraceView(HWND hwnd, DebugInterface* cpu, CtrlDisAsmView* disasm);
62
void loadStackTrace();
63
protected:
64
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
65
void GetColumnText(wchar_t *dest, size_t destSize, int row, int col) override;
66
int GetRowCount() override { return (int)frames.size(); }
67
void OnDoubleClick(int itemIndex, int column) override;
68
private:
69
std::vector<MIPSStackWalk::StackFrame> frames;
70
DebugInterface* cpu;
71
CtrlDisAsmView* disasm;
72
};
73
74
class CtrlModuleList: public GenericListControl
75
{
76
public:
77
CtrlModuleList(HWND hwnd, DebugInterface* cpu);
78
void loadModules();
79
protected:
80
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
81
void GetColumnText(wchar_t *dest, size_t destSize, int row, int col) override;
82
int GetRowCount() override { return (int)modules.size(); }
83
void OnDoubleClick(int itemIndex, int column) override;
84
private:
85
std::vector<LoadedModuleInfo> modules;
86
DebugInterface* cpu;
87
};
88
89
class CtrlWatchList : public GenericListControl {
90
public:
91
CtrlWatchList(HWND hwnd, DebugInterface *cpu);
92
void RefreshValues();
93
94
protected:
95
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
96
void GetColumnText(wchar_t *dest, size_t destSize, int row, int col) override;
97
int GetRowCount() override { return (int)watches_.size(); }
98
void OnRightClick(int itemIndex, int column, const POINT &point) override;
99
bool ListenRowPrePaint() override { return true; }
100
bool OnRowPrePaint(int row, LPNMLVCUSTOMDRAW msg) override;
101
102
private:
103
void AddWatch();
104
void EditWatch(int pos);
105
void DeleteWatch(int pos);
106
bool HasWatchChanged(int pos);
107
108
std::vector<WatchInfo> watches_;
109
DebugInterface *cpu_;
110
};
111
112