Re: [PATCH 3/5] gdb/python: add PendingFrame.level and Frame.level methods

Eli Zaretskii via Gdb-patches
2021-05-30T05:55:14Z

> From: Andrew Burgess <andrew.burgess@embecosm.com>
> Date: Sat, 29 May 2021 21:57:12 +0100
>
> Add new methods to the PendingFrame and Frame classes to obtain the
> stack frame level for each object.
>
> The use of 'level' as the method name is consistent with the existing
> attribute RecordFunctionSegment.level (though this is an attribute
> rather than a method).
>
> For Frame/PendingFrame I went with methods as these classes currently
> only use methods, including for simple data like architecture, so I
> want to be consistent with this interface.
>
> gdb/ChangeLog:
>
> * python/py-frame.c (frapy_level): New function.
> (frame_object_methods): Register 'level' method.
> * python/py-unwind.c (pending_framepy_level): New function.
> (pending_frame_object_methods): Register 'level' method.
>
> gdb/doc/ChangeLog:
>
> * python.texi (Unwinding Frames in Python): Mention
> PendingFrame.level.
> (Frames In Python): Mention Frame.level.
>
> gdb/testsuite/ChangeLog:
>
> * gdb.python/py-frame.exp: Add Frame.level tests.
> * gdb.python/py-pending-frame-level.c: New file.
> * gdb.python/py-pending-frame-level.exp: New file.
> * gdb.python/py-pending-frame-level.py: New file.

OK for the documentation part.

Thanks.