(frame_relative_level): Declare.
* stack.c (frame_relative_level): New function.
(selected_frame_level): Document as deprecated.
(select_frame): Do not set the selected_frame_level.
* stack.c (frame_info, record_selected_frame): Update.
(frame_command, current_frame_command): Update.
(up_silently_base, up_command, down_silently_base): Update.
(down_command): Update.
* inflow.c (kill_command): Update.
* tracepoint.c (finish_tfind_command): Update.
* corelow.c (core_open): Update.
* thread.c (info_threads_command): Update.
(do_captured_thread_select): Update.
* infcmd.c (finish_command): Update.
* breakpoint.c (insert_breakpoints, do_enable_breakpoint): Update.
+2002-04-21 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.h (selected_frame_level): Document as deprecated.
+ (frame_relative_level): Declare.
+ * stack.c (frame_relative_level): New function.
+ (selected_frame_level): Document as deprecated.
+ (select_frame): Do not set the selected_frame_level.
+
+ * stack.c (frame_info, record_selected_frame): Update.
+ (frame_command, current_frame_command): Update.
+ (up_silently_base, up_command, down_silently_base): Update.
+ (down_command): Update.
+ * inflow.c (kill_command): Update.
+ * tracepoint.c (finish_tfind_command): Update.
+ * corelow.c (core_open): Update.
+ * thread.c (info_threads_command): Update.
+ (do_captured_thread_select): Update.
+ * infcmd.c (finish_command): Update.
+ * breakpoint.c (insert_breakpoints, do_enable_breakpoint): Update.
+
2002-04-21 Jason Thorpe <thorpej@wasabisystems.com>
* config/alpha/tm-fbsd.h (FRAME_CHAIN_VALID): Remove.
/* Save the current frame and level so we can restore it after
evaluating the watchpoint expression on its own frame. */
saved_frame = selected_frame;
- saved_level = selected_frame_level;
+ saved_level = frame_relative_level (selected_frame);
/* Determine if the watchpoint is within scope. */
if (b->exp_valid_block == NULL)
/* Restore the frame and level. */
if ((saved_frame != selected_frame) ||
- (saved_level != selected_frame_level))
+ (saved_level != frame_relative_level (selected_frame)))
select_frame (saved_frame, saved_level);
if (val)
}
save_selected_frame = selected_frame;
- save_selected_frame_level = selected_frame_level;
+ save_selected_frame_level = frame_relative_level (selected_frame);
select_frame (fr, -1);
}
/* Now, set up the frame cache, and print the top of stack. */
flush_cached_frames ();
select_frame (get_current_frame (), 0);
- print_stack_frame (selected_frame, selected_frame_level, 1);
+ print_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 1);
}
else
{
#define FRAME_FP(fi) ((fi)->frame)
+/* Level of the frame: 0 for innermost, 1 for its caller, ...; or -1
+ for an invalid frame. */
+
+extern int frame_relative_level (struct frame_info *fi);
+
/* Define a default FRAME_CHAIN_VALID, in the form that is suitable for most
targets. If FRAME_CHAIN_VALID returns zero it means that the given frame
is the outermost one and has no caller.
0 for innermost, 1 for its caller, ...
or -1 for frame specified by address with no defined level. */
-extern int selected_frame_level;
+/* FIXME: cagney/2002-04-21: The variable `selected_frame_level' is
+ deprecated. It will dissapear `real soon now'. */
+
+extern int selected_frame_level; /* DEPRECATED */
extern struct frame_info *create_new_frame (CORE_ADDR, CORE_ADDR);
if (from_tty)
{
printf_filtered ("Run till exit from ");
- print_stack_frame (selected_frame, selected_frame_level, 0);
+ print_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 0);
}
/* If running asynchronously and the target support asynchronous
if (selected_frame == NULL)
fputs_filtered ("No selected stack frame.\n", gdb_stdout);
else
- print_stack_frame (selected_frame, selected_frame_level, 1);
+ print_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 1);
}
}
\f
+2002-04-14 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (mi_cmd_exec_return):
+
2002-04-09 Andrew Cagney <ac131313@redhat.com>
* mi-main.c (register_changed_p): Use frame_register_read instead
/* Because we have called return_command with from_tty = 0, we need
to print the frame here. */
show_and_print_stack_frame (selected_frame,
- selected_frame_level,
+ frame_relative_level (selected_frame),
LOC_AND_ADDRESS);
return MI_CMD_DONE;
0 for innermost, 1 for its caller, ...
or -1 for frame specified by address with no defined level. */
-int selected_frame_level;
+/* FIXME: cagney/2002-04-21: The variable `selected_frame_level' is
+ deprecated. It will dissapear `real soon now'. */
+
+int selected_frame_level; /* DEPRECATED */
+
+/* Level of the selected frame: 0 for innermost, 1 for its caller, ...
+ or -1 for NULL frame. */
+
+int
+frame_relative_level (struct frame_info *fi)
+{
+ if (fi == NULL)
+ return -1;
+ else
+ return fi->level;
+}
/* Zero means do things normally; we are interacting directly with the
user. One means print the full filename and linenumber when a
}
calling_frame_info = get_prev_frame (fi);
- if (!addr_exp && selected_frame_level >= 0)
+ if (!addr_exp && frame_relative_level (selected_frame) >= 0)
{
- printf_filtered ("Stack level %d, frame at ", selected_frame_level);
+ printf_filtered ("Stack level %d, frame at ",
+ frame_relative_level (selected_frame));
print_address_numeric (fi->frame, 1, gdb_stdout);
printf_filtered (":\n");
}
register struct symtab *s;
selected_frame = fi;
- selected_frame_level = level;
+ /* FIXME: cagney/2002-04-21: The variable `selected_frame_level' is
+ deprecated. It will dissapear `real soon now'. */
+ selected_frame_level = level; /* DEPRECATED */
/* FIXME: cagney/2002-04-05: It can't be this easy (and looking at
the increasingly complex list of checkes, it wasn't)! GDB is
dragging around, and constantly updating, the global variable
record_selected_frame (CORE_ADDR *frameaddrp, int *levelp)
{
*frameaddrp = selected_frame ? selected_frame->frame : 0;
- *levelp = selected_frame_level;
+ *levelp = frame_relative_level (selected_frame);
}
/* Return the symbol-block in which the selected frame is executing.
frame_command (char *level_exp, int from_tty)
{
select_frame_command (level_exp, from_tty);
- show_and_print_stack_frame (selected_frame, selected_frame_level, 1);
+ show_and_print_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 1);
}
/* The XDB Compatibility command to print the current frame. */
{
if (target_has_stack == 0 || selected_frame == 0)
error ("No stack.");
- print_only_stack_frame (selected_frame, selected_frame_level, 1);
+ print_only_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 1);
}
/* Select the frame up one or COUNT stack levels
fi = find_relative_frame (selected_frame, &count1);
if (count1 != 0 && count_exp == 0)
error ("Initial frame selected; you cannot go up.");
- select_frame (fi, selected_frame_level + count - count1);
+ select_frame (fi, frame_relative_level (selected_frame) + count - count1);
}
static void
up_command (char *count_exp, int from_tty)
{
up_silently_base (count_exp);
- show_and_print_stack_frame (selected_frame, selected_frame_level, 1);
+ show_and_print_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 1);
}
/* Select the frame down one or COUNT stack levels
error ("Bottom (i.e., innermost) frame selected; you cannot go down.");
}
- select_frame (frame, selected_frame_level + count - count1);
+ select_frame (frame, frame_relative_level (selected_frame) + count - count1);
}
/* ARGSUSED */
down_command (char *count_exp, int from_tty)
{
down_silently_base (count_exp);
- show_and_print_stack_frame (selected_frame, selected_frame_level, 1);
+ show_and_print_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 1);
}
\f
void
struct thread_info *tp;
ptid_t current_ptid;
struct frame_info *cur_frame;
- int saved_frame_level = selected_frame_level;
+ int saved_frame_level = frame_relative_level (selected_frame);
int counter;
char *extra_info;
#endif
ui_out_text (uiout, ")]");
- print_stack_frame (selected_frame, selected_frame_level, 1);
+ print_stack_frame (selected_frame, frame_relative_level (selected_frame), 1);
return GDB_RC_OK;
}
else
source_only = 1;
- print_stack_frame (selected_frame, selected_frame_level, source_only);
+ print_stack_frame (selected_frame, frame_relative_level (selected_frame),
+ source_only);
do_displays ();
}
}