Compiling gdb for remote debugging

I am trying to remotely debug an application running on arm9

So far, I have managed to cross-compile and run gdbserver on my device.

  • get gdb (7.2) sources and extract them
  • ./configure --target = arm-none-linux-gnueabi --with-expat = / usr / local / lib /
  • make
  • cd gdb / gdbserver
  • ./configure --host = arm-none-linux-gnueabi
  • make
  • tftp gdbserver on my device
  • start and connect via gdb to the device

gdbserver "seems" to start correctly and join my helloworld application

When I try to run gdb on a remote server, I get the msgstr "warning: cannot parse the XML description of the target; XML support was disabled at compile time

Obviously, compilation did not take expat into account. I'm really not sure how to specify the expat library path to the script configuration.

+7
source share
2 answers

(old question, but I stumbled upon it using a search on the same issue)

The problem is the lack of "expat" lib. This is hard to guess because:

  • this library is optional for compiling gdb
  • The name "expat" does not have a clear XML connection ...

So install "expat-dev" (with your package manager or something else) and then restart. / configure. Be careful to install the version of "dev" as we are recompiling and you need include files.

To be sure, you can add "-with-expat" to the call. / configure so that it stops with an error if expat is not found.

+18
source

Somehow it all worked

Alternatively, create the ~ / .gdbinit file with

file /home/username/path/to/exec/exec_name set sysroot /path/to/libraries/running/on/target/device target remote HOST:PORT b main 
+1
source

All Articles