public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Paulo Neves <ptsneves@gmail.com>
To: Andrew Burgess <aburgess@redhat.com>,
	Paulo Neves via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2 1/3] gdb/python doc: Add register_unwinder to code example
Date: Mon, 30 May 2022 12:12:55 +0200	[thread overview]
Message-ID: <82ae3346-cc0a-8fbd-481b-2ab4ef53bf87@gmail.com> (raw)
In-Reply-To: <87v8tne457.fsf@redhat.com>

Hello Andrew

On 5/30/22 11:55, Andrew Burgess wrote:
> Paulo Neves via Gdb-patches<gdb-patches@sourceware.org>  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 (<locus>, MyUnwinder, replace=<True|False>)
>>   @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 "<SP number>" 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

  reply	other threads:[~2022-05-30 10:12 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-28 11:55 python unwinder doc improvement Paulo Neves
2022-05-28 11:55 ` [PATCH 1/2] gdb/python doc: Add register_unwinder to code example Paulo Neves
2022-05-28 12:20   ` Eli Zaretskii
2022-06-21 11:17     ` Paulo Neves
2022-06-21 12:19       ` Eli Zaretskii
2022-09-30 11:59         ` Paulo Neves
2022-09-30 12:25           ` Eli Zaretskii
2022-05-28 11:55 ` [PATCH 2/2] gdb/python doc: Add enable property to the unwinder example Paulo Neves
2022-05-28 12:22   ` Eli Zaretskii
2022-05-28 13:35     ` Paulo Neves
2022-05-28 13:29 ` [PATCH v2 1/3] gdb/python doc: Add register_unwinder to code example Paulo Neves
2022-05-28 13:29   ` [PATCH v2 2/3] gdb/python doc: Add enable property to the unwinder example Paulo Neves
2022-05-30  9:57     ` Andrew Burgess
2022-06-03 15:54       ` Paulo Neves
2022-05-28 13:29   ` [PATCH v2 3/3] gdb/python doc: Fix confusion between gdb.unwinders and gdb.unwinder Paulo Neves
2022-05-30  9:33     ` Andrew Burgess
2022-05-30  9:55   ` [PATCH v2 1/3] gdb/python doc: Add register_unwinder to code example Andrew Burgess
2022-05-30 10:12     ` Paulo Neves [this message]
2022-06-03 16:01 ` [PATCH v3 1/4] " Paulo Neves
2022-06-03 16:01   ` [PATCH v3 2/4] gdb/python doc: Add enable property to the unwinder example Paulo Neves
2022-06-03 16:17     ` Eli Zaretskii
2022-06-03 16:01   ` [PATCH v3 3/4] gdb/python doc: Fix confusion between gdb.unwinders and gdb.unwinder Paulo Neves
2022-06-03 16:17     ` Eli Zaretskii
2022-06-03 16:01   ` [PATCH v3 4/4] gdb/python doc: Move unwinder skeleton code Paulo Neves
2022-06-03 16:20     ` Eli Zaretskii
2022-06-03 16:38       ` Paulo Neves
2022-09-30 14:50       ` Pedro Alves
2022-09-30 15:53         ` Eli Zaretskii
2022-09-30 16:41           ` Pedro Alves
2022-09-30 17:37             ` Eli Zaretskii
2022-10-21 21:07               ` Pedro Alves
2022-10-22  6:41                 ` Paulo Neves
2022-10-22  6:41                   ` Paulo Neves
2022-06-03 16:17   ` [PATCH v3 1/4] gdb/python doc: Add register_unwinder to code example Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=82ae3346-cc0a-8fbd-481b-2ab4ef53bf87@gmail.com \
    --to=ptsneves@gmail.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).