/* See frame-info-ptr.h. */
-void
-frame_info_ptr::prepare_reinflate ()
+frame_info_ptr::frame_info_ptr (struct frame_info *ptr)
+ : m_ptr (ptr)
{
- m_cached_level = frame_relative_level (*this);
+ frame_list.push_back (*this);
+
+ if (m_ptr == nullptr)
+ return;
+
+ m_cached_level = ptr->level;
- if (m_cached_level != 0
- || (m_ptr != nullptr && m_ptr->this_id.value.user_created_p))
- m_cached_id = get_frame_id (*this);
+ if (m_cached_level != 0 || m_ptr->this_id.value.user_created_p)
+ m_cached_id = m_ptr->this_id.value;
}
/* See frame-info-ptr.h. */
void
frame_info_ptr::reinflate ()
{
- /* Ensure we have a valid frame level (sentinel frame or above), indicating
- prepare_reinflate was called. */
+ /* Ensure we have a valid frame level (sentinel frame or above). */
gdb_assert (m_cached_level >= -1);
if (m_ptr != nullptr)
{
public:
/* Create a frame_info_ptr from a raw pointer. */
- explicit frame_info_ptr (struct frame_info *ptr)
- : m_ptr (ptr)
- {
- frame_list.push_back (*this);
- }
+ explicit frame_info_ptr (struct frame_info *ptr);
/* Create a null frame_info_ptr. */
frame_info_ptr ()
m_ptr = nullptr;
}
- /* Cache the frame_id that the pointer will use to reinflate. */
- void prepare_reinflate ();
-
/* Use the cached frame_id to reinflate the pointer. */
void reinflate ();
bool stack_temporaries = thread_stack_temporaries_enabled_p (call_thread.get ());
frame = get_current_frame ();
- frame.prepare_reinflate ();
gdbarch = get_frame_arch (frame);
if (!gdbarch_push_dummy_call_p (gdbarch))
frame = get_prev_frame (get_selected_frame (_("No selected frame.")));
if (frame == 0)
error (_("\"finish\" not meaningful in the outermost frame."));
- frame.prepare_reinflate ();
clear_proceed_status (0);
i++, fi = get_prev_frame (fi))
{
QUIT;
- fi.prepare_reinflate ();
/* Print the location and the address always, even for level 0.
If args is 0, don't print the arguments. */
print_frame_info (user_frame_print_options,
if (current_uiout->is_mi_like_p ())
print_what = LOC_AND_ADDRESS;
- frame.prepare_reinflate ();
try
{
print_frame_info (user_frame_print_options,
= (print_names
&& fp_opts.print_frame_arguments != print_frame_arguments_none);
- /* If one of the arguments has a pretty printer that calls a
- function of the inferior to print it, the pointer must be
- reinflatable. */
- frame.prepare_reinflate ();
-
/* Temporarily change the selected frame to the given FRAME.
This allows routines that rely on the selected frame instead
of being given a frame as parameter to use the correct frame. */
int location_print;
struct ui_out *uiout = current_uiout;
- frame.prepare_reinflate ();
-
if (!current_uiout->is_mi_like_p ()
&& fp_opts.print_frame_info != print_frame_info_auto)
{
gdb_printf (" %d args: ", numargs);
}
- fi.prepare_reinflate ();
print_frame_args (user_frame_print_options,
func, fi, numargs, gdb_stdout);
fi.reinflate ();
for (fi = trailing; fi && count--; fi = get_prev_frame (fi))
{
QUIT;
- fi.prepare_reinflate ();
/* Don't use print_stack_frame; if an error() occurs it probably
means further attempts to backtrace would fail (on the other
{
validate_user_created_frame (get_frame_id (frame));
- frame.prepare_reinflate ();
reinit_frame_cache ();
frame.reinflate ();
/* Pass the frame to a callee, which calls reinit_frame_cache. This lets us
validate that the reinflation in both the callee and caller restore the
same frame_info object. */
- frame.prepare_reinflate ();
frame_info_ptr callees_frame_info = user_created_frame_callee (frame);
frame.reinflate ();