Re: [PATCH 2/2] gdb/python doc: Add enable property to the unwinder example

Paulo Neves via Gdb-patches
2022-05-28T13:36:03Z

On 5/28/22 14:22, Eli Zaretskii wrote:

>> Date: Sat, 28 May 2022 13:55:09 +0200
>> From: Paulo Neves via Gdb-patches<gdb-patches@sourceware.org>
>> Cc: Paulo Neves<ptsneves@gmail.com>
>>
>> The enable property is now also in the example code making it clear how
>> it is used and how it influences the operation of an unwinder.
>> ---
>> gdb/doc/python.texi | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
>> index 5b7fba798a9..cb148d9b0ea 100644
>> --- a/gdb/doc/python.texi
>> +++ b/gdb/doc/python.texi
>> @@ -2796,6 +2796,10 @@ class FrameId(object):
>> class MyUnwinder(Unwinder):
>> def __init__(....):
>> super(MyUnwinder, self).__init___(<expects unwinder name argument>)
>> + # If set to True the unwinder will be enabled.
>> + # If upon registration the enable property is True, the unwinder will be usable immediately.
> This last line is too long for an @example, please break it into two.
Done
>
>> + # gdb or code may change value.
>> + self.enabled = <True|False>
>>
>> def __call__(pending_frame):
>> if not <we recognize frame>:
> Other than that, this needs to be reviewed by someone who knows about
> programming unwinders in Python.
>
> Thanks.
Ok, I will be waiting then and ping according to the guidelines. I added
a 3rd patch that also corrects a mistake in the module name mentioned in
the example and doc.