From 7789c6f56ac0fdd38fb769d9c5bcf1a45f9b2590 Mon Sep 17 00:00:00 2001 From: Elena Zannoni Date: Tue, 14 Jan 2003 00:07:43 +0000 Subject: [PATCH] 2003-01-13 Elena Zannoni * 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 * mi-main.c (mi_cmd_exec_return): Use print_stack_frame instead of show_and_print_stack_frame. --- gdb/ChangeLog | 23 ++++++++ gdb/frame.h | 2 - gdb/infrun.c | 4 +- gdb/mi/ChangeLog | 5 ++ gdb/mi/mi-main.c | 8 +-- gdb/stack.c | 151 ++++------------------------------------------- gdb/thread.c | 4 +- 7 files changed, 49 insertions(+), 148 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index aaf648c2522..e3cc093f6ec 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,26 @@ +2003-01-13 Elena Zannoni + + * 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 Andrew Cagney * README (Graphical interface to GDB): Update URL. Point at diff --git a/gdb/frame.h b/gdb/frame.h index fbe62756abc..04dee94e680 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -546,8 +546,6 @@ extern void show_and_print_stack_frame (struct frame_info *fi, int level, extern void print_stack_frame (struct frame_info *, int, int); -extern void print_only_stack_frame (struct frame_info *, int, int); - extern void show_stack_frame (struct frame_info *); extern void print_frame_info (struct frame_info *, int, int, int); diff --git a/gdb/infrun.c b/gdb/infrun.c index 704e0338fb3..9f94aebf15a 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2,7 +2,7 @@ process. 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. @@ -3093,7 +3093,7 @@ normal_stop (void) LOCATION: Print only location SRC_AND_LOC: Print location and source line */ if (do_frame_printing) - show_and_print_stack_frame (deprecated_selected_frame, -1, source_flag); + print_stack_frame (deprecated_selected_frame, -1, source_flag); /* Display the auto-display expressions. */ do_displays (); diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 7bc2ce8c3e2..952006d4ccd 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,8 @@ +2003-01-13 Elena Zannoni + + * mi-main.c (mi_cmd_exec_return): Use print_stack_frame instead of + show_and_print_stack_frame. + 2003-01-09 Andrew Cagney * mi-cmd-env.c: Include "gdb_string.h" instead of . diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 536e8a5b054..96030b71ab6 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -1,5 +1,5 @@ /* MI Command Set. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Cygnus Solutions (a Red Hat company). This file is part of GDB. @@ -183,9 +183,9 @@ mi_cmd_exec_return (char *args, int from_tty) /* Because we have called return_command with from_tty = 0, we need to print the frame here. */ - show_and_print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), - LOC_AND_ADDRESS); + print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), + LOC_AND_ADDRESS); return MI_CMD_DONE; } diff --git a/gdb/stack.c b/gdb/stack.c index a3a55c2f161..a308261d818 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -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); - 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); + 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). - 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 diff --git a/gdb/thread.c b/gdb/thread.c index 6ef484078ef..f36def1f279 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -1,7 +1,7 @@ /* Multi-process/thread control for GDB, the GNU debugger. Copyright 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA. @@ -457,7 +457,7 @@ info_threads_command (char *arg, int from_tty) switch_to_thread (tp->ptid); if (deprecated_selected_frame) - print_only_stack_frame (deprecated_selected_frame, -1, 0); + print_stack_frame (deprecated_selected_frame, -1, 0); else printf_filtered ("[No stack.]\n"); } -- 2.30.2