CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/Windows/Debugger/Debugger_Lists.h
Views: 1401
#pragma once12#include "../../Core/Debugger/DebugInterface.h"3#include "../../Core/HLE/sceKernelThread.h"4#include "../../Core/Debugger/Breakpoints.h"5#include "../../Core/Debugger/SymbolMap.h"6#include "../../Core/MIPS/MIPSStackWalk.h"7#include "Windows/W32Util/Misc.h"89enum class WatchFormat {10HEX,11INT,12FLOAT,13STR,14};1516class CtrlThreadList: public GenericListControl17{18public:19CtrlThreadList(HWND hwnd);20void reloadThreads();21void showMenu(int itemIndex, const POINT &pt);22const char* getCurrentThreadName();23protected:24bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;25void GetColumnText(wchar_t *dest, int row, int col) override;26int GetRowCount() override { return (int) threads.size(); }27void OnDoubleClick(int itemIndex, int column) override;28void OnRightClick(int itemIndex, int column, const POINT &point) override;29private:30std::vector<DebugThreadInfo> threads;31};3233class CtrlDisAsmView;3435class CtrlBreakpointList: public GenericListControl36{37public:38CtrlBreakpointList(HWND hwnd, DebugInterface* cpu, CtrlDisAsmView* disasm);39void reloadBreakpoints();40protected:41bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;42void GetColumnText(wchar_t *dest, int row, int col) override;43int GetRowCount() override { return getTotalBreakpointCount(); }44void OnDoubleClick(int itemIndex, int column) override;45void OnRightClick(int itemIndex, int column, const POINT &point) override;46void OnToggle(int item, bool newValue) override;47private:48std::vector<BreakPoint> displayedBreakPoints_;49std::vector<MemCheck> displayedMemChecks_;50std::wstring breakpointText;51DebugInterface* cpu;52CtrlDisAsmView* disasm;5354void editBreakpoint(int itemIndex);55void gotoBreakpointAddress(int itemIndex);56void removeBreakpoint(int itemIndex);57int getTotalBreakpointCount();58int getBreakpointIndex(int itemIndex, bool& isMemory);59void showBreakpointMenu(int itemIndex, const POINT &pt);60void toggleEnabled(int itemIndex);61};6263class CtrlStackTraceView: public GenericListControl64{65public:66CtrlStackTraceView(HWND hwnd, DebugInterface* cpu, CtrlDisAsmView* disasm);67void loadStackTrace();68protected:69bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;70void GetColumnText(wchar_t *dest, int row, int col) override;71int GetRowCount() override { return (int)frames.size(); }72void OnDoubleClick(int itemIndex, int column) override;73private:74std::vector<MIPSStackWalk::StackFrame> frames;75DebugInterface* cpu;76CtrlDisAsmView* disasm;77};7879class CtrlModuleList: public GenericListControl80{81public:82CtrlModuleList(HWND hwnd, DebugInterface* cpu);83void loadModules();84protected:85bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;86void GetColumnText(wchar_t *dest, int row, int col) override;87int GetRowCount() override { return (int)modules.size(); }88void OnDoubleClick(int itemIndex, int column) override;89private:90std::vector<LoadedModuleInfo> modules;91DebugInterface* cpu;92};9394class CtrlWatchList : public GenericListControl {95public:96CtrlWatchList(HWND hwnd, DebugInterface *cpu);97void RefreshValues();9899protected:100bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;101void GetColumnText(wchar_t *dest, int row, int col) override;102int GetRowCount() override { return (int)watches_.size(); }103void OnRightClick(int itemIndex, int column, const POINT &point) override;104bool ListenRowPrePaint() override { return true; }105bool OnRowPrePaint(int row, LPNMLVCUSTOMDRAW msg) override;106107private:108void AddWatch();109void EditWatch(int pos);110void DeleteWatch(int pos);111bool HasWatchChanged(int pos);112113struct WatchInfo {114std::string name;115std::string originalExpression;116PostfixExpression expression;117WatchFormat format = WatchFormat::HEX;118uint32_t currentValue = 0;119uint32_t lastValue = 0;120int steppingCounter = -1;121bool evaluateFailed = false;122};123std::vector<WatchInfo> watches_;124DebugInterface *cpu_;125};126127128