This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Remove level param from select_and_print_frame()
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 04 May 2002 22:27:19 -0400
- Subject: [patch] Remove level param from select_and_print_frame()
Remove another level param that isn't used.
I should note that after this one, things start to get hard. Some code
has overloaded level==-1 as a way of indicating that the print frame
code shouldn't print the level when printing the frame - even when frame
is valid :-/
committed,
Andrew
2002-05-04 Andrew Cagney <ac131313@redhat.com>
* stack.c (select_and_print_frame): Make static. Delete the
parameter `level'.
(func_command): Update call.
(select_frame_command): Delete code computing the frame level.
* frame.h (select_and_print_frame): Delete declaration.
Index: frame.h
===================================================================
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.16
diff -u -r1.16 frame.h
--- frame.h 5 May 2002 01:15:13 -0000 1.16
+++ frame.h 5 May 2002 02:23:09 -0000
@@ -248,8 +248,6 @@
extern void record_selected_frame (CORE_ADDR *, int *);
-extern void select_and_print_frame (struct frame_info *, int);
-
extern void print_frame_info (struct frame_info *, int, int, int);
extern void show_frame_info (struct frame_info *, int, int, int);
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.36
diff -u -r1.36 stack.c
--- stack.c 5 May 2002 01:15:13 -0000 1.36
+++ stack.c 5 May 2002 02:23:11 -0000
@@ -1490,13 +1490,13 @@
/* Select frame FI. Also print the stack frame and show the source if
this is the tui version. */
-void
-select_and_print_frame (struct frame_info *fi, int level)
+static void
+select_and_print_frame (struct frame_info *fi)
{
select_frame (fi);
if (fi)
{
- print_stack_frame (fi, level, 1);
+ print_stack_frame (fi, frame_relative_level (fi), 1);
}
}
@@ -1594,20 +1594,6 @@
frame = parse_frame_specification (level_exp);
- /* Try to figure out what level this frame is. But if there is
- no current stack, don't error out -- let the user set one. */
- frame1 = 0;
- if (get_current_frame ())
- {
- for (frame1 = get_prev_frame (0);
- frame1 && frame1 != frame;
- frame1 = get_prev_frame (frame1))
- level++;
- }
-
- if (!frame1)
- level = 0;
-
select_frame (frame);
}
@@ -1865,7 +1851,7 @@
if (!found)
printf_filtered ("'%s' not within current stack frame.\n", arg);
else if (fp != selected_frame)
- select_and_print_frame (fp, level);
+ select_and_print_frame (fp);
}
/* Gets the language of the current frame. */