From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25093 invoked by alias); 12 Sep 2009 14:48:08 -0000 Received: (qmail 25065 invoked by uid 22791); 12 Sep 2009 14:48:06 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_55,RCVD_IN_DNSWL_LOW,RCVD_IN_JMF_BL,SPF_PASS X-Spam-Check-By: sourceware.org Received: from eir.is.scarlet.be (HELO eir.is.scarlet.be) (193.74.71.27) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 12 Sep 2009 14:47:59 +0000 Received: from [172.17.1.10] (ip-81-11-243-105.dsl.scarlet.be [81.11.243.105]) by eir.is.scarlet.be (8.14.2/8.14.2) with ESMTP id n8CElBQO002050; Sat, 12 Sep 2009 16:47:11 +0200 Subject: Re: Build question From: Danny Backx Reply-To: danny.backx@scarlet.be To: Pedro Alves Cc: gdb-patches@sourceware.org, tromey@redhat.com, Eli Zaretskii In-Reply-To: <200909111622.34265.pedro@codesourcery.com> References: <1250803105.11282.96.camel@pavilion> <1252680173.8804.25.camel@pavilion> <200909111622.34265.pedro@codesourcery.com> Content-Type: text/plain Date: Sat, 12 Sep 2009 14:48:00 -0000 Message-Id: <1252766961.8804.38.camel@pavilion> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-DCC-scarlet.be-Metrics: eir 20001; Body=5 Fuz1=5 Fuz2=5 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00367.txt.bz2 On Fri, 2009-09-11 at 16:22 +0100, Pedro Alves wrote: > On Friday 11 September 2009 15:42:53, Danny Backx wrote: > > Question : it looks like breaking a gdb-gdbserver session always kills > > the inferior. Or at least it does so on my target. Has this been subject > > of research yet ? I would expect it to be possible to detach without > > killing the inferior, much like you can when debugging a linux process > > from a linux gdb. > > What do you mean by breaking, and what do you mean by > detaching? Please be specific. Good question :-) Turns out I had not analysed my question sufficiently before sending this mail. What I was looking for is for gdbserver (and the inferior) to linger after disconnecting gdb-gdbserver, until I reconnect to it with maybe another gdb session. Maybe my question is a bit too funky. > Neither DebugActiveProcessStop nor DebugSetProcessKillOnExit were support > by Windows CE up until version 5. I see that DebugActiveProcessStop > was added to CE 6.0: > Try checking if DebugActiveProcessStop is non-NULL here on > your CE >= 6.0 device, and tweak this code to make it possible to detach > with DebugActiveProcessStop even if we don't support > DebugSetProcessKillOnExit. > > (In fact, I don't understand why DebugSetProcessKillOnExit is > needed here. does Windows really kill a detached inferior when > gdbserver exits _after_having_detached_from_it_?) No, I don't see that. FYI see two examples below, both show both the gdb and gdbserver session (they're on my screen in two xterms). Scenario 1 : detach gdb (from gdbserver) -> gdbserver appears to detach from inferior -> gdbserver terminates -> inferior continues to run (gdb) target remote ebox:9999 Remote debugging using ebox:9999 (gdb) detach Ending remote debugging. (gdb) \network\x86> gdbserver :9999 /network/x86/usedemo.exe Process /network/x86/usedemo.exe created; pid = 88473610 Listening on port 9999 Remote debugging from host 172.17.1.10 Detaching from process 88473610 \network\x86> In main Message from DLL After DLL call Scenario 2 : quit gdb -> gdb tells gdbserver to terminate inferior -> gdbserver terminates inferior -> gdbserver terminates (gdb) target remote ebox:9999 Remote debugging using ebox:9999 (gdb) q A debugging session is active. Inferior 1 [Remote target] will be killed. Quit anyway? (y or n) y \network\x86> gdbserver :9999 /network/x86/usedemo.exe Process /network/x86/usedemo.exe created; pid = 92536842 Listening on port 9999 Remote debugging from host 172.17.1.10 Killing all inferiors \network\x86> Danny -- Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info