]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/doc/python.texi
gdb/python: Add new gdb.unwinder.FrameId class
authorAndrew Burgess <aburgess@redhat.com>
Fri, 10 Mar 2023 12:29:58 +0000 (12:29 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Thu, 30 Mar 2023 09:25:46 +0000 (10:25 +0100)
commit3712e78cab09017bf59105d44e2f745c5e608c5a
tree9de28d89f3dca732b04cfbfd26f59b1f1503aa59
parent64826d05d3ccc487009312958de5d83752b2867a
gdb/python: Add new gdb.unwinder.FrameId class

When writing an unwinder it is necessary to create a new class to act
as a frame-id.  This new class is almost certainly just going to set a
'sp' and 'pc' attribute within the instance.

This commit adds a little helper class gdb.unwinder.FrameId that does
this job.  Users can make use of this to avoid having to write out
standard boilerplate code any time they write an unwinder.

Of course, if the user wants their FrameId class to be more
complicated in some way, then they can still write their own class,
just like they could before.

I've simplified the example code in the documentation to now use the
new helper class, and I've also made use of this helper within the
testsuite.

Any existing user code will continue to work just as it did before
after this change.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Reviewed-By: Tom Tromey <tom@tromey.com>
gdb/NEWS
gdb/doc/python.texi
gdb/python/lib/gdb/unwinder.py
gdb/testsuite/gdb.python/py-unwind.py