I'm having remote ARM Linux box which I need to debug.
The server is started:
gdbserver :12345 ./my_app
The client:
./arm-am3354-linux-gnueabihf-gdb ~/
(gdb) target remote dev_r:12345
(gdb) continue
Then I'm trying to pause the app with Ctrl+C, but the gdb stops with:
[Inferior 1 (process 2766) exited with code 01]
And on server:
Child exited with status 1 GDBserver exiting
Story: I was trying to use remote debugging in QtCreator, but when setting breakpoints in run-time the gdb was crashing in the same way. Also the breakpoints and pause is not working in QtCreator. I was trying also another gdb like gdb-multiarch and the one from android-sdk.
Update: Debugging small program aka Hello World works. Local Debugging (on x86) works too. The app itself has hundred thousand lines of code, shared and static libraries.
Partial solution: Probably the sysroot for embedded platform that I've got was invalid. After copying /lib/ and /usr/ from the target device and setting it as
set sysroot /home/karel/sysroot
I'm able to set breakpoints and the app stops at them. The pause however is still stopping the remote app. The same for QtCreator: Tools->Options->Debugger->GDB->Additional Attach Commands