Setup so far
1. Building gdb
The latest versions of Qt creator require gdb to be compiled with python support. Compiling gdb for remote arm with python support.
- Get gdb source from here http://www.gnu.org/software/gdb/download/
- Extract and move to the extracted directory
(Optional) Create a build folder
mkdir -p build/gdb
Run configure with the following parameters. NOTE:
arm-linux-gnueabi
this should be the prefix to your cross compiler binaries that are in PATH.../../configure --target=arm-linux-gnueabi --with-python
Run
make
If all went well, there should be a gdb executable in gdb-7.7.1/build/gdb/gdb/
compiled with python support that can communicate with a gdbserver running on arm.
2. Building gdbserver
The source for gdbserver is in the gdb source.
(Optional) Create a build dir for the gdbserver
mkdir -p build/gdbserver
Prepare the gdbserver for cross compilation
../../gdb/gdbserver/configure --host=arm-linux-gnueabi
Run
make
If all went well, you should have the gdbserver
executable in gdb-7.7.1/build/gdbserver/
.
3. Migrating the gdbserver to the target
The gdbserver has to be located on the target device on which the code you're debugging will be run. I've just moved it to /usr/bin
with scp
. Since /usr/bin
is in PATH, that makes gdbserver available in the remote terminal.
4. Setting up Qt creator
To be able do deploy and run from Qt Creator you need to specify the way how it should connect to the target. In Devices
add a new device with the required parameters. I'm using openssh on the target with password authentication. Run test to check if this step passes.
To define the run path on the target add the following to the .pro file:
linux-* {
target.path = .
INSTALLS += target }
NOTE: you can check the run settings in Projects->Run
. Add a kit first if you can't find the run button.
In the Build and Run-> Kits -> "Your cross compiler kit name"
select Manage...
for the Debugger attribute. Add a new debugger which points to the gdb executable that was compiled in step 1.
Also, be sure to enable Use Debugging Helper
in Debugger->Locals & Expressions
to get the QStrings interpreted correctly.
I came this far succesfully
The problem
When I compile a sample code and run on the host everything works.
but when I try doing it on the remote, nothing is accessible.
The error that pops out it:
I'll be updating this as new insights occur.