void
print_stack_frame (struct frame_info *frame, int print_level,
- enum print_what print_what)
+ enum print_what print_what,
+ int set_current_sal)
{
volatile struct gdb_exception e;
{
int center = (print_what == SRC_LINE || print_what == SRC_AND_LOC);
- print_frame_info (frame, print_level, print_what, 1 /* print_args */);
- set_current_sal_from_frame (frame, center);
+ print_frame_info (frame, print_level, print_what, 1 /* print_args */,
+ set_current_sal);
+ if (set_current_sal)
+ set_current_sal_from_frame (frame, center);
}
}
void
print_frame_info (struct frame_info *frame, int print_level,
- enum print_what print_what, int print_args)
+ enum print_what print_what, int print_args,
+ int set_current_sal)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
struct symtab_and_line sal;
do_gdb_disassembly (get_frame_arch (frame), -1, sal.pc, sal.end);
}
- if (print_what != LOCATION)
+ if (set_current_sal)
{
CORE_ADDR pc;
hand, perhaps the code does or could be fixed to make sure
the frame->prev field gets set to NULL in that case). */
- print_frame_info (fi, 1, LOCATION, 1);
+ print_frame_info (fi, 1, LOCATION, 1, 0);
if (show_locals)
{
struct frame_id frame_id = get_frame_id (fi);
{
select_frame (frame);
if (frame)
- print_stack_frame (frame, 1, SRC_AND_LOC);
+ print_stack_frame (frame, 1, SRC_AND_LOC, 1);
}
\f
/* 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);
- print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
+ print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
}
/* The XDB Compatibility command to print the current frame. */
static void
current_frame_command (char *level_exp, int from_tty)
{
- print_stack_frame (get_selected_frame (_("No stack.")), 1, SRC_AND_LOC);
+ print_stack_frame (get_selected_frame (_("No stack.")), 1, SRC_AND_LOC, 1);
}
/* Select the frame up one or COUNT_EXP stack levels from the
up_command (char *count_exp, int from_tty)
{
up_silently_base (count_exp);
- print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
+ print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
}
/* Select the frame down one or COUNT_EXP stack levels from the previously
down_command (char *count_exp, int from_tty)
{
down_silently_base (count_exp);
- print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
+ print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
}
\f