I am trying to debug with gdbserver. after I terminat the gdb client on the host I see that the gdbserver is still listening :
Remote side has terminated connection. GDBserver will reopen the connection. Listening on port 5004
I tried to exit gdbserver with everything I have found anywhere no luck: quit,exit,q, monitor exit,Esc,Cnt+c... nothing kills it. Moreover, when I opened another terminal and looked for the process running gdbserver (with the commands ps,top) I couldn't find it there... my question is - How to terminate gdbserver ?
To exit GDB, use the quit command (abbreviated q ), or type an end-of-file character (usually C-d ). If you do not supply expression , GDB will terminate normally; otherwise it will terminate using the result of expression as the error code.
gdbserver is a program that allows you to run GDB on a different machine than the one which is running the program being debugged. Usage (server (target) side): First, you need to have a copy of the program you want to debug put onto the target system.
The `host:2345' argument means that gdbserver is to expect a TCP connection from machine `host' to local TCP port 2345.
To use the server, you log on to the target system, and run the 'gdbserver' program. You must tell it (a) how to communicate with GDB, (b) the name of your program, and (c) its arguments. The general syntax is: target> gdbserver COMM PROGRAM [ARGS ...]
Give command
monitor exit
from your host gdb before terminating the client. If you have already terminated it, just attach with another one.
on linux write:
ps -ef |grep gdbserver
Now find the pid of the gdbserver process and then
kill -9 <pid>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With