From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8863 invoked by alias); 29 Apr 2013 15:23:30 -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 8852 invoked by uid 89); 29 Apr 2013 15:23:29 -0000 X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_NIX_SPAM,SPF_SOFTFAIL autolearn=no version=3.3.1 Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 29 Apr 2013 15:23:29 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MM000800W028D00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Mon, 29 Apr 2013 18:23:26 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MM0008YRW312050@a-mtaout20.012.net.il>; Mon, 29 Apr 2013 18:23:26 +0300 (IDT) Date: Mon, 29 Apr 2013 20:27:00 -0000 From: Eli Zaretskii Subject: Re: [RFA] Thread exit messages on MS-Windows In-reply-to: <20130429102100.GY3525@adacore.com> To: Joel Brobecker Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83ppxdqs2i.fsf@gnu.org> References: <83obd1tyi7.fsf@gnu.org> <838v44tnf8.fsf@gnu.org> <20130429102100.GY3525@adacore.com> X-SW-Source: 2013-04/txt/msg00873.txt.bz2 > Date: Mon, 29 Apr 2013 14:21:00 +0400 > From: Joel Brobecker > Cc: gdb-patches@sourceware.org > > > 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] > > > 2013-04-27 Eli Zaretskii > > > > * windows-nat.c (windows_delete_thread): Accept an additional > > argument, the thread's exit code, and announce thread death when > > print_thread_events is non-zero and we are deleting a thread that > > is not the main thread. > > (get_windows_debug_event): Pass thread exit code to > > windows_delete_thread. > > Looks good to me, modulo the comments already made. I know what to do with Corinna's comment, but not what to decide about announcing the death of the main thread. Do you have an opinion? > It's a little unusual to see an exit code for a thread, but it could > be useful information, and it does not unnecessarily clutter the > output. My reading of the code is that you already see that in linux-native debugging, see linux-nat.c. > > @@ -1513,7 +1517,7 @@ get_windows_debug_event (struct target_o > > current_process_handle = current_event.u.CreateProcessInfo.hProcess; > > if (main_thread_id) > > windows_delete_thread (ptid_build (current_event.dwProcessId, 0, > > - main_thread_id)); > > + main_thread_id), 0); > > One tiny nitpick, very possibly influenced by personal preferences, > so feel free to ignore... I think that the code would be faster > to read if the added parameter was moved to the next line. That way, > all parameters in call to windows_delete_thread would have the same > indentation level. I'm surprised, but I don't mind, and will do that, too.