1
votes

I've been setting up remote debugging for an embedded Linux target. I've tested that I have the correct combination of gdbserver running on the target and gdb client running on my workstation. I can start the server and on the workstation side run:

(gdb) target remote 10.28.22.226:2345

and I can list source and step just fine.

In Qt Creator I have configured a device. In that window I specify the GDB server executable: gdbserver (see pic).

Devices setup

I also configure the cross debugger in the 'Build & Run' Debuggers tab as shown below:

Build & Run Debuggers setup

In this case, I have manually started the gdbserver with my executable on the target with port 2345. To start debugging with Qt Creator, I choose the Debug->Start Debugging->Attach to running Debug server pulldown menu. It gives me the prompt shown below, where I enter the server port (2345). I give it the appropriate kit and local executable (copy of the executable on the remote target).

Start Debugger dialog

After I hit OK, it seems to run the gdb client locally with a few commands, then times out trying to communicate with the gdbserver. I have debug logging turned on with the server, so I know the server never sees anything from the client run from Qt Creator. Additionally, I did Window->Views->Debugger Log to help me get a better idea of what was going on. The log shows the correct IP address and port for my device, but I don't see anything that looks like a 'target remote IP:port' call.

I'm looking for a hint or reference here. I seem to be a bit stuck at the moment. Thanks!

EDIT: additional information - I've verified that my gdb client has support for python compiled in. I see that Qt Creator requires python support. I also have further support that nothing ever goes out on the wire from Qt Creator. I did a wireshark capture and don't see anything going to port 2345 on the target.

Alternately, if anyone would share their Qt Creator debugger-log output with me so I can compare, that would be helpful.

2
This appears to be a bug in the 4.5 beta. I ran a copy of Qt Creator 4.3.1 and I got it to work. In 4.3.1, the dialog that comes up with Debug->Start Debugging->Attach to running debug server has a field to 'override server address'. When I added my IP address there it just worked (without overriding the server address it tried to go to the ssh port for some reason). I saw 'target remote tcp:10.28.22.226:2345' in the QtC debugger-log. - Rich von Lehe
I created QTCREATORBUG-19392 at bugreports.qt.io. - Rich von Lehe
Tried Qt Creator 4.5RC1 and didn't have this problem. - Rich von Lehe

2 Answers

0
votes

Avoid Qt Creator 4.5-beta1. It seems 4.5RC1 doesn't have this problem. I was able to do remote debugging using the method described above just fine.

0
votes

Even QtCreator 4.5.0 seems to have the same bug. The only workaround I've found is to start the GDB server manually on the remote target: with "top" I get the pid of the remote process to debug then I run the following command: gdbserver --attach remote ip:remote port pid. After the server is listening, I finally choose: "Attach to Running Debug" server".

Maybe you can write a server start script on target which include the above statement...