This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] [gdbserver/win32] Enable detaching on MinGW.
- From: Daniel Jacobowitz <drow at false dot org>
- To: Pedro Alves <pedro_alves at portugalmail dot pt>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 10 May 2007 14:57:04 -0400
- Subject: Re: [RFC] [gdbserver/win32] Enable detaching on MinGW.
- References: <463FDC1C.8020302@portugalmail.pt>
On Tue, May 08, 2007 at 03:10:36AM +0100, Pedro Alves wrote:
> Hi all,
>
> Currently detach support is skipped on MinGW (and mingw32ce),
> because there is no waitpid on Windows. This patch enables it
> by implementing the waiting for the inferior to exit in a new
> target_op::join.
>
> One thing that annoys me, is that requesting for detach kills the
> inferior if detaching isn't supported. The patch makes gdbserver
> return an error (E packet) to gdb, so gdb knows it shouldn't
> stop debugging. The user can then kill the inferior is he wants.
>
> What do you think of this behavior?
>
> Is the patch OK?
The gdbserver parts are fine.
> - remote_send (&rs->buf, &rs->buf_size);
> + putpkt (rs->buf);
> + getpkt (&rs->buf, &rs->buf_size, 0);
> +
> + if (rs->buf[0] == 'E')
> + error (_("Can't detach process."));
Isn't this basically what happens already in remote_send? Oh, but we
have a better error message now. This part's OK too.
--
Daniel Jacobowitz
CodeSourcery