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 5D3483858405 for ; Tue, 5 Apr 2022 12:04:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5D3483858405 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58020) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbhv7-00021O-Rw; Tue, 05 Apr 2022 08:04:25 -0400 Received: from [87.69.77.57] (port=1947 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 1nbhv7-0005Rn-AJ; Tue, 05 Apr 2022 08:04:25 -0400 Date: Tue, 05 Apr 2022 15:04:29 +0300 Message-Id: <83ee2benxu.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 Mon, 4 Apr 2022 23:19:57 +0100) Subject: Re: [PATCHv3 4/6] gdb/python: implement the print_insn extension language hook References: X-Spam-Status: No, score=2.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 05 Apr 2022 12:04:27 -0000 > Date: Mon, 4 Apr 2022 23:19:57 +0100 > From: Andrew Burgess via Gdb-patches > Cc: Andrew Burgess > > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -18,6 +18,40 @@ > This is the same format that GDB uses when printing address, symbol, > and offset information from the disassembler. > > + ** New Python API for wrapping GDB's disassembler: > + > + - gdb.disassembler.register_disassembler(DISASSEMBLER, ARCH). > + DISASSEMBLER is a sub-class of gdb.disassembler.Disassembler. > + ARCH is either None or a string containing a bfd architecture > + name. DISASSEMBLER is registered as a disassembler for > + architecture ARCH, or for all architectures if ARCH is None. > + The previous disassembler registered for ARCH is returned, this > + can be None if no previous disassembler was registered. > + > + - gdb.disassembler.Disassembler is the class from which all > + disassemblers should inherit. Its constructor takes a string, > + a name for the disassembler, which is currently only used is > + some debug output. ^^ A typo. > +Or, this function can return an object that represents the ^^^^^^^^^^^^^^^^^ It is better to say "Alternatively, this function ..." > +The required properties, which this class provides are: ^ A comma is missing there. > +@cindex disassembler in Python, global vs.@: specific > +@cindex search order for disassembler in Python > +@cindex look up of disassembler in Python > + > +@value{GDBN} only records a single disassembler for each architecture, There shouldn't be an empty line between the @cindex entries and the following text, so that the position recorded in the index is the beginning of the text, not a newline away. The documentation parts are approved, once those nits are fixed. Thanks.