/* Flag to control debugging. */
-unsigned int frame_debug;
+bool frame_debug;
+
static void
show_frame_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
static void
compute_frame_id (struct frame_info *fi)
{
+ FRAME_SCOPED_DEBUG_ENTER_EXIT;
+
gdb_assert (fi->this_id.p == frame_id_status::NOT_COMPUTED);
unsigned int entry_generation = get_frame_cache_generation ();
static struct frame_info *
get_prev_frame_always_1 (struct frame_info *this_frame)
{
- struct gdbarch *gdbarch;
+ FRAME_SCOPED_DEBUG_ENTER_EXIT;
gdb_assert (this_frame != NULL);
- gdbarch = get_frame_arch (this_frame);
if (frame_debug)
{
frame_debug_printf ("%s", debug_file.c_str ());
}
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
+
/* Only try to do the unwind once. */
if (this_frame->prev_p)
{
struct frame_info *
get_prev_frame (struct frame_info *this_frame)
{
+ FRAME_SCOPED_DEBUG_ENTER_EXIT;
+
CORE_ADDR frame_pc;
int frame_pc_p;
set_backtrace_option_defs, &set_backtrace_cmdlist, &show_backtrace_cmdlist);
/* Debug this files internals. */
- add_setshow_zuinteger_cmd ("frame", class_maintenance, &frame_debug, _("\
+ add_setshow_boolean_cmd ("frame", class_maintenance, &frame_debug, _("\
Set frame debugging."), _("\
Show frame debugging."), _("\
When non-zero, frame specific internal debugging is enabled."),
- NULL,
- show_frame_debug,
- &setdebuglist, &showdebuglist);
+ NULL,
+ show_frame_debug,
+ &setdebuglist, &showdebuglist);
}
#include "language.h"
#include "cli/cli-option.h"
+#include "gdbsupport/common-debug.h"
struct symtab_and_line;
struct frame_unwind;
/* Flag to control debugging. */
-extern unsigned int frame_debug;
+extern bool frame_debug;
/* Print a "frame" debug statement. */
#define frame_debug_printf(fmt, ...) \
debug_prefixed_printf_cond (frame_debug, "frame", fmt, ##__VA_ARGS__)
+#define FRAME_SCOPED_DEBUG_ENTER_EXIT \
+ scoped_debug_enter_exit (frame_debug, "frame")
+
/* Construct a frame ID. The first parameter is the frame's constant
stack address (typically the outer-bound), and the second the
frame's constant code address (typically the entry point).