1
votes

I am trying to debug a cross-compiled application with gdbserver. Unfortunately I get the following error on my host:
Reply contains invalid hex digit 59
Here's what I did:

  • compiled my application "line-generator" (which is just a test program) with gcc -ggdb3 -std=gnu89 flags (using -g instead of -ggdb3 didn't make any difference)
  • copy the executable to my embedded system. The exec can be executed there
  • started gdbserver 192.168.10.20:54320 line-generator on the embedded system
  • On the host I start gdb: gdb line-generator.gdb
  • (gdb) target remote 192.168.10.102:54320
  • Got this response on host:
    Remote debugging using 192.168.10.102:54320
    Reply contains invalid hex digit 59
  • On the server I got this:
    Remote debugging from host 192.168.10.20
    readchar: Got EOF
    Remote side has terminated connection. GDBserver will reopen the connection.
    Listening on port 54320

I have never used gdb remotely so maybe I am running into a beginner's issue so every response might help.

edit: My gdbserver was provided by the manufacturer of the embedded hardware.

1

1 Answers

1
votes

I found out that remote-debugging a cross-compiled executable needs gdb on the host computer to be compiled for this purpuse. In my case it means that I have to use this command

/opt/microblaze-uclinux-tools/bin/microblaze-uclinux-gdb line-g
enerator.gdb

instead of simple gdb line-generator.gdb

Luckily the correct file was provided by the embedded board manufacturer! To be honest I don't fully understand the context so if someone has an explanation on this I'd be glad to hear this!
cheers, Stefan