diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 9dd8475f00b..630eeb5504d 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -431,6 +431,13 @@ DebuggerSettings::DebuggerSettings() /*GdbOptionsPage::*/ tr("Uses Python to extend the ordinary GDB breakpoint class.")); usePseudoTracepoints.setDefaultValue(true); + useIndexCache.setSettingsKey(debugModeGroup, "UseIndexCache"); + useIndexCache.setLabelText(tr("Use automatic symbol cache")); + useIndexCache.setToolTip(tr("It is possible for GDB to automatically save a copy of " + "its symbol index in a cache on disk and retrieve it from there when loading the same " + "binary in the future.")); + useIndexCache.setDefaultValue(true); + useToolTipsInMainEditor.setSettingsKey(debugModeGroup, "UseToolTips"); useToolTipsInMainEditor.setLabelText(tr("Use tooltips in main editor when debugging")); useToolTipsInMainEditor.setToolTip(tr("

Checking this will enable tooltips for variable " @@ -584,6 +591,7 @@ DebuggerSettings::DebuggerSettings() page2.registerAspect(&intelFlavor); page2.registerAspect(&skipKnownFrames); page2.registerAspect(&usePseudoTracepoints); + page2.registerAspect(&useIndexCache); page2.registerAspect(&gdbStartupCommands); page2.registerAspect(&gdbPostAttachCommands); diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index 0f07cdf226e..46036b0c9da 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -112,6 +112,7 @@ public: Utils::BoolAspect loadGdbDumpers; Utils::BoolAspect intelFlavor; Utils::BoolAspect usePseudoTracepoints; + Utils::BoolAspect useIndexCache; Utils::StringAspect gdbStartupCommands; Utils::StringAspect gdbPostAttachCommands; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index ed55a53e902..d7e2231221b 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3891,6 +3891,9 @@ void GdbEngine::setupEngine() runCommand({"set breakpoint pending on"}); runCommand({"set print elements 10000"}); + if (debuggerSettings()->useIndexCache.value()) + runCommand({"set index-cache on"}); + // Produces a few messages during symtab loading //runCommand("set verbose on"); diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp index c531f5d1336..f49a30e1fce 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.cpp +++ b/src/plugins/debugger/gdb/gdboptionspage.cpp @@ -71,6 +71,7 @@ public: s.loadGdbDumpers, s.intelFlavor, s.usePseudoTracepoints, + s.useIndexCache, Stretch() };