2003-01-13 Elena Zannoni <ezannoni@redhat.com>

* stack.c (print_frame_info, print_stack_frame_base_stub,
	print_stack_frame_base, show_and_print_stack_frame_stub,
	show_and_print_stack_frame, print_only_stack_frame_stub,
	print_only_stack_frame): Delete functions.
	(print_stack_frame_stub): Call print_frame_info instead of
	print_frame_info_base.
	(print_frame_info_base): Rename to print_frame_info.
	(backtrace_command_1): Call print_frame_info, instead of
	print_frame_info_base.
	(current_frame_command): Call print_stack_frame, instead of
	print_only_stack_frame.
	(frame_command): Call print_stack_frame, instead of
	show_and_print_stack_frame.
	(up_command): Ditto.
	(down_command): Ditto.
	* frame.h (print_only_stack_frame): Delete prototype.
	* infrun.c (normal_stop): Call print_stack_frame, instead of
	show_and_print_stack_frame.
	* thread.c (info_threads_command): Call print_stack_frame, instead
	of print_only_stack_frame.

2003-01-13  Elena Zannoni  <ezannoni@redhat.com>

	* mi-main.c (mi_cmd_exec_return): Use print_stack_frame instead of
	show_and_print_stack_frame.
This commit is contained in:
Elena Zannoni
2003-01-14 00:07:43 +00:00
parent 2a20538510
commit 7789c6f56a
7 changed files with 49 additions and 148 deletions

View File

