Debug remotely with CDB | Qt Creator Documentation

- Qt Creator Documentation
- Debug remotely with CDB
- Qt Creator 19.0.1

Debug on Android devices ◦ Debug remotely with GDB

# Debug remotely with CDB

If your remote machine or container runs Windows and your application was compiled using MSVC, you can use CDB for remote debugging.

If remote execution of an application is already set up and works by selecting the Run button (or Ctrl+R), you can start remote debugging by selecting the Debug button (or F5).

In 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:

1. Install the Debugging Tools for Windows on the remote machine. The installation folder has the CDB command-line executable (`cdb.exe`).
2. Copy the Qt Creator CDB extension library and the dependencies from the Qt installation directory to a new folder on the remote machine (32 or 64 bit version depending on the version of the Debugging Tools for Windows used):
   - `\lib\qtcreatorcdbext32` (32 bit)
   - `\lib\qtcreatorcdbext64` (64 bit)
3. Set the _NT_DEBUGGER_EXTENSION_PATH environment variable to point to that folder.
4. To use TCP/IP as communication protocol, launch remote CDB as follows:

        cdb.exe -server tcp:port=1234 <executable>

5. On the local machine running Qt Creator, select Debug > Start Debugging > Attach to Remote CDB Session.
6. In the Connection field enter the connection parameters. For example, for TCP/IP:

        Server:Port

   If you chose some other protocol, specify one of the alternative formats:

        tcp:server=Server,port=Port[,password=Password][,ipversion=6]
        tcp:clicon=Server,port=Port[,password=Password][,ipversion=6]
        npipe:server=Server,pipe=PipeName[,password=Password]
        com:port=COMPort,baud=BaudRate,channel=COMChannel[,password=Password]
        spipe:proto=Protocol,{certuser=Cert|machuser=Cert},server=Server,pipe=PipeName[,password=Password]
        ssl:proto=Protocol,{certuser=Cert|machuser=Cert},server=Server,port=Socket[,password=Password]
        ssl:proto=Protocol,{certuser=Cert|machuser=Cert},clicon=Server,port=Socket[,password=Password]

7. Select OK to start debugging.

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

See also How to: Debug, CDB, Debugging, and Debuggers.

Debug on Android devices ◦ Debug remotely with GDB