Debug Mode Views

In the Debug mode, you can inspect the state of your application while debugging. You can interact with the debugger in many ways, including the following:

  • Go through a program line-by-line or instruction-by-instruction.
  • Interrupt running programs.
  • Set breakpoints.
  • Examine the contents of the call stack.
  • Examine and modify contents of local and global variables.
  • Examine and modify registers and memory contents of the debugged program.
  • Examine the list of loaded shared libraries.
  • Disassemble sections of code.

Qt Creator displays the raw information from the native debuggers in a clear and concise manner with the goal to simplify the debugging process as much as possible without losing the power of the native debuggers.

In addition to the generic IDE functionality of the stack view, views for locals and expressions, registers, and so on, Qt Creator includes features to make debugging Qt-based applications easy. The debugger plugin understands the internal layout of several Qt classes, for example, QString, the Qt containers, and most importantly QObject (and classes derived from it), as well as most containers of the C++ Standard Library and some GCC extensions. It uses this deeper understanding to present objects of such classes in a useful way.

Interact with the program you are debugging in the following views.

ViewPurposeLearn More
StackExamine the the nested function calls leading to the current position as a call stack trace.Viewing Call Stack Trace
BreakpointsSet breakpoints with conditions make the application stop in a controlled way. A watchpoint stops the application when the value of an expression changes.Setting Breakpoints
ThreadsSwitch between threads.Viewing Threads
ModulesView information about modules included in the application.Viewing Modules
Source FilesView a list of source files included in the project.Viewing Source Files
LocalsView information about the parameters of the function in the topmost stack frame and local variables.Local Variables and Function Parameters
ExpressionsCompute values of arithmetic expressions or function calls.Evaluating Expressions
RegistersView the current state of the CPU registers to examine the application at the machine level.Viewing and Editing Register State
Peripheral RegistersView the current state of peripheral registers.
Debugger LogView debug output to find out why the debugger does not work.

The log view acts as a console, so you can send the contents of the line under the text cursor in the log directly to the native debugger.

Troubleshooting Debugger

Directly Interacting with Native Debuggers

DisassemblerView disassembled code for the current function.Viewing Disassembled Code
EditorOpen the current source file in the text editor for changing it.Working in Edit Mode

Managing Debug Views

The availability of views depends on whether you are debugging C++ or QML. Frequently used views are shown by default and rarely used ones are hidden. To change the default settings, select View > Views, and then select views to display or hide. Alternatively, you can enable or disable views from the context menu of the title bar of any visible debug mode view.

{Debug mode views}

You can drag and drop the views in Qt Creator to new positions on the screen. The size and position of views are saved for future sessions. Select View > Views > Reset to Default Layout to reset the views to their original sizes and positions.

To save space on the screen, select View > Views > Automatically Hide View Titlebars.

To show and hide columns in views, toggle Show Column in the context menu.

Customizing Debug Views

You can change the appearance and behavior of the debug views by specifying settings in Preferences > Debugger. For example, you can:

  • Use alternating row colors in debug views.
  • Adopt font size changes from the main editor.
  • Have tooltips displayed in the main editor while you are debugging.
  • Close temporary source and memory views and switch to the previously used Qt Creator mode when the debugger exits.
  • Bring Qt Creator to the foreground when the debugged application is interrupted.

For more information, see Debugger Preferences.

© 2023 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.