@@ -1,7 +1,7 @@
/* Print and select stack frames for GDB, the GNU debugger.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
Foundation, Inc.
This file is part of GDB.
@@ -98,10 +98,6 @@ static void print_frame (struct frame_info *fi,
int args,
struct symtab_and_line sal);
static void print_frame_info_base (struct frame_info *, int, int, int);
static void print_stack_frame_base (struct frame_info *, int, int);
static void backtrace_command (char *, int);
struct frame_info *parse_frame_specification (char *);
@@ -127,21 +123,6 @@ struct print_stack_frame_args
int args;
};
static int print_stack_frame_base_stub (char *);
/* Show and print the frame arguments.
Pass the args the way catch_errors wants them. */
static int show_and_print_stack_frame_stub (void *args);
static int
show_and_print_stack_frame_stub (void *args)
{
struct print_stack_frame_args *p = (struct print_stack_frame_args *) args;
print_frame_info (p->fi, p->level, p->source, p->args);
return 0;
}
/* Show or print the frame arguments.
Pass the args the way catch_errors wants them. */
static int print_stack_frame_stub (void *args);
@@ -150,83 +131,10 @@ print_stack_frame_stub (void *args)
{
struct print_stack_frame_args *p = (struct print_stack_frame_args *) args;
print_frame_info_base (p->fi, p->level, p->source, p->args);
print_frame_info (p->fi, p->level, p->source, p->args);
return 0;
}
/* Print a stack frame briefly. FRAME_INFI should be the frame info
and LEVEL should be its level in the stack (or -1 for level not
defined). */
/* Pass the args the way catch_errors wants them. */
static int
print_stack_frame_base_stub (char *args)
{
struct print_stack_frame_args *p = (struct print_stack_frame_args *) args;
print_frame_info_base (p->fi, p->level, p->source, p->args);
return 0;
}
/* print the frame arguments to the terminal.
Pass the args the way catch_errors wants them. */
static int print_only_stack_frame_stub (void *);
static int
print_only_stack_frame_stub (void *args)
{
struct print_stack_frame_args *p = (struct print_stack_frame_args *) args;
print_frame_info_base (p->fi, p->level, p->source, p->args);
return 0;
}
/* Print a stack frame briefly. FRAME_INFI should be the frame info
and LEVEL should be its level in the stack (or -1 for level not defined).
This prints the level, the function executing, the arguments,
and the file name and line number.
If the pc is not at the beginning of the source line,
the actual pc is printed at the beginning.
If SOURCE is 1, print the source line as well.
If SOURCE is -1, print ONLY the source line. */
static void
print_stack_frame_base (struct frame_info *fi, int level, int source)
{
struct print_stack_frame_args args;
args.fi = fi;
args.level = level;
args.source = source;
args.args = 1;
catch_errors (print_stack_frame_stub, &args, "", RETURN_MASK_ALL);
}
/* Show and print a stack frame briefly. FRAME_INFI should be the frame info
and LEVEL should be its level in the stack (or -1 for level not defined).
This prints the level, the function executing, the arguments,
and the file name and line number.
If the pc is not at the beginning of the source line,
the actual pc is printed at the beginning.
If SOURCE is 1, print the source line as well.
If SOURCE is -1, print ONLY the source line. */
void
show_and_print_stack_frame (struct frame_info *fi, int level, int source)
{
struct print_stack_frame_args args;
args.fi = fi;
args.level = level;
args.source = source;
args.args = 1;
catch_errors (show_and_print_stack_frame_stub, &args, "", RETURN_MASK_ALL);
}
/* Show or print a stack frame briefly. FRAME_INFI should be the frame info
and LEVEL should be its level in the stack (or -1 for level not defined).
This prints the level, the function executing, the arguments,
@@ -248,30 +156,7 @@ print_stack_frame (struct frame_info *fi, int level, int source)
args.args = 1;
catch_errors (print_stack_frame_stub, (char *) &args, "", RETURN_MASK_ALL);
}
/* Print a stack frame briefly. FRAME_INFI should be the frame info
and LEVEL should be its level in the stack (or -1 for level not defined).
This prints the level, the function executing, the arguments,
and the file name and line number.
If the pc is not at the beginning of the source line,
the actual pc is printed at the beginning.
If SOURCE is 1, print the source line as well.
If SOURCE is -1, print ONLY the source line. */
void
print_only_stack_frame (struct frame_info *fi, int level, int source)
{
struct print_stack_frame_args args;
args.fi = fi;
args.level = level;
args.source = source;
args.args = 1;
catch_errors (print_only_stack_frame_stub, &args, "", RETURN_MASK_ALL);
}
}
struct print_args_args
{
@@ -305,8 +190,8 @@ print_args_stub (PTR args)
LOCATION: Print only location
LOC_AND_SRC: Print location and source line. */
static void
print_frame_info_base (struct frame_info *fi, int level, int source, int args)
void
print_frame_info (struct frame_info *fi, int level, int source, int args)
{
struct symtab_and_line sal;
int source_print;
@@ -581,16 +466,6 @@ print_frame (struct frame_info *fi,
do_cleanups (old_chain);
}
/* Show or print the frame info. If this is the tui, it will be shown in
the source display */
void
print_frame_info (struct frame_info *fi, register int level, int source,
int args)
{
print_frame_info_base (fi, level, source, args);
}
/* Show the frame info. If this is the tui, it will be shown in
the source display otherwise, nothing is done */
void
@@ -1099,7 +974,7 @@ backtrace_command_1 (char *count_exp, int show_locals, int from_tty)
means further attempts to backtrace would fail (on the other
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_base (fi, trailing_level + i, 0, 1);
print_frame_info (fi, trailing_level + i, 0, 1);
if (show_locals)
print_frame_local_vars (fi, 1, gdb_stdout);
}
@@ -1599,8 +1474,8 @@ void
frame_command (char *level_exp, int from_tty)
{
select_frame_command (level_exp, from_tty);
show_and_print_stack_frame (deprecated_selected_frame,
frame_relative_level (deprecated_selected_frame), 1);
print_stack_frame (deprecated_selected_frame,
frame_relative_level (deprecated_selected_frame), 1);
}
/* The XDB Compatibility command to print the current frame. */
@@ -1610,7 +1485,7 @@ current_frame_command (char *level_exp, int from_tty)
{
if (target_has_stack == 0 || deprecated_selected_frame == 0)
error ("No stack.");
print_only_stack_frame (deprecated_selected_frame,
print_stack_frame (deprecated_selected_frame,
frame_relative_level (deprecated_selected_frame), 1);
}
@@ -1647,8 +1522,8 @@ static void
up_command (char *count_exp, int from_tty)
{
up_silently_base (count_exp);
show_and_print_stack_frame (deprecated_selected_frame,
frame_relative_level (deprecated_selected_frame), 1);
print_stack_frame (deprecated_selected_frame,
frame_relative_level (deprecated_selected_frame), 1);
}
/* Select the frame down one or COUNT stack levels
@@ -1694,8 +1569,8 @@ static void
down_command (char *count_exp, int from_tty)
{
down_silently_base (count_exp);
show_and_print_stack_frame (deprecated_selected_frame,
frame_relative_level (deprecated_selected_frame), 1);
print_stack_frame (deprecated_selected_frame,
frame_relative_level (deprecated_selected_frame), 1);
}
void