This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Build question

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:

... 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"));
  HMODULE dll = GetModuleHandle (_T("KERNEL32.DLL"));
  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

(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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]