From 27750c6486f72b1cffc9d9e80a49bcd6ab03d5bf Mon Sep 17 00:00:00 2001 From: Xusheng Date: Fri, 22 Mar 2024 16:10:13 +0800 Subject: [PATCH] Disable stack variable annotation by default --- core/debugger.cpp | 2 +- core/debuggercontroller.cpp | 3 ++- core/debuggercontroller.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/debugger.cpp b/core/debugger.cpp index e97ca24..edfac23 100644 --- a/core/debugger.cpp +++ b/core/debugger.cpp @@ -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"] })"); diff --git a/core/debuggercontroller.cpp b/core/debuggercontroller.cpp index a56670c..bcef868 100644 --- a/core/debuggercontroller.cpp +++ b/core/debuggercontroller.cpp @@ -31,6 +31,7 @@ DebuggerController::DebuggerController(BinaryViewRef data) m_state = new DebuggerState(data, this); m_adapter = nullptr; + m_shouldAnnotateStackVariable = Settings::Instance()->Get("debugger.stackVariableAnnotations"); RegisterEventCallback([this](const DebuggerEvent& event) { EventHandler(event); }, "Debugger Core"); } @@ -1944,7 +1945,7 @@ void DebuggerController::DefineVariablesRecursive(uint64_t address, ConfidenceGet("debugger.stackVariableAnnotations")) + if (!m_shouldAnnotateStackVariable) return; if (!m_liveView) diff --git a/core/debuggercontroller.h b/core/debuggercontroller.h index 576a127..5ff4abc 100644 --- a/core/debuggercontroller.h +++ b/core/debuggercontroller.h @@ -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();