From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id EFC4C3858D32 for ; Fri, 10 Mar 2023 15:37:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EFC4C3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paenw-0006b2-GB; Fri, 10 Mar 2023 10:37:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MgSrJ4tOpovwJSz7+aVzntEiyU+O2R9E7JEvWqq2yZg=; b=k8ioIr/+1OBh gyU1EdzXyjld51Kcxwc/qtP1xkDw0NOCNPLZ8jcCGf7kHMFB578iudX/yIGQesfdXc0SPjQGX3wce YxOTpQPEXyyvI4zdrhdValC3I0dLExtagtvFUf3Inolcs/E8jZZ+mKzgqxznUKBeCgbbBnsUzHARO Hof+baQuOmh6kvVFTiIn9Vluq0Q9fBPUhwdU1/Q9mE250/BszYcW1f4CmaOwe4SSZXJiVU+Mo/ztv oJUtSF/ssrKLuQRLlQEvv1M8v30N1BStQ5RspfRgwXWCxJk5zqQJCmW2MIhyQCZBeaqyWzjraABUW bx+XM+bOIXyUqhzpTx163Q==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paenv-00071n-Nm; Fri, 10 Mar 2023 10:37:12 -0500 Date: Fri, 10 Mar 2023 17:36:54 +0200 Message-Id: <831qlwzkh5.fsf@gnu.org> From: Eli Zaretskii To: Andrew Burgess Cc: gdb-patches@sourceware.org In-Reply-To: <3f0b625f18141d66fe610cf06bc82cd644c50751.1678460067.git.aburgess@redhat.com> (message from Andrew Burgess via Gdb-patches on Fri, 10 Mar 2023 14:55:27 +0000) Subject: Re: [PATCH 10/10] gdb/python: Add new gdb.unwinder.FrameId class References: <3f0b625f18141d66fe610cf06bc82cd644c50751.1678460067.git.aburgess@redhat.com> X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Cc: Andrew Burgess > Date: Fri, 10 Mar 2023 14:55:27 +0000 > From: Andrew Burgess via Gdb-patches > > When writing an unwinder it is necessary to create a new class to act > as a frame-id. This new class is almost certainly just going to set a > 'sp' and 'pc' attribute within the instance. > > This commit adds a little helper class gdb.unwinder.FrameId that does > this job. Users can make use of this to avoid having to write out > standard boilerplate code any time they write an unwinder. > > Of course, if the user wants their FrameId class to be more > complicated in some way, then they can still write their own class, > just like they could before. > > I've simplified the example code in the documentation to now use the > new helper class, and I've also made use of this helper within the > testsuite. > > Any existing user code will continue to work just as it did before > after this change. > --- > gdb/NEWS | 5 +++ > gdb/doc/python.texi | 49 ++++++++++++++++++++++----- > gdb/python/lib/gdb/unwinder.py | 26 ++++++++++++++ > gdb/testsuite/gdb.python/py-unwind.py | 16 +-------- > 4 files changed, 73 insertions(+), 23 deletions(-) Thanks. > diff --git a/gdb/NEWS b/gdb/NEWS > index c4f7de11c6e..c5aa256c1bd 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -134,6 +134,11 @@ show always-read-ctf > now use either an integer or a gdb.Value object for each of its > 'sp', 'pc', and 'special' attributes. > > + ** A new class gdb.unwinder.FrameId has been added. Instrances of ^^^^^^^^^^ A typo. > +A helper class is provided in the @code{gdb.unwinder} module that can > +be used to represent a frame-id > +(@pxref{gdb.unwinder.FrameId,,@code{gdb.unwinder.FrameId}}). ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Is this justified? does using the 3rd arg of @pxref produce a much better cross-reference, in both Info and printed formats? > +The @var{special} argument is optional, if specified it should be a ^ ^ Semi-colon there, and a comma missing after "if specified". Reviewed-By: Eli Zaretskii