I'm working on a Embedded Linux application and I would like to use GDB to debug it. The problem is that, although the Kit configuration seems fine (the Debugger option is correctly pointed to the GDB correspondent to the device's GCC - device is a Linux ARM), when I ask Qt Creator to run in debug mode it returns an error in the "Application Output":
sh: gdbserver: not found
This seems strange since, as I sad, the configuration is fine and no error about that is reported by Qt Creator in any moment before starting debug mode.
I did some research on the web to find which was the exact steps to use GDB to debug an Embedded Linux application from within Qt Creator (to use breakpoints, etc.) and the closest thing to an answer I got was this commentary by Tobias Hunger:
You will need to have ssh and gdbserver installed on your board for this to work. Then you need to set up your board [qt-project.org] in Creator. Afterwards you need to set up a kit [qt-project.org] using this device.
Those steps, thought, are not clear to me.
ssh
on my device? And of course, is this manual my Tobias complete or do I need to do something else for this to work?
To start remote debugging, run GDB on the host machine, and specify as an executable file the program that is running in the remote machine. This tells GDB how to find your program's symbols and the contents of its pure text. Note that the colon is still required here.
It's where you run GDB on one machine and the program being debugged on another. To do this you need something to allow GDB to control the program being debugged, and that something is called the remote stub. GDB ships with a remote stub called gdbserver, but other remote stubs exist.
You need gdb
and ssh
on your Ubuntu and gdbserver
and sshd
on your device: actually when you deploy a project on a remote device using QtCreator, it makes use of ssh
for copying the files to target, then it launches gdbserver
on the device (attached to the executable that you want to debug) and then launches gdb
on your Ubuntu connecting to the running gdbserver
on the device.
So you need all of them to make things working.
ssh
and gdb
can be installed on your Ubuntu simply via apt-get
. Instead the installation of sshd
and gdbserver
on your board is platform-specific: it can be that some boards already have them in their standard system image, or maybe in some cases it is up to you to install them... if your Linux distribution on the board has some package manager then you might try to use it... in the worst case you will have to compile them on your own for your board and install them manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With