Qt remote debugging

bluscape
I'm trying to execute remote debugging from Qt creator 1.3.1. The debugger
starts the application but I'm unable to set breakpoints.

What I've done:

1.) Filesystem and application (compiled with debug flags) on my SD card.

2.) TestApp in /home on SD card

3.) gdb server running on my Mini2440: gdbserver 192.168.1.100:1000
./TestApp -qws

4.) gdb server output: Process ./TestApp created; pid = 524
Listening on port 1000

5.) In Qt I've configured Tools->Options->Debugger->Gdb->Gdb location:
/opt/OSELAS.Toolchain-2011.03.0/arm-v4t-linux-gnueabi/gcc-4.5.2-glibc-2.13-binut
ils-2.21-kernel-2.6.36-sanitized/bin/arm-v4t-linux-gnueabi-gdbtui

6.) Qt build configuration set to debug

7.) Qt Run settings: 
Executable name: path-to-executable-on-development-machine
Working directory: path-to-qt-project-files

8.) Started the debugger with Debug->Start Debugging->Start and Attach to
Remote Application
Host and port: 192.168.1.100:1000
Architecture: i386

At this point the debugger will start the application on the mini2440 but
it seems like Qt does not enter debug mode and breakpoints does not work.

Any ideas?

Juergen Beisert
Does the debugger know the path to your root filesystem? Seems you are
using PTXdist. The debugger needs the path to the
"platform-mini244/root-debug". This will enable it to get all debug info it
needs for correct debugging (refer solib-absolute-prefix)

Hope it helps

bluscape
Hi Juergen,

I have a couple of questions.

1.) Why gdbtui and not gdb?
2.) Do I need to run my Mini2440 from the debug file system too or should
only the debugger work from there?
3.) Typically I would point the debugger to rootfs using: set
solib-absolute-prefix platform-mini2440/root-debug, but now I'm debugging
from Qt so I'm not sure how to proceed. I could explicitly set it from the
terminal but Qt might overwrite it.

Juergen Beisert
Hi bluescape,

> 1.) Why gdbtui and not gdb?

"gdbtui" is a text console based light weight debugging frontend. If the
qtcreator acts as your frontend, you only need the "gdb"

> 2.) Do I need to run my Mini2440 from the debug file system
> too or should only the debugger work from there?

The binaries in root/ and root-debug/ are the same. For executing these
binaries it makes no difference. But the root-debug/ binaries still contain
the debug symbols the debugger depends on.

> 3.) Typically I would point the debugger to rootfs using: set
> solib-absolute-prefix platform-mini2440/root-debug, but now
> I'm debugging from Qt so I'm not sure how to proceed. I could
> explicitly set it from the terminal but Qt might overwrite it

You are just using a different frontend to "gdb". In the background still
the same mechanism must be used. The important thing is to have your own Qt
code linked against the libs in the root filesystem your Mini2440 "sees".
The symbols the "gdb" collects at the host side must correspond to the
binaries the Mini2440 uses. Only if they are in sync the gdb can do its
job.

Happy hacking.