Examining Data

Use the Locals and Expressions views to examine the data in more detail.

You can use the following keyboard shortcuts:

  • To finish debugging, press Shift+F5.
  • To execute a line of code as a whole, press F10 (Command+Shift+O on macOS).
  • To step into a function or a subfunction, press F11 (Command+Shift+I on macOS).
  • To leave the current function or subfunction, press Shift+F11 (Command+Shift+T on macOS).
  • To continue running the application, press F5.
  • To run to the line that has the cursor, press Ctrl+F10 (Shift+F8 on macOS).
  • To run to the selected function when you are stepping into a nested function, press Ctrl+F6.

You can continue executing the application until the current function completes or jump to an arbitrary position in the current function.

Stepping Into Code

Use the following buttons to step through the code:

ButtonFunctionDescription
Stop DebuggerStops the debugger.
Step OverSteps over the next line inside the function being debugged. It executes the call and moves to the next line to be executed in the function.
Step IntoSteps into the line that it is currently on. For a function call, goes into the function and is ready to continue.
Step OutFinishes executing the function and exits to the function that it was called from.
ContinueResumes application execution at the address where it last stopped.

When using GDB as the debugging backend, you can compress several steps into one step for less noisy debugging. For more information, see Specifying GDB Settings.

The extended GDB settings have 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 Specifying GDB Settings.

Debugging C++ Based Applications

The following sections describe additional debugging functions that apply only to debugging C++.

Starting the Debugger from the Command Line

You can use the Qt Creator debugger interface from the command line. To attach it to a running process, specify the process ID as a parameter for the -debug option. To examine a core file, specify the file name. Qt Creator executes all the necessary steps, such as searching for the binary that belongs to a core file. To connect to a debug server, specify the server location and port number.

For example:

  • C:\qtcreator\bin>qtcreator -debug 2000
  • C:\qtcreator\bin>qtcreator -debug core=core.2000
  • C:\qtcreator\bin>qtcreator -debug some.exe,core=core
  • C:\qtcreator\bin>qtcreator -debug server=some.dot.com:4251

For more information, see Using Command Line Options.

Stepping into Frameworks in macOS

In macOS, external libraries are usually built into so-called Frameworks, which may have both release and debug versions of the library. When you run applications on the macOS desktop, the release version of Frameworks is used by default. To step into Frameworks, select the Use debug versions of Frameworks option in the project run settings.