diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2022-12-13 22:34:41 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-01-20 14:48:57 -0500 |
commit | 908de5e67156068f3da74c60dea6f360246a3d0b (patch) | |
tree | 2f8e8934f1212a0c69d30010270499dc3f9bcac4 /gdb/unittests | |
parent | 93e39555dd0fcd222ce68fc7162f511056361bc7 (diff) | |
download | binutils-908de5e67156068f3da74c60dea6f360246a3d0b.zip binutils-908de5e67156068f3da74c60dea6f360246a3d0b.tar.gz binutils-908de5e67156068f3da74c60dea6f360246a3d0b.tar.bz2 |
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>
Diffstat (limited to 'gdb/unittests')
-rw-r--r-- | gdb/unittests/frame_info_ptr-selftests.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/gdb/unittests/frame_info_ptr-selftests.c b/gdb/unittests/frame_info_ptr-selftests.c index 4730611..fe1e7be 100644 --- a/gdb/unittests/frame_info_ptr-selftests.c +++ b/gdb/unittests/frame_info_ptr-selftests.c @@ -41,7 +41,6 @@ user_created_frame_callee (frame_info_ptr frame) validate_user_created_frame (get_frame_id (frame)); reinit_frame_cache (); - frame.reinflate (); validate_user_created_frame (get_frame_id (frame)); @@ -61,7 +60,6 @@ test_user_created_frame () validate that the reinflation in both the callee and caller restore the same frame_info object. */ frame_info_ptr callees_frame_info = user_created_frame_callee (frame); - frame.reinflate (); validate_user_created_frame (get_frame_id (frame)); SELF_CHECK (frame.get () == callees_frame_info.get ()); |