I have an application which runs on the Raspberry Pi and I would like to debug it from my host computer.
Cross compiling works fine and I am able to start the gdb server to debug.
gdbConfigurationScript.sh
empty!
copyToRemote.sh
#!/bin/bash
USER=pi
HOST_IP=192.168.178.20
REMOTE_IP=multikopter
TARGET_PATH=/home/pi/Documents/Multikopter
PROGRAM=Multikopter
PORT=12345
PATH_TO_PROGRAM_HOST="/home/martin/GITProjekte/Build00_Multikopter"
PW=****
if [ -f "$PATH_TO_PROGRAM_HOST/$PROGRAM" ]
then
echo "Copy file '$PATH_TO_PROGRAM_HOST/$PROGRAM' to target"
sshpass -p $PW ssh -t $USER@$REMOTE_IP "echo PGREPGDBSERVER: $(pgrep gdbserver);sudo kill -2 $(pgrep gdbserver)"
sshpass -p $PW scp "$PATH_TO_PROGRAM_HOST/$PROGRAM" $USER@$REMOTE_IP:$TARGET_PATH
sshpass -p $PW ssh -t $USER@$REMOTE_IP "sudo gdbserver $HOST_IP:$PORT $TARGET_PATH/$PROGRAM"
else
echo "file '$PATH_TO_PROGRAM_HOST/$PROGRAM'not exist"
fi
connectToRemoteGDB.sh
file Multikopter
target remote multikopter:12345
b main
continue
The problem is, I'm not able to stop the program again and the gdbserver is still running. To debug again, I have to kill the gdbserver on the raspberrypi manually first.
Is there another way to debug remote with KDevelop or is there an easy way to stop the program?