Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to terminate gdbserver?

Tags:

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 ?

like image 422
yehudahs Avatar asked Jan 01 '14 15:01

yehudahs


People also ask

How do I close a GDB server?

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.

What is gdbserver in Linux?

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.

What port does gdbserver use?

The `host:2345' argument means that gdbserver is to expect a TCP connection from machine `host' to local TCP port 2345.

How do I start gdbserver on target?

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 ...]


2 Answers

Give command

monitor exit 

from your host gdb before terminating the client. If you have already terminated it, just attach with another one.

like image 116
Konstantin Shemyak Avatar answered Oct 04 '22 20:10

Konstantin Shemyak


on linux write:

ps -ef |grep gdbserver 

Now find the pid of the gdbserver process and then

kill -9 <pid> 
like image 38
Innovation Avatar answered Oct 04 '22 18:10

Innovation