This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Build question
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org, danny dot backx at scarlet dot be
- Cc: tromey at redhat dot com, Eli Zaretskii <eliz at gnu dot org>
- Date: Fri, 11 Sep 2009 16:22:32 +0100
- Subject: Re: Build question
- References: <1250803105.11282.96.camel@pavilion> <m3skevq4b7.fsf@fleche.redhat.com> <1252680173.8804.25.camel@pavilion>
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