From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23025 invoked by alias); 27 Apr 2013 09:53:21 -0000 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 Received: (qmail 23012 invoked by uid 89); 27 Apr 2013 09:53:21 -0000 X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-pd0-f173.google.com (HELO mail-pd0-f173.google.com) (209.85.192.173) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 27 Apr 2013 09:53:20 +0000 Received: by mail-pd0-f173.google.com with SMTP id v14so1516580pde.18 for ; Sat, 27 Apr 2013 02:53:19 -0700 (PDT) X-Received: by 10.68.228.134 with SMTP id si6mr63412878pbc.24.1367056399157; Sat, 27 Apr 2013 02:53:19 -0700 (PDT) Received: from [192.168.1.128] ([115.193.12.195]) by mx.google.com with ESMTPSA id aj2sm15345111pbc.1.2013.04.27.02.53.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 27 Apr 2013 02:53:18 -0700 (PDT) Message-ID: <517BA14C.2040804@gmail.com> Date: Mon, 29 Apr 2013 05:09:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0a1 MIME-Version: 1.0 To: Eli Zaretskii CC: gdb-patches@sourceware.org Subject: Re: [RFA] Thread exit messages on MS-Windows References: <83obd1tyi7.fsf@gnu.org> <838v44tnf8.fsf@gnu.org> In-Reply-To: <838v44tnf8.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-04/txt/msg00844.txt.bz2 On 2013-4-27 15:58, Eli Zaretskii wrote: >> Date: Fri, 26 Apr 2013 12:46:56 +0300 >> From: Eli Zaretskii >> >> This is from the node "Threads" of the manual: >> >> `set print thread-events' >> `set print thread-events on' >> `set print thread-events off' >> The `set print thread-events' command allows you to enable or >> disable printing of messages when GDB notices that new threads have >> started or that threads have exited. By default, these messages >> will be printed if detection of these events is supported by the >> target. Note that these messages cannot be disabled on all >> targets. >> >> However, debugging MinGW programs on MS-Windows, I see only messages >> about new threads, like this: >> >> [New Thread 6184.0x1bbc] >> [New Thread 6184.0x13c8] >> [New Thread 6184.0x1a3c] >> >> I never see any messages about threads that exited, although examining >> the details of the program being debugged, I clearly see that most of >> them did. >> >> Does that mean that GDB doesn't support thread exit messages on >> Windows? What feature(s) are missing for this support to be >> available? >> >> I can get thread exit messages from windows-nat.c such as >> >> [Deleting Thread 8112.0x1494] >> [Deleting Thread 8112.0x11d0] >> >> if I "set verbose on", but that mode causes GDB to become much more >> talkative than I'd like. >> >> In thread.c, I see that add_thread_with_info will announce new threads >> if print_thread_events is non-zero, but I see no similar announcement >> in delete_thread or its subroutines. Is this supposed to be handled >> by target-specific back ends? I see something like that in, e.g., >> linux-nat.c and in inf-ttrace.c, but I'm unsure whether that is a >> conclusive evidence. >> >> If indeed thread deletion should be announced by the target, why this >> asymmetry with thread creation? >> >> TIA for any help or info. > > No one replied, so I'm now converting this into an RFA. The patch > below causes GDB on Windows to display thread exit messages like this: > > [Thread 5920.0x13e4 exited with code 0] > [Thread 5920.0x12d0 exited with code 0] > [Thread 5920.0x1cbc exited with code 0] > > OK to commit this (on the trunk)? > I just applied your patch, and the result GDB works fine. Great work! Yuanhui Zhang