This paper contains the general description of debugging Qt application using Qt Creator remote debugging option over TCP.
Qt Creator provides very easy access to remote debugging. In general, the remote debugging setup consist of a probe running on the remote machine and a counterpart running on the host side. The probe is either integrated into the running process or runs a separate process. The host side typically consists of Qt Creator itself, often with the help of an external process, such as GDB or CDB. While this setup might look daunting, it is mostly invisible to the user of Qt Creator.
When debugging on a target supported by GDB server, a local GDB process talks to a GDB server running on the remote machine that controls the process to be debugged.
In this paper we mostly deal with terms Qt creator, debugging, remote debugging.
Steps followed for remote debugging C:/hello_world.exe running on Target PC using Qt Creator:
On TARGET PC
- Open command prompt.
- Change directory to C:\mingw48_32\bin.(Can be copied from Qt Creator installed path)
- Run gdbserver.exe 192.168.6.191:1234 C:/hello_world.exe
- Copy the qml folder inside mingw_48_32\bin. (gdbserver has to know the qml files from its location). [In case we use qml file]
Process C:/hello_world.exe created; pid = 3932
Listening on port 1234
Remote debugging from host 192.168.6.191 (Appears after remote debugging request from host)
ON HOST PC
- Qt Creator Installed.
- Archive mingw_48_32 folder from C:\Qt\Qt5.2.1\Tools.
- Copy mingw_48_32 archive to C:\ on Target PC.
- Extract the rar file in C:\ in Target PC.
- From Qt Creator , Open Debug->Start Debugging->Attach to remote debug server…
- In the Start Debugger dialog, enter any port number in Server Port provision, Target IP Address in Override server address, name & path of the hello_world.exe to be debugged from the debug folder in Local executable.
- Once you click OK, remote debugging request will be sent to the target pc.
- The application debugs will appear on the application output tab/Debug log on host pc qt creator.
Discussion and Conclusion
So we saw how to debug an application running on Target PC from host PC using remote debugging technique available in Qt Creator.
For any technical support or queries feel free to write to us at email@example.com