From 2b97f69796f05d4d9d4b6745c4fbdc5d928aa001 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 20 Dec 2022 11:17:36 +0100 Subject: [PATCH] Debugger: Merge GDB and GDB Extended option pages Change-Id: I0d4c041cec9ea01e1310f08a4ee87ed8080976bd Reviewed-by: Eike Ziller --- .../debugger/creator-debugger-common.qdocinc | 2 +- .../creator-debugger-settings.qdocinc | 9 +-- .../creator-only/creator-debugger.qdoc | 5 +- src/plugins/debugger/debuggeractions.cpp | 17 ++--- src/plugins/debugger/debuggeractions.h | 1 - src/plugins/debugger/gdb/gdboptionspage.cpp | 64 ++++++------------- 6 files changed, 30 insertions(+), 68 deletions(-) diff --git a/doc/qtcreator/src/debugger/creator-debugger-common.qdocinc b/doc/qtcreator/src/debugger/creator-debugger-common.qdocinc index 1226853275c..ed4d4bf64a4 100644 --- a/doc/qtcreator/src/debugger/creator-debugger-common.qdocinc +++ b/doc/qtcreator/src/debugger/creator-debugger-common.qdocinc @@ -155,7 +155,7 @@ You can automatically add breakpoints on some functions to catch error and warning messages. For more information, see \l{Specifying CDB Settings} - and \l{Specifying Extended GDB Settings}. + and \l{Specifying GDB Settings}. For more information on breakpoints, see \l{http://sourceware.org/gdb/onlinedocs/gdb/Breakpoints.html#Breakpoints} diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger-settings.qdocinc b/doc/qtcreator/src/debugger/creator-only/creator-debugger-settings.qdocinc index 057f43aa41b..f6e5fedcf6e 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger-settings.qdocinc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger-settings.qdocinc @@ -110,16 +110,11 @@ To execute arbitrary Python scripts, use \c {python execfile('/path/to/script.py')}. - \section2 Specifying Extended GDB Settings - - To specify extended settings for GBD, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Debugger > \uicontrol {GDB Extended}. - The settings give access to advanced or experimental functions of GDB. + The settings in the \uicontrol Extended group give access to advanced + or experimental functions of GDB. Enabling them may negatively impact your debugging experience, so use them with care. - \image qtcreator-gdb-extended-options.png "GDB Extended preferences" - To use asynchronous mode to control the inferior, select the respective check box. diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index 35d598d4c6e..44d9c9af443 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -414,8 +414,7 @@ To increase the timeout in the \uicontrol {GDB timeout} field, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger > \uicontrol GDB. For more information about settings that you can specify - to manage the GDB process, see \l{Specifying GDB Settings} and - \l{Specifying Extended GDB Settings}. + to manage the GDB process, see \l{Specifying GDB Settings}. For more information about connecting with \c {target extended-remote} mode in GDB, see \l{https://sourceware.org/gdb/onlinedocs/gdb/Connecting.html} @@ -630,7 +629,7 @@ The extended GDB settings provide the option to step backwards in code, but this option should be used with care, as it is slow and unstable on the - GDB side. For more information, see \l{Specifying Extended GDB Settings}. + GDB side. For more information, see \l{Specifying GDB Settings}. \section2 Customizing Debug Views diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index d33d667f651..53751908670 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -571,15 +571,13 @@ DebuggerSettings::DebuggerSettings() page2.registerAspect(&useIndexCache); page2.registerAspect(&gdbStartupCommands); page2.registerAspect(&gdbPostAttachCommands); - - // Page 3 - page3.registerAspect(&targetAsync); - page3.registerAspect(&autoEnrichParameters); - page3.registerAspect(&breakOnWarning); - page3.registerAspect(&breakOnFatal); - page3.registerAspect(&breakOnAbort); - page3.registerAspect(&enableReverseDebugging); - page3.registerAspect(&multiInferior); + page2.registerAspect(&targetAsync); + page2.registerAspect(&autoEnrichParameters); + page2.registerAspect(&breakOnWarning); + page2.registerAspect(&breakOnFatal); + page2.registerAspect(&breakOnAbort); + page2.registerAspect(&enableReverseDebugging); + page2.registerAspect(&multiInferior); // Page 4 page4.registerAspect(&useDebuggingHelpers); @@ -624,7 +622,6 @@ DebuggerSettings::DebuggerSettings() // Collect all all.registerAspects(page1); all.registerAspects(page2); - all.registerAspects(page3); all.registerAspects(page4); all.registerAspects(page5); all.registerAspects(page6); diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index a2fa4b761b3..988ebdf5d62 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -163,7 +163,6 @@ public: Utils::AspectContainer all; // All Utils::AspectContainer page1; // General Utils::AspectContainer page2; // GDB - Utils::AspectContainer page3; // GDB Extended Utils::AspectContainer page4; // Locals & Expressions Utils::AspectContainer page5; // CDB Utils::AspectContainer page6; // CDB Paths diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp index d41f1b37552..dd99eb67585 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.cpp +++ b/src/plugins/debugger/gdb/gdboptionspage.cpp @@ -36,6 +36,12 @@ public: using namespace Layouting; DebuggerSettings &s = *debuggerSettings(); + auto labelDangerous = new QLabel("" + + Tr::tr("The options below give access to advanced
" + "or experimental functions of GDB.

" + "Enabling them may negatively impact
" + "your debugging experience.") + "
"); + Group general { title(Tr::tr("General")), Column { @@ -49,53 +55,9 @@ public: s.intelFlavor, s.usePseudoTracepoints, s.useIndexCache, - st } }; - Column commands { - Group { - title(Tr::tr("Additional Startup Commands")), - Column { s.gdbStartupCommands } - }, - Group { - title(Tr::tr("Additional Attach Commands")), - Column { s.gdbPostAttachCommands }, - }, - st - }; - - Row { general, commands }.attachTo(w); - }); - } -}; - -///////////////////////////////////////////////////////////////////////// -// -// GdbOptionsPage2 - dangerous options -// -///////////////////////////////////////////////////////////////////////// - -// The "Dangerous" options. -class GdbOptionsPage2 : public Core::IOptionsPage -{ -public: - GdbOptionsPage2() - { - setId("M.Gdb2"); - setDisplayName(Tr::tr("GDB Extended")); - setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY); - setSettings(&debuggerSettings()->page3); - - setLayouter([](QWidget *w) { - auto labelDangerous = new QLabel("" + - Tr::tr("The options below give access to advanced " - "or experimental functions of GDB.
Enabling them may negatively " - "impact your debugging experience.") + "
"); - - using namespace Layouting; - DebuggerSettings &s = *debuggerSettings(); - Group extended { title(Tr::tr("Extended")), Column { @@ -107,10 +69,21 @@ public: s.breakOnAbort, s.enableReverseDebugging, s.multiInferior, + st } }; - Column { extended, st }.attachTo(w); + Group startup { + title(Tr::tr("Additional Startup Commands")), + Column { s.gdbStartupCommands } + }; + + Group attach { + title(Tr::tr("Additional Attach Commands")), + Column { s.gdbPostAttachCommands }, + }; + + Grid { general, extended, br, startup, attach }.attachTo(w); }); } }; @@ -120,7 +93,6 @@ public: void addGdbOptionPages(QList *opts) { opts->push_back(new GdbOptionsPage); - opts->push_back(new GdbOptionsPage2); } } // Debugger::Internal