I try to remotely debug a program using gdb and gdbserver.
I login on the remote PC with ssh and run gdbserver --multi :4444
And on my local, I use the command./arm-linux-gnueabihf-gdb -x /path/init
where the content of the /path/init
file is:
symbol-file /home/username/workspace/piCCompileProj/Debug/main
target extended-remote 192.168.0.100:4444
set remote exec-file /home/username/cppSandbox/main
If I try to set a breakpoint with (gdb) b 6
, gdb prints the error:
Cannot access memory at address 0x86c8
And if I type file /home/username/workspace/piCCompileProj/Debug/main
and then run
, the output is:
Starting program: /home/username/workspace/piCCompileProj/Debug/main
Program received signal SIGSEGV, Segmentation fault.
0x76fe6c00 in ?? ()
from /home/username/pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/libc/lib/ld-linux-armhf.so.3
How can I load symbols in gdb and debug?