From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6954 invoked by alias); 17 Sep 2008 17:36:00 -0000 Received: (qmail 6943 invoked by uid 22791); 17 Sep 2008 17:35:59 -0000 X-Spam-Check-By: sourceware.org Received: from ns.surtec.com (HELO SurTec.com) (62.157.175.70) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 17 Sep 2008 17:35:20 +0000 Received: from [192.168.1.5] (br.surtec.com [200.161.1.30]) by SurTec.com (Postfix) with ESMTP id D0CD99D0256 for ; Wed, 17 Sep 2008 19:35:16 +0200 (CEST) Message-Id: From: "Dr. Rolf Jansen" To: gdb-patches@sourceware.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Issue with gdbserver --multi / remote-extended on Windows XP Date: Wed, 17 Sep 2008 17:36:00 -0000 X-Mailer: Apple Mail (2.929.2) 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: 2008-09/txt/msg00373.txt.bz2 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