remote debugging EV3 using gdbserver fails

256 views Asked by At

I'm writing c++ code for a Lego EV3 that is running on the debian based ev3dev. In order to compile it, I am using a docker container with the ev3dev image. (This turned out to be the best working way compared to cross compiling from Windows or WSL)

To debug my code, I wanted to create a gdbserver on the EV3 and then connect to it from my laptop. Hence, I compiled the code as following:

arm-linux-gnueabi-g++ -g -o app ./app.cpp

I then copied the binary to the EV3 and started a gdbserver on it:

gdbserver :8000 ./app

And connected to it from my laptop:

gdb ./app
(gdb) target remote 192.168.137.3:8000

However, I am unable to continue debugging and since I am not very experienced when it comes to cross compiling and remote debugging, I am not sure how to fix the problem.

This is the console output on my laptop:

compiler@32a0a4440089:/src/EV3-testing/remote_debugger_test$ gdb ./app
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./app...done.
(gdb) target remote 192.168.137.3:8000
Remote debugging using 192.168.137.3:8000
warning: while parsing target description (at line 1): Target description specified unknown architecture "arm"
warning: Could not load XML target description; ignoring
Reading /lib/ld-linux.so.3 from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
warning: `target:/lib/ld-linux.so.3': Shared library architecture unknown is not compatible with target architecture i386.
Reading /lib/ld-linux.so.3 from remote target...
warning: `target:/lib/ld-linux.so.3': Shared library architecture unknown is not compatible with target architecture i386.
Reading symbols from target:/lib/ld-linux.so.3...Reading /lib/983c6fff2b6d7f46f59d77068be46be3852e81.debug from remote target...
Reading /lib/.debug/983c6fff2b6d7f46f59d77068be46be3852e81.debug from remote target...
(no debugging symbols found)...done.
0x00000000 in ?? ()
(gdb) b main
Breakpoint 1 at 0x400748: file ./app.cpp, line 18.
(gdb) c
Continuing.
Warning:
Cannot insert breakpoint 1: Remote connection closed

Command aborted.

And this is the output on the EV3:

robot@ev3dev:~$ gdbserver :8000 ./app
Process ./app created; pid = 1737
Listening on port 8000
Remote debugging from host 192.168.137.1
client_loop: send disconnect: Connection reset

Thanks for any help!

0

There are 0 answers