Introduce frame_info_ptr smart pointer class
authorTom Tromey <tom@tromey.com>
Mon, 25 Jul 2022 17:06:34 +0000 (14:06 -0300)
committerBruno Larsen <blarsen@redhat.com>
Mon, 10 Oct 2022 09:57:10 +0000 (11:57 +0200)
commitba380b3e5162e89c4c81a73f4fb9fcbbbbe75e24
treef04bfa9e20db390811ba51e4a38a47655596c1f6
parenta0cbd6505e9590baddd27d2ce603103d6e77421a
Introduce frame_info_ptr smart pointer class

This adds frame_info_ptr, a smart pointer class.  Every instance of
the class is kept on an intrusive list.  When reinit_frame_cache is
called, the list is traversed and all the pointers are invalidated.
This should help catch the typical GDB bug of keeping a frame_info
pointer alive where a frame ID was needed instead.

Co-Authored-By: Bruno Larsen <blarsen@redhat.com>
Approved-by: Tom Tomey <tom@tromey.com>
gdb/frame-info.h [new file with mode: 0644]
gdb/frame.c
gdb/frame.h