GDB

To specify settings for managing the GDB process, go to Preferences > Debugger > GDB.

{GDB preferences}

The following table summarizes the preferences.

SettingValue
GDB timeoutThe timeout for terminating non-responsive GDB processes in seconds The default value of 40 seconds should be sufficient for most applications, but if loading big libraries or listing source files takes much longer than that on slow machines, increase the value.
Skip known frames when steppingCompresses several steps into one step for less noisy debugging when stepping into code. For example, the atomic reference counting code is skipped, and a single Step Into for a signal emission ends up directly in the slot connected to it.
Show a message box when receiving a signalShows a message box as soon as your application receives a signal, such as SIGSEGV, during debugging.
Adjust breakpoint locationsGDB allows setting breakpoints on source lines for which no code was generated. In such situations, the breakpoint is shifted to the next source code line for which the code was actually generated. To reflect such temporary changes by moving the breakpoint markers in the source code editor, select this checkbox.
Use dynamic object type for displayWhether the dynamic or the static type of objects will be displayed. Choosing the dynamic type might make debugging slower.
Load .gdbinit file on startupReads the user's default .gdbinit file on debugger startup.
Load system GDB pretty printersUses the default GDB pretty printers installed on the computer or linked to the libraries your application uses.
Use Intel style disassemblySwitches from the default AT&T style disassembly to the Intel style.
Use automatic symbol cacheAutomatically saves a copy of the GDB symbol index in a cache on disk and retrieves it from there when loading the same binary in the future.
Use debug info daemonTries to automatically retrieve debug information for system packages.

Executing Additional Commands

To execute GDB commands after GDB has been started, but before the debugged application is started or attached, and before the debugging helpers are initialized, enter them in the Additional Startup Commands field.

To execute GDB commands after GDB has successfully attached to remote targets, enter them in the Additional Attach Commands field. You can add commands to further set up the target here, such as monitor reset or load.

To execute simple Python commands, prefix them with python. To execute sequences of Python commands spanning multiple lines, prepend the block with python on a separate line, and append end on a separate line. To execute arbitrary Python scripts, use python execfile('/path/to/script.py').

Extended GDB Settings

The settings in the Extended group give access to advanced or experimental functions of GDB. Enabling them may negatively impact your debugging experience, so use them with care.

SettingValue
Use asynchronous mode to control the inferiorExecute commands in the background (asynchronous) mode. GDB immediately opens a command prompt where you can issue other commands while your program runs.
Use common locations for debug informationAdds common paths to locations of debug information, such as /usr/src/debug, when starting GDB.
Stop when qWarning() is calledAdds a breakpoint on each qWarning() function.
Stop when qFatal() is calledAdds a breakpoint on each qFatal() function.
Stop when abort() is calledAdds a breakpoint on each abort() function.
Enable reverse debuggingEnables stepping backwards. This feature is very slow and unstable on the GDB side. It exhibits unpredictable behavior when steapping backwards over system calls and is very likely to destroy your debugging session.
Debug all child processesKeeps debugging all children after a fork.

See also How To: Debug, Debugging, Debuggers, and Debugger.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.