From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17912 invoked by alias); 11 Sep 2009 15:22:35 -0000 Received: (qmail 17898 invoked by uid 22791); 11 Sep 2009 15:22:34 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Sep 2009 15:22:30 +0000 Received: (qmail 751 invoked from network); 11 Sep 2009 15:22:29 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 Sep 2009 15:22:29 -0000 From: Pedro Alves To: gdb-patches@sourceware.org, danny.backx@scarlet.be Subject: Re: Build question Date: Fri, 11 Sep 2009 15:22:00 -0000 User-Agent: KMail/1.9.10 Cc: tromey@redhat.com, Eli Zaretskii References: <1250803105.11282.96.camel@pavilion> <1252680173.8804.25.camel@pavilion> In-Reply-To: <1252680173.8804.25.camel@pavilion> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909111622.34265.pedro@codesourcery.com> X-IsSubscribed: yes 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/msg00320.txt.bz2 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. Neither DebugActiveProcessStop nor DebugSetProcessKillOnExit were support by Windows CE up until version 5. I see that DebugActiveProcessStop was added to CE 6.0: http://msdn.microsoft.com/pt-br/library/aa924105.aspx ... although there's no sign of DebugSetProcessKillOnExit. win32-low.c:win32_detach has this: /* Detach from inferior PID. */ static int win32_detach (int pid) { struct process_info *process; winapi_DebugActiveProcessStop DebugActiveProcessStop = NULL; winapi_DebugSetProcessKillOnExit DebugSetProcessKillOnExit = NULL; #ifdef _WIN32_WCE HMODULE dll = GetModuleHandle (_T("COREDLL.DLL")); #else HMODULE dll = GetModuleHandle (_T("KERNEL32.DLL")); #endif DebugActiveProcessStop = GETPROCADDRESS (dll, DebugActiveProcessStop); DebugSetProcessKillOnExit = GETPROCADDRESS (dll, DebugSetProcessKillOnExit); if (DebugSetProcessKillOnExit == NULL || DebugActiveProcessStop == NULL) return -1; 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_?) -- Pedro Alves