From: Pedro Alves <pedro_alves@portugalmail.pt>
To: gdb-patches@sourceware.org
Subject: Re: [RFC] [gdbserver/win32] Enable detaching on MinGW.
Date: Thu, 10 May 2007 21:35:00 -0000 [thread overview]
Message-ID: <46438FE4.9030806@portugalmail.pt> (raw)
In-Reply-To: <20070510185704.GC27802@caradoc.them.org>
[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]
Daniel Jacobowitz wrote:
> 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.
>
Thanks.
I've also committed the following as obvious.
Cheers,
Pedro Alves
[-- Attachment #2: fix_detach.diff --]
[-- Type: text/x-diff, Size: 1254 bytes --]
2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt>
* linux-low.c (linux_detach): Change return type to int. Return 0.
* spu-low.c (spu_detach): Likewise.
---
gdb/gdbserver/linux-low.c | 3 ++-
gdb/gdbserver/spu-low.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
Index: src/gdb/gdbserver/linux-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-low.c 2007-05-10 21:55:20.000000000 +0100
+++ src/gdb/gdbserver/linux-low.c 2007-05-10 22:22:04.000000000 +0100
@@ -287,10 +287,11 @@ linux_detach_one_process (struct inferio
ptrace (PTRACE_DETACH, pid_of (process), 0, 0);
}
-static void
+static int
linux_detach (void)
{
for_each_inferior (&all_threads, linux_detach_one_process);
+ return 0;
}
static void
Index: src/gdb/gdbserver/spu-low.c
===================================================================
--- src.orig/gdb/gdbserver/spu-low.c 2007-05-10 21:55:20.000000000 +0100
+++ src/gdb/gdbserver/spu-low.c 2007-05-10 22:22:46.000000000 +0100
@@ -314,10 +314,11 @@ spu_kill (void)
}
/* Detach from inferior process. */
-static void
+static int
spu_detach (void)
{
ptrace (PTRACE_DETACH, current_tid, 0, 0);
+ return 0;
}
static void
prev parent reply other threads:[~2007-05-10 21:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-08 2:10 Pedro Alves
2007-05-10 18:57 ` Daniel Jacobowitz
2007-05-10 21:35 ` Pedro Alves [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46438FE4.9030806@portugalmail.pt \
--to=pedro_alves@portugalmail.pt \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox