Skip to content

Commit

Permalink
Disable stack variable annotation by default
Browse files Browse the repository at this point in the history
  • Loading branch information
xusheng6 committed Mar 22, 2024
1 parent a125a23 commit 27750c6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static void RegisterSettings()
R"({
"title" : "Stack Variable Annotations",
"type" : "boolean",
"default" : true,
"default" : false,
"description" : "Add stack variable annotations",
"ignore" : ["SettingsProjectScope", "SettingsResourceScope"]
})");
Expand Down
3 changes: 2 additions & 1 deletion core/debuggercontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ DebuggerController::DebuggerController(BinaryViewRef data)

m_state = new DebuggerState(data, this);
m_adapter = nullptr;
m_shouldAnnotateStackVariable = Settings::Instance()->Get<bool>("debugger.stackVariableAnnotations");
RegisterEventCallback([this](const DebuggerEvent& event) { EventHandler(event); }, "Debugger Core");
}

Expand Down Expand Up @@ -1944,7 +1945,7 @@ void DebuggerController::DefineVariablesRecursive(uint64_t address, Confidence<R

void DebuggerController::UpdateStackVariables()
{
if (!Settings::Instance()->Get<bool>("debugger.stackVariableAnnotations"))
if (!m_shouldAnnotateStackVariable)
return;

if (!m_liveView)
Expand Down
1 change: 1 addition & 0 deletions core/debuggercontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ namespace BinaryNinjaDebugger {
bool m_initialBreakpointSeen = false;

bool m_firstLaunch = true;
bool m_shouldAnnotateStackVariable = false;

void EventHandler(const DebuggerEvent& event);
void UpdateStackVariables();
Expand Down

0 comments on commit 27750c6

Please sign in to comment.