10

I'm trying to remote debug an application running on arm9

So far I've been able to cross compile and execute gdbserver on my device.

  1. get gdb (7.2) sources and extract them
  2. ./configure --target=arm-none-linux-gnueabi --with-expat=/usr/local/lib/
  3. make
  4. cd gdb/gdbserver
  5. ./configure --host=arm-none-linux-gnueabi
  6. make
  7. tftp gdbserver to my device
  8. run and connect via gdb to the device

gdbserver "seems" to start correctly and attach itself to my helloworld application

When I try to gdb to the remote server, I get
"warning: Can not parse XML target description; XML support was disabled at compile time"

Obviously, the compilation didn't take into account expat. I'm really unsure about how to specify the expat library path to the configuration script.

2 Answers 2

21

(old question but I stumbled into it via googling the same problem)

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

  1. this lib is optional for compiling gdb
  2. the "expat" name has no clear connection to XML...

So install "expat-dev" (with your packet manager or anything) and then relaunch ./configure. Be careful to install the "dev" version since we are doing recompilation and need the include files.

To be extra-sure, it's possible to add the "--with-expat" to the ./configure call so that it will stop with an error if expat is not found.

Sign up to request clarification or add additional context in comments.

2 Comments

I tried "--with-expat" prior to installing expat-dev and the configure script did not fail. The package install I used was "sudo apt-get install libexpat1-dev". I omitted --with-expat, but otherwise a spot-on answer. Thanks for the help!
Yeah that is really confusing. Also realised that --with-expat simply behaves like if it was omitted when it cannot find the library.
1

Somehow it worked anyway

Also, create a file ~/.gdbinit with

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.