From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id o1ZZM+ThHGJWTQAAWB0awg (envelope-from ) for ; Mon, 28 Feb 2022 09:53:24 -0500 Received: by simark.ca (Postfix, from userid 112) id C18521F3C8; Mon, 28 Feb 2022 09:53:24 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 409241F0D2 for ; Mon, 28 Feb 2022 09:53:24 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8B3283858408 for ; Mon, 28 Feb 2022 14:53:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B3283858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1646060003; bh=SbUuUo0+G2Y7ajwkrfa7xSMuczfcpev0JUxB+tCCzW4=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=pQNCLcdN0QbPDiRrmhUO4zLrguFM0ZxVBUcYMxkrjREDsl3CjvgZSzpSkaOnqJk6F 1f1NmQbGdZjQos4dDQiA/eH53WrIsKqViM3YbOWrtf0LiSDtdDg7ail1dmGq2MOtOa 0madsD1yJm4fh5+HPpODSRnZi0GaWb+ddJxbLbSY= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id B790D3858C83 for ; Mon, 28 Feb 2022 14:53:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B790D3858C83 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 21SEqv5v021852 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Feb 2022 09:53:02 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 21SEqv5v021852 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 33B3F1F0D2; Mon, 28 Feb 2022 09:52:57 -0500 (EST) Message-ID: <5d7386a1-973f-9c56-d82c-a30f80c22523@polymtl.ca> Date: Mon, 28 Feb 2022 09:52:56 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCHv2] gdb/python: Add gdb.InferiorThread.details attribute Content-Language: en-US To: Andrew Burgess , Tom Tromey References: <20220215115233.56924-1-aburgess@redhat.com> <87fso6n3l5.fsf@tromey.com> <20220228113029.GA1212730@redhat.com> In-Reply-To: <20220228113029.GA1212730@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 28 Feb 2022 14:52:57 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2022-02-28 06:30, Andrew Burgess via Gdb-patches wrote: > * Tom Tromey [2022-02-25 12:33:42 -0700]: > >>>>>>> "Andrew" == Andrew Burgess via Gdb-patches writes: >> >> Andrew> As the string returned by target_extra_thread_info is unstructured, >> Andrew> this attribute is only really useful for echoing straight through to >> Andrew> the user, but, if a user wants to write a command that displays the >> Andrew> same, or a similar 'Thread Id' to the one seen in 'info threads', then >> Andrew> they need access to this string. >> >> It may be good to give a bit more information about this in the >> documentation. Like, describing what this is used for and maybe how it >> would appear on a Linux system. >> >> Andrew> + const char *extra_info = target_extra_thread_info (thread_obj->thread); >> >> If this can ever throw, it will break things here. > > Thanks for the feedback. In v2: > > - Improved the docs to given an example of what the string might > contain, and where GDB currently displays the string, and > > - Use try/catch and GDB_PY_HANDLE_EXCEPTION in py-infthread.c in > to handle any exceptions thrown from GDB core. > > Thanks, > Andrew > > --- > > gdb/python: Add gdb.InferiorThread.details attribute > > This adds a new read-only attribute gdb.InferiorThread.details, this > attribute contains a string, the results of target_extra_thread_info > for the thread, or None, if target_extra_thread_info returns nullptr. > > As the string returned by target_extra_thread_info is unstructured, > this attribute is only really useful for echoing straight through to > the user, but, if a user wants to write a command that displays the > same, or a similar 'Thread Id' to the one seen in 'info threads', then > they need access to this string. > > Given that the string produced by target_extra_thread_info varies by > target, there's only minimal testing of this attribute, I check that > the attribute can be accessed, and that the return value is either > None, or a string. This LGTM, thanks. Simon