From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 0D3B838F860E for ; Mon, 30 May 2022 10:12:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0D3B838F860E Received: by mail-wr1-x42c.google.com with SMTP id q21so2776006wra.2 for ; Mon, 30 May 2022 03:12:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=5vyHbG6QtHjd2OisVClrgILxwAAVYEixF7BrnwcLgJc=; b=IGeGbz23MpYz7SAHvQrP0P3zIB8i86GOXSwSxTgVKorW1DOxbTozukDQgup6P8BCpf MvNrBq9EmZGoHuAxNDFH2OM3dGj8xtW7Ixz7wSafGlQPRD4EjMTIzuGNRrNi6JdxzALy ciEi3soHLOUU7GSRsFq9yKC8vtr61RD2vmSuxjXmBfjL3JblDWd1448z2/VbVHLUIWJg ywTfbrk6RJyXt/cPkFmBwkG2FlmBNAPG0Gi7PjJ0tzXQcuIqD7EO9ucsklNXuLUZLjtU +qrUQZoE8/4xn6USD9DVBE7x0fOFFup63S3LyQMrCMBOzop6Xz5LZnaBaoBJgn3YWUpW kYlg== X-Gm-Message-State: AOAM531Slz0PdmSvdn+ha0mEt5h+59R90ZnpaseKslzCxi4YFWk042DJ JPg/SDxMH8r9TNN9gbzBFg== X-Google-Smtp-Source: ABdhPJzxP3XT7bfxsrlNnjTMn2XWLzoUUfgkH+Dmyel4kHo0EExowWQJD1bFXpr//mscelyYIynd5Q== X-Received: by 2002:adf:d186:0:b0:210:2f75:25f6 with SMTP id v6-20020adfd186000000b002102f7525f6mr5446646wrc.61.1653905576685; Mon, 30 May 2022 03:12:56 -0700 (PDT) Received: from [192.168.1.10] (83.11.64.124.ipv4.supernova.orange.pl. [83.11.64.124]) by smtp.gmail.com with ESMTPSA id l13-20020a5d6d8d000000b0020d0c37b350sm10741571wrs.27.2022.05.30.03.12.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 May 2022 03:12:56 -0700 (PDT) Message-ID: <82ae3346-cc0a-8fbd-481b-2ab4ef53bf87@gmail.com> Date: Mon, 30 May 2022 12:12:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v2 1/3] gdb/python doc: Add register_unwinder to code example Content-Language: en-US To: Andrew Burgess , Paulo Neves via Gdb-patches References: <20220528115509.3865342-1-ptsneves@gmail.com> <20220528132905.3886575-1-ptsneves@gmail.com> <87v8tne457.fsf@redhat.com> From: Paulo Neves In-Reply-To: <87v8tne457.fsf@redhat.com> X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Mon, 30 May 2022 10:13:00 -0000 Hello Andrew On 5/30/22 11:55, Andrew Burgess wrote: > Paulo Neves via Gdb-patches writes: > >> It is now clear in the example code that an unwinder needs to be >> registered to be used. >> --- >> gdb/doc/python.texi | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi >> index cb5283e03c0..5b7fba798a9 100644 >> --- a/gdb/doc/python.texi >> +++ b/gdb/doc/python.texi >> @@ -2814,6 +2814,8 @@ class MyUnwinder(Unwinder): >> # Return the result: >> return unwind_info >> >> +# To use an unwinder it needs to be registered and enabled. >> +gdb.unwinder.register_unwinder (, MyUnwinder, replace=) >> @end smallexample > I've had reason to read the unwinder example before, and I think it's > probably my most hated example in our manual. > > I absolutely hate that the example is not real, executable, EXAMPLE, > code, it's just seems like documentation in another form. I think the fact it was not executable was the reason that nobody noticed the import was wrong. > > That said, I think its not fair for me to require that your additions to > the existing example be executable, when the rest of the example is > not. But, if you _did_ want to improve this whole example, then I'd > certainly be in favour! When you mean you want it to be executable, does this mean i should to remove the meta-values like "" sprinkled in the code and replace them with comments? Also by real example do you want it to be functional? I am concerned an example that does any meaningful thing would be confusing. Something i looked at when trying to get my unwinder working was the gdb/testsuite/gdb.python/py-unwind.py test. It could be used but adds unrelated logic. > > I do however, this that with this addition, the example code is now in > the wrong place. Notice your example now makes use of > `register_unwinder`, but this method is not discussed in detail until > after the example code. > > I think that the whole subsection titled `Unwinder Skeleton Code` should > be moved later, probably to just before `@node Xmethods In Python`, that > is, right at the end of the section on unwinders. I can move the example to the last subsection. > > Thanks, > Andrew > >> >> @subheading Registering a Unwinder >> -- >> 2.25.1 I am interested in getting this section improved. Just give me the guidelines to the questions above and I will prepare the patches. Paulo Neves