aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2022-12-13 22:34:41 -0500
committerSimon Marchi <simon.marchi@efficios.com>2023-01-20 14:48:57 -0500
commit908de5e67156068f3da74c60dea6f360246a3d0b (patch)
tree2f8e8934f1212a0c69d30010270499dc3f9bcac4 /gdb/stack.c
parent93e39555dd0fcd222ce68fc7162f511056361bc7 (diff)
downloadgdb-908de5e67156068f3da74c60dea6f360246a3d0b.zip
gdb-908de5e67156068f3da74c60dea6f360246a3d0b.tar.gz
gdb-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/stack.c')
-rw-r--r--gdb/stack.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index 4250383..c36f144 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -367,7 +367,6 @@ print_stack_frame (frame_info_ptr frame, int print_level,
print_frame_info (user_frame_print_options,
frame, print_level, print_what, 1 /* print_args */,
set_current_sal);
- frame.reinflate ();
if (set_current_sal)
set_current_sal_from_frame (frame);
}
@@ -903,7 +902,6 @@ print_frame_args (const frame_print_options &fp_opts,
}
first = 0;
- frame.reinflate ();
}
}
@@ -1173,7 +1171,6 @@ print_frame_info (const frame_print_options &fp_opts,
print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
}
- frame.reinflate ();
/* If disassemble-next-line is set to on and there is line debug
messages, output assembly codes for next line. */
@@ -1676,8 +1673,6 @@ info_frame_command_core (frame_info_ptr fi, bool selected_frame_p)
print_frame_args (user_frame_print_options,
func, fi, numargs, gdb_stdout);
- fi.reinflate ();
-
gdb_puts ("\n");
}
}
@@ -2077,7 +2072,6 @@ backtrace_command_1 (const frame_print_options &fp_opts,
print_frame_local_vars (fi, false, NULL, NULL, 1, gdb_stdout);
/* Save the last frame to check for error conditions. */
- fi.reinflate ();
trailing = fi;
}