summaryrefslogtreecommitdiffstats
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-09-28 01:35:29 +0000
committerJohn Gilmore <gnu@cygnus>1991-09-28 01:35:29 +0000
commitd8ce13268e9c7514b4b09757ad762bce9d0bfb0a (patch)
tree7156d8661603b50b662933c870fbc95050b43f60 /gdb/stack.c
parentdad0e12d57c432daeabe8f9a05848a60a5d08f91 (diff)
downloadppe42-binutils-d8ce13268e9c7514b4b09757ad762bce9d0bfb0a.tar.gz
ppe42-binutils-d8ce13268e9c7514b4b09757ad762bce9d0bfb0a.zip
* coffread.c (coff_symfile_read): Use xmalloc, not malloc.
* language.c, printcmd.c: Lint. * language.h (get_frame_language): Declare. * saber.suppress: update. * stack.c (find_relative_frame): Remove complex code that was #if 0'd, stick with simple code. Lint. * saber.suppress: Update a bit. * symfile.c (add_symbol_file_command): Add "?" to question. * utils.c (parse_escape): Avoid \a due to bdead compilers. * value.h: Declare typedef_print. * valprint.c (val_print, type_print_base): TYPE_CODE_RANGE less kludgey.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index 9739f2863d..23bf9cb584 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -32,7 +32,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
extern int addressprint; /* Print addresses, or stay symbolic only? */
extern int info_verbose; /* Verbosity of symbol reading msgs */
-extern unsigned lines_to_list; /* # of lines "list" command shows by default */
+extern int lines_to_list; /* # of lines "list" command shows by default */
extern char *reg_names[]; /* Names of registers */
/* Thie "selected" stack frame is used by default for local and arg access.
@@ -899,7 +899,7 @@ find_relative_frame (frame, level_offset_ptr)
register int* level_offset_ptr;
{
register FRAME prev;
- register FRAME frame1, frame2;
+ register FRAME frame1;
/* Going up is simple: just do get_prev_frame enough times
or until initial frame is reached. */
@@ -911,36 +911,9 @@ find_relative_frame (frame, level_offset_ptr)
(*level_offset_ptr)--;
frame = prev;
}
- /* Going down could be done by iterating get_frame_info to
- find the next frame, but that would be quadratic
- since get_frame_info must scan all the way from the current frame.
- The following algorithm is linear. */
+ /* Going down is just as simple. */
if (*level_offset_ptr < 0)
{
-#if 0
-/* This is ancient and unnecessary? -- gnu@cygnus.com
- It also loops forever if frame #0 is not current_frame (e.g. when we have
- used the "frame" command after the stack was invalid). */
-
- /* First put frame1 at innermost frame
- and frame2 N levels up from there. */
- frame1 = get_current_frame ();
- frame2 = frame1;
- while (*level_offset_ptr < 0 && frame2 != frame)
- {
- frame2 = get_prev_frame (frame2);
- (*level_offset_ptr) ++;
- }
- /* Then slide frame1 and frame2 up in synchrony
- and when frame2 reaches our starting point
- frame1 must be N levels down from there. */
- while (frame2 != frame)
- {
- frame1 = get_prev_frame (frame1);
- frame2 = get_prev_frame (frame2);
- }
- return frame1;
-#else
while (*level_offset_ptr < 0) {
frame1 = get_next_frame (frame);
if (!frame1)
@@ -948,7 +921,6 @@ find_relative_frame (frame, level_offset_ptr)
frame = frame1;
(*level_offset_ptr)++;
}
-#endif
}
return frame;
}
OpenPOWER on IntegriCloud