gdb: make frame_info_ptr auto-reinflatable
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 14 Dec 2022 03:34:41 +0000 (22:34 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 20 Jan 2023 19:48:57 +0000 (14:48 -0500)
commit908de5e67156068f3da74c60dea6f360246a3d0b
tree2f8e8934f1212a0c69d30010270499dc3f9bcac4
parent93e39555dd0fcd222ce68fc7162f511056361bc7
gdb: make frame_info_ptr auto-reinflatable

This is the second step of making frame_info_ptr automatic, reinflate on
demand whenever trying to obtain the wrapper frame_info pointer, either
through the get method or operator->.  Make the reinflate method
private, it is used as a convenience method in those two.

Add an "is_null" method, because it is often needed to know whether the
frame_info_ptr wraps an frame_info or is empty.

Make m_ptr mutable, so that it's possible to reinflate const
frame_info_ptr objects.  Whether m_ptr is nullptr or not does not change
the logical state of the object, because we re-create it on demand.  I
believe this is the right use case for mutable.

Change-Id: Icb0552d0035e227f81eb3c121d8a9bb2f9d25794
Reviewed-By: Bruno Larsen <blarsen@redhat.com>
gdb/frame.c
gdb/frame.h
gdb/infcall.c
gdb/infcmd.c
gdb/mi/mi-cmd-stack.c
gdb/stack.c
gdb/unittests/frame_info_ptr-selftests.c