This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: gdbserver exiting
- To: khilman AT equator dot com
- Subject: Re: gdbserver exiting
- From: Stan Shebs <shebs AT cygnus dot com>
- Date: Wed, 15 Sep 1999 13:31:47 -0700
- CC: gdb AT sourceware.cygnus dot com
From: Kevin Hilman <khilman@equator.com>
Date: 15 Sep 1999 13:14:58 -0700
I working on a port of gdbserver. I'd like to convince gdbserver to
exit when gdb exits since it's a multi-user environment and each user
will run their own instance of gdbserver. Is there anything part
of the protocol to do this, or should I add my own extention to
the protocol.
Yes, the existing "k" packet should do what you want. If GDB has a
live connection via "target remote", and you quit, it will send a
"k" packet. In fact, my version of gdbserver exits when it receives
a "k", unless you're using extended-remote, what version are you
using? From gdbserver/server.c:
case 'k':
fprintf (stderr, "Killing inferior\n");
kill_inferior ();
/* When using the extended protocol, we start up a new
debugging session. The traditional protocol will
exit instead. */
if (extended_protocol)
{
write_ok (own_buf);
fprintf (stderr, "GDBserver restarting\n");
/* Wait till we are at 1st instruction in prog. */
signal = start_inferior (&argv[2], &status);
goto restart;
break;
}
else
{
exit (0);
break;
}
Stan