Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Dr. Rolf Jansen" <rj@surtec.com>
To: gdb-patches@sourceware.org
Subject: Issue with gdbserver --multi / remote-extended on Windows XP
Date: Wed, 17 Sep 2008 17:36:00 -0000	[thread overview]
Message-ID: <E9B56D18-AB65-4F0A-A491-AF6C47A731AD@surtec.com> (raw)

I experimented a little bit with gdbserver --multi in remote-xtended  
mode on Windows XP and I had one major problem in debugging a gui  
application. If I regularly quit the gui app, to which gdbserver is  
attached, its open windows remain at the screen, and while although  
inresponsive they are still part of the window hierarchy of Windows.


Observations:
- the gui app is terminates itself by calling exit(0).
- if I quit gdbserver, the open zombie-windows disappear
- in non-multi/remote-extended-mode gdbserver this problem
   does not appear, because gdbserver terminates itself
   together with the application


I found a solution that works for me, although, there might be better  
ways.

At line 1456 of win32-low.c I added:

       TerminateProcess (current_process_handle,
                         current_event.u.ExitProcess.dwExitCode);
       child_continue (DBG_TERMINATE_PROCESS, -1);



This code is added in event-handler switch() of  
get_child_debug_event() and the respective case block looks now like:

     case EXIT_PROCESS_DEBUG_EVENT:
       OUTMSG2 (("gdbserver: kernel event EXIT_PROCESS_DEBUG_EVENT "
		"for pid=%d tid=%x\n",
		(unsigned) current_event.dwProcessId,
		(unsigned) current_event.dwThreadId));
       ourstatus->kind = TARGET_WAITKIND_EXITED;
       ourstatus->value.integer =  
current_event.u.ExitProcess.dwExitCode;
       TerminateProcess (current_process_handle,
                         current_event.u.ExitProcess.dwExitCode);
       child_continue (DBG_TERMINATE_PROCESS, -1);
       CloseHandle (current_process_handle);
       current_process_handle = NULL;
       break;


With these changes in place, regular gui app termination works well  
with gdbserver --multi/remote-extended on Windows XP.

Best regards

Rolf


             reply	other threads:[~2008-09-17 17:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-17 17:36 Dr. Rolf Jansen [this message]
2008-11-05  1:04 ` Pedro Alves
2009-01-13 17:00   ` Pedro Alves
2009-01-13 17:51     ` Daniel Jacobowitz
2009-01-13 17:58     ` Christopher Faylor
2009-01-13 18:22       ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E9B56D18-AB65-4F0A-A491-AF6C47A731AD@surtec.com \
    --to=rj@surtec.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox