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 653F63858CDA for ; Fri, 10 Mar 2023 15:32:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 653F63858CDA 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 1paejE-0005TP-Tg; Fri, 10 Mar 2023 10:32:20 -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=mTdDe6k2xtmRjboy9MoMUuHuOWY/20tfHskndsVV0oo=; b=QajuZEcwjr8W BX7kx3ppKEb5VLB7OnkJSqBa2NjU84zZKZsVuJACUwa1G9Yw+NXMYuBX3SCOMl29dacP0BQBd5ITZ RvyeZc8fzpxxvDMULgRaFlCtexYQuW3+klOLPjt8/JD9JCAtRWzTsb5U9LhkdLOPC3nD+rCVO6kIk bgvdRqNRM5cxr4f1/QSW+y1hb/2VTVxBZJjwTPtQlDW32OaAfrpmIIlDDqD+wspns3gb0B6gnXVxq zATCXfXkVFJtenoSppFKOzDOdVLP+0aefQw/0jbedYBX//E9Otf/oBdA1iB0qGcMRzcY4QfKYhE8E hFE6pOUs7nn6I0W/QaCvxw==; 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 1paejE-0007mL-5e; Fri, 10 Mar 2023 10:32:20 -0500 Date: Fri, 10 Mar 2023 17:32:03 +0200 Message-Id: <83356czkp8.fsf@gnu.org> From: Eli Zaretskii To: Andrew Burgess Cc: gdb-patches@sourceware.org In-Reply-To: (message from Andrew Burgess via Gdb-patches on Fri, 10 Mar 2023 14:55:19 +0000) Subject: Re: [PATCH 02/10] gdb/python: make the gdb.unwinder.Unwinder class more robust References: X-Spam-Status: No, score=-6.5 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,URI_LONG_REPEAT 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:19 +0000 > From: Andrew Burgess via Gdb-patches > > gdb/NEWS | 14 ++++ > gdb/doc/python.texi | 60 +++++++++++++++- > gdb/python/lib/gdb/unwinder.py | 23 ++++++- > gdb/testsuite/gdb.python/py-unwind.exp | 94 ++++++++++++++++++++++++-- > gdb/testsuite/gdb.python/py-unwind.py | 13 +++- > 5 files changed, 191 insertions(+), 13 deletions(-) Thanks. > diff --git a/gdb/NEWS b/gdb/NEWS > index c32ff92c98a..ed0f86e79ec 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -96,6 +96,20 @@ show always-read-ctf > without a thread restriction. The same is also true for the 'task' > field of an Ada task-specific breakpoint. > > +* Python API > + > + ** The gdb.unwinder.Unwinder.name attribute is now read-only. > + > + ** The name argument passed to gdb.unwinder.Unwinder.__init__ must > + now be of type 'str' otherwise a TypeError will be raised. > + > + ** The gdb.unwinder.Unwinder.enabled attribute can now only accept > + values of type 'bool'. Changing this attribute will now > + invalidate GDB's frame-cache, which means GDB will need to > + rebuild its frame-cache when next required - either with, or > + without the particular unwinder, depending on how 'enabled' was > + changed. > + > *** Changes in GDB 13 This part is OK. > +@deftp {class} gdb.unwinder.Unwinder > +The @code{Unwinder} class is a base class from which user created > +unwinders can derive, though it is not required that unwinders derive > +from this class, so long any user created unwinder has the required ^^^^^^^ "so long as", I believe. > +@defun gdb.unwinder.Unwinder.__init__(@var{name}) > +The @var{name} is a string used to identify this unwinder within some > +@value{GDBN} commands. What do you mean by "identify...within a command"? The "within" part confuses me. > +@defvar gdb.unwinder.enabled > +A modifiable attribute containing a boolean, when @code{True} the ^ A semi-colon there would be better, I think. Also, a comma after @code{True} is in order. > +unwinder is enabled, and will be used by @value{GDBN}. When > +@code{False} the unwinder has been disabled, and will not be used. Likewise, a comma after @code{False}. > +Here is an example of how and structure a user created unwinder: Something is amiss in this sentence. > +@subheading Managing Registered Unwinders > +@value{GDBN} defines 3 new commands to manage registered unwinders. Why "new"? And why say how many of them are there -- that is not future-proof. Reviewed-By: Eli Zaretskii