GDB
To specify settings for managing the GDB process, go to Preferences > Debugger > GDB.
The following table summarizes the preferences.
Setting | Value |
---|---|
GDB timeout | The 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 stepping | Compresses 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 signal | Shows a message box as soon as your application receives a signal, such as SIGSEGV, during debugging. |
Adjust breakpoint locations | GDB 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 display | Whether the dynamic or the static type of objects will be displayed. Choosing the dynamic type might make debugging slower. |
Load .gdbinit file on startup | Reads the user's default .gdbinit file on debugger startup. |
Load system GDB pretty printers | Uses the default GDB pretty printers installed on the computer or linked to the libraries your application uses. |
Use Intel style disassembly | Switches from the default AT&T style disassembly to the Intel style. |
Use automatic symbol cache | Automatically 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 daemon | Tries 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.
Setting | Value |
---|---|
Use asynchronous mode to control the inferior | Execute 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 information | Adds common paths to locations of debug information, such as /usr/src/debug , when starting GDB. |
Stop when qWarning() is called | Adds a breakpoint on each qWarning() function. |
Stop when qFatal() is called | Adds a breakpoint on each qFatal() function. |
Stop when abort() is called | Adds a breakpoint on each abort() function. |
Enable reverse debugging | Enables 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 processes | Keeps debugging all children after a fork. |
See also How To: Debug, Debugging, Debuggers, and Debugger.
Copyright © The Qt Company Ltd. and other contributors. 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.