From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7442 invoked by alias); 17 May 2019 13:08:42 -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 7411 invoked by uid 89); 17 May 2019 13:08:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 May 2019 13:08:38 +0000 Received: from [172.16.0.120] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 7FEE91E481; Fri, 17 May 2019 09:08:36 -0400 (EDT) Subject: Re: [PATCH] Add "thread-exited" annotation To: Amos Bird , Eli Zaretskii Cc: gbenson@redhat.com, gdb-patches@sourceware.org, tom@tromey.com References: <87d0l8pzdz.fsf@gmail.com> <87ef5j33au.fsf@tromey.com> <87ftpzo1wa.fsf@gmail.com> <20190516131419.GA29999@blade.nx> <87ftpepk1l.fsf@gmail.com> <83d0kicvs6.fsf@gnu.org> <87ef4ypif5.fsf@gmail.com> From: Simon Marchi Message-ID: <441e0b74-a391-2d68-e5d3-f43f1b8da188@simark.ca> Date: Fri, 17 May 2019 13:08:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <87ef4ypif5.fsf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-05/txt/msg00417.txt.bz2 Hi Amos, Some comments related to the format of arguments passed with the annotation: > + printf_filtered(("\n\032\032thread-exited," > + "id=\"%d\",group-id=\"i%d\"\n"), > + t->global_num, t->inf->num); Do we use this style of MI-like record anywhere else in the annotations interface? Other annotations that have extra info seem to just pass magic numbers after the annotation name, such as: printf_filtered (("\n\032\032frame-begin %d %s\n"), level, paddress (gdbarch, pc)); I don't mind if we start using MI-like syntax for annotation parameters, but it should be a conscious decision to do so. And if we ever add more annotations in the future, it should follow the same pattern. > diff --git a/gdb/doc/annotate.texinfo b/gdb/doc/annotate.texinfo > index b85b759f9a..fb7cbf7b77 100644 > --- a/gdb/doc/annotate.texinfo > +++ b/gdb/doc/annotate.texinfo > @@ -836,6 +836,11 @@ The selected thread has changed. This may occur at the request of the > user with the @code{thread} command, or as a result of execution, > e.g., another thread hits a breakpoint. > > +@findex thread-exited@r{, annotation} > +@item ^Z^Zthread-exited > + > +This annotation is issued once for each thread that exits. > + > @end table In any case, the documentation should describe the format and meaning of information passed with the annotation. > +proc thread_exit {} { > + gdb_test_multiple "call (void)pthread_exit()" "thread exit" { > + -re ".*\032\032thread-exited.*" { > + pass "thread exit" > + } > + } > +} Please enhance the regex to include the extra information, like (untested): -re ".*\032\032thread-exited,id=\"${decimal}\",group-id=\"i${decimal}\"" Simon