Message ID | 20200208182539.5775-1-ssbssa@yahoo.de |
---|---|
State | New, archived |
Headers |
Received: (qmail 118325 invoked by alias); 8 Feb 2020 18:26:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 118317 invoked by uid 89); 8 Feb 2020 18:26:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:759, HContent-Transfer-Encoding:8bit X-HELO: sonic310-11.consmr.mail.ir2.yahoo.com Received: from sonic310-11.consmr.mail.ir2.yahoo.com (HELO sonic310-11.consmr.mail.ir2.yahoo.com) (77.238.177.32) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 08 Feb 2020 18:26:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1581186369; bh=GsutoXKAjE4T9ALYpl5y7MC/8OCQXXW0LfvmVJcyWgA=; h=From:To:Subject:Date:References:From:Subject; b=HajvS9ihU00hFyRAdSZYolmkahMaWe2CZ1zifGGZZLzj7ftU9OQWM/YIXYoOF1sW8/gH44cCTalPVfI7VTzVeWuyE9JcYXQkP/mXNCfNZ7wfmkyu9QjiyR5ZtVTdpoIkNnLxsorITMmLAG4KfBAbE6/7HWpR6jnuoGeFxhn5Vze9amkgpGbcbT+katgkLr/OXuKuvqpf5wGBN0HpZJ69VyegqqBMQfV933RWPMncppbjipwAjneUg9VVPXGFLtEihIsIyu26klifProiXKYXM6b4lFyMit7uxMIEKWQ2wZ//9AJ/hJXjq1CT7zXdJqR4tIC+Fx3KxJqjTYGP8cCQLw== Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ir2.yahoo.com with HTTP; Sat, 8 Feb 2020 18:26:09 +0000 Received: by smtp414.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID e46f62fbd630589a024a4b3f6ac0e17c; Sat, 08 Feb 2020 18:26:06 +0000 (UTC) From: "Hannes Domani via gdb-patches" <gdb-patches@sourceware.org> Reply-To: Hannes Domani <ssbssa@yahoo.de> To: gdb-patches@sourceware.org Subject: [PATCH] Fix kill of processes created by win32_create_inferior Date: Sat, 8 Feb 2020 19:25:39 +0100 Message-Id: <20200208182539.5775-1-ssbssa@yahoo.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit References: <20200208182539.5775-1-ssbssa.ref@yahoo.de> Content-Length: 720 X-IsSubscribed: yes |
Commit Message
Terekhov, Mikhail via Gdb-patches
Feb. 8, 2020, 6:25 p.m. UTC
handle_v_kill uses signal_pid because win32 doesn't support multi-process. gdbserver/ChangeLog: 2020-02-08 Hannes Domani <ssbssa@yahoo.de> * win32-low.c (win32_create_inferior): Set signal_pid. --- gdbserver/win32-low.c | 3 +++ 1 file changed, 3 insertions(+)
Comments
On 2/8/20 3:25 PM, Hannes Domani via gdb-patches wrote: > handle_v_kill uses signal_pid because win32 doesn't support multi-process. > > gdbserver/ChangeLog: > > 2020-02-08 Hannes Domani <ssbssa@yahoo.de> > > * win32-low.c (win32_create_inferior): Set signal_pid. > --- > gdbserver/win32-low.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gdbserver/win32-low.c b/gdbserver/win32-low.c > index 9d0343788f..557c90d97c 100644 > --- a/gdbserver/win32-low.c > +++ b/gdbserver/win32-low.c > @@ -709,6 +709,9 @@ win32_create_inferior (const char *program, > (assuming success). */ > cs.last_ptid = win32_wait (ptid_t (current_process_id), &cs.last_status, 0); > > + /* Necessary for handle_v_kill. */ > + signal_pid = current_process_id; > + > return current_process_id; > } > > Thanks. This one looks OK to me. It would be nice to augment the description with what situation this fixes. I suppose it doesn't kill the process properly?
On 2020-02-10 5:33 p.m., Luis Machado wrote: > On 2/8/20 3:25 PM, Hannes Domani via gdb-patches wrote: >> handle_v_kill uses signal_pid because win32 doesn't support multi-process. >> >> gdbserver/ChangeLog: >> >> 2020-02-08 Hannes Domani <ssbssa@yahoo.de> >> >> * win32-low.c (win32_create_inferior): Set signal_pid. >> --- >> gdbserver/win32-low.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/gdbserver/win32-low.c b/gdbserver/win32-low.c >> index 9d0343788f..557c90d97c 100644 >> --- a/gdbserver/win32-low.c >> +++ b/gdbserver/win32-low.c >> @@ -709,6 +709,9 @@ win32_create_inferior (const char *program, >> (assuming success). */ >> cs.last_ptid = win32_wait (ptid_t (current_process_id), &cs.last_status, 0); >> >> + /* Necessary for handle_v_kill. */ >> + signal_pid = current_process_id; >> + >> return current_process_id; >> } >> >> > > Thanks. This one looks OK to me. > > It would be nice to augment the description with what situation this > fixes. I suppose it doesn't kill the process properly? Agreed. The patch looks ok, as far as I understand, but it would be good to explain in the commit message what's the bug, how you provoke it, how the new behavior differs from the previous behavior. Simon
On 2020-02-11 11:18 p.m., Simon Marchi wrote: > On 2020-02-10 5:33 p.m., Luis Machado wrote: >> On 2/8/20 3:25 PM, Hannes Domani via gdb-patches wrote: >>> handle_v_kill uses signal_pid because win32 doesn't support multi-process. >>> >>> gdbserver/ChangeLog: >>> >>> 2020-02-08 Hannes Domani <ssbssa@yahoo.de> >>> >>> * win32-low.c (win32_create_inferior): Set signal_pid. >>> --- >>> gdbserver/win32-low.c | 3 +++ >>> 1 file changed, 3 insertions(+) >>> >>> diff --git a/gdbserver/win32-low.c b/gdbserver/win32-low.c >>> index 9d0343788f..557c90d97c 100644 >>> --- a/gdbserver/win32-low.c >>> +++ b/gdbserver/win32-low.c >>> @@ -709,6 +709,9 @@ win32_create_inferior (const char *program, >>> (assuming success). */ >>> cs.last_ptid = win32_wait (ptid_t (current_process_id), &cs.last_status, 0); >>> >>> + /* Necessary for handle_v_kill. */ >>> + signal_pid = current_process_id; >>> + >>> return current_process_id; >>> } >>> >>> >> >> Thanks. This one looks OK to me. >> >> It would be nice to augment the description with what situation this >> fixes. I suppose it doesn't kill the process properly? > > Agreed. The patch looks ok, as far as I understand, but it would be good to > explain in the commit message what's the bug, how you provoke it, how the new > behavior differs from the previous behavior. > > Simon > Sorry, I just saw that you have already posted a v2, I'll at it now. Simon
diff --git a/gdbserver/win32-low.c b/gdbserver/win32-low.c index 9d0343788f..557c90d97c 100644 --- a/gdbserver/win32-low.c +++ b/gdbserver/win32-low.c @@ -709,6 +709,9 @@ win32_create_inferior (const char *program, (assuming success). */ cs.last_ptid = win32_wait (ptid_t (current_process_id), &cs.last_status, 0); + /* Necessary for handle_v_kill. */ + signal_pid = current_process_id; + return current_process_id; }