Launching the DebuggerTo start a program under the control of the debugger, select Debug > Start Debugging > Start Debugging, or press F5. Qt Creator checks whether the compiled program is up-to-date, and rebuilds it if necessary. The debugger then takes over and starts the program. Note: Starting a program in the debugger can take a long time, typically in the range of several seconds to minutes if complex features (like QtWebKit) are used. The debugger is launched in the appropriate operating mode (plain, terminal, or on-device), based on the build and run settings for the active project. Select Debug menu options to launch the debugger in other modes. Note: Debugging QML and JavaScript is supported only in plain mode. Launching the Debugger in Different ModesThe debugger plugin runs in different operating modes depending on where and how the process is started and run. Some of the modes are only available for a particular operating system or platform. You can launch the debugger in the following modes:
Note: Debugging QML and JavaScript is supported only in plain mode. Launching in Plain ModeTo launch the debugger in the plain mode, click the Start Debugging button for the active project, or choose Debug > Start Debugging > Start and Debug External Application... and specify an executable. Launching in Terminal ModeTo launch the debugger in the terminal mode, select Projects > Run Settings and select the Run in terminal check box. Then click the Start Debugging button for the active project. Launching in Attach ModeTo launch the debugger in the attach mode, select Debug > Start Debugging > Attach to Running External Application..., and then select a process by its name or process ID to attach to. You can load the source project in advance and set breakpoints in it before attaching to an already running process. For more information, see Setting Breakpoints. Launching in Remote ModeThe remote mode allows you to debug processes that run on remote machines. Using GDBIn remote mode, the local GDB process talks to a GDB server process running on the remote machine that controls the process to be debugged. The GDB server process is started on the remote machines by passing a port number and the executable: gdbserver :1234 <executable> It then typically responds: Process bin/qtcreator created; pid = 5159 Listening on port 1234 On the local machine that runs Qt Creator:
Using CDBIn remote mode, the local CDB process talks to a CDB process that runs on the remote machine. The process is started with special command line options that switch it into server mode. The remote CDB process must load the Qt Creator CDB extension library that is shipped with Qt Creator:
Launching in Core ModeThe core mode it used to debug core files (crash dumps) that are generated from crashed processes if the system is set up to allow this. To enable the dumping of core files on a Unix system enter the following command in the shell from which the application will be launched: ulimit -c unlimited
To launch the debugger in the core mode, select Debug > Start Debugging > Attach to Core.... Launching in Post-Mortem ModeThe post-mortem mode is available only on Windows, if you have installed the debugging tools for Windows. The Qt Creator installation program asks you whether you want to register Qt Creator as a post-mortem debugger. To change the setting, select Tools > Options... > Debugger > Common > Use Creator for post-mortem debugging. You can launch the debugger in the post-mortem mode if an application crashes on Windows. Click the Debug in Qt Creator button in the error message that is displayed by the Windows operating system. Launching in On-device ModeThe on-device mode is a special mode available for run configurations targeting mobile devices. It debugs processes running on mobile devices using on-device debugging agents, such as CODA on Symbian and gdbserver on Linux-based devices. To launch the debugger in the on-device mode, open the project, select a run configuration that targets a mobile device, and click the Start Debugging button. X
|