Skip to content

Commit

Permalink
Add struct viewer debugging tool
Browse files Browse the repository at this point in the history
  • Loading branch information
kotcrab committed Nov 11, 2024
1 parent 0e694e6 commit b3fe162
Show file tree
Hide file tree
Showing 10 changed files with 881 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,8 @@ list(APPEND NativeAppSource
UI/ImDebugger/ImDebugger.h
UI/ImDebugger/ImDisasmView.cpp
UI/ImDebugger/ImDisasmView.h
UI/ImDebugger/ImStructViewer.cpp
UI/ImDebugger/ImStructViewer.h
UI/DiscordIntegration.cpp
UI/NativeApp.cpp
UI/BackgroundAudio.h
Expand Down
5 changes: 5 additions & 0 deletions UI/ImDebugger/ImDebugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ void ImDebugger::Frame(MIPSDebugInterface *mipsDebug) {
ImGui::Checkbox("Callstacks", &callstackOpen_);
ImGui::Checkbox("HLE Modules", &modulesOpen_);
ImGui::Checkbox("HLE Threads", &threadsOpen_);
ImGui::Checkbox("Struct viewer", &structViewerOpen_);
ImGui::EndMenu();
}
ImGui::EndMainMenuBar();
Expand Down Expand Up @@ -297,6 +298,10 @@ void ImDebugger::Frame(MIPSDebugInterface *mipsDebug) {
if (modulesOpen_) {
DrawModules(mipsDebug, &modulesOpen_);
}

if (structViewerOpen_) {
structViewer_.Draw(mipsDebug, &structViewerOpen_);
}
}

void ImDisasmWindow::Draw(MIPSDebugInterface *mipsDebug, bool *open, CoreState coreState) {
Expand Down
3 changes: 3 additions & 0 deletions UI/ImDebugger/ImDebugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "Core/Debugger/DebugInterface.h"

#include "UI/ImDebugger/ImDisasmView.h"
#include "UI/ImDebugger/ImStructViewer.h"

// This is the main state container of the whole Dear ImGUI-based in-game cross-platform debugger.
//
Expand Down Expand Up @@ -53,6 +54,7 @@ struct ImDebugger {

ImDisasmWindow disasm_;
ImLuaConsole luaConsole_;
ImStructViewer structViewer_;

// Open variables.
bool disasmOpen_ = true;
Expand All @@ -61,4 +63,5 @@ struct ImDebugger {
bool threadsOpen_ = true;
bool callstackOpen_ = true;
bool modulesOpen_ = true;
bool structViewerOpen_ = false;
};
Loading

0 comments on commit b3fe162

Please sign in to comment.