diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-01-21 19:32:42 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-01-21 19:32:42 +0000 |
commit | eb4f72c5f97465009446c097eef2204c6e8573e2 (patch) | |
tree | 8ce0abde09d7c2d367686b32f32dfbca9b310b58 /gdb/blockframe.c | |
parent | dd1e43b69f269649ed1c432029f2554b92831462 (diff) | |
download | gdb-eb4f72c5f97465009446c097eef2204c6e8573e2.zip gdb-eb4f72c5f97465009446c097eef2204c6e8573e2.tar.gz gdb-eb4f72c5f97465009446c097eef2204c6e8573e2.tar.bz2 |
2003-01-21 Andrew Cagney <ac131313@redhat.com>
* frame.h (FRAME_OBSTACK_ZALLOC): Define.
* blockframe.c (backtrace_below_main): Move to "frame.c".
(frame_chain_valid): Delete check for backtrace_below_main.
(_initialize_blockframe): Delete initialization, move ``set
backtrace-below-main'' command to "frame.c".
(do_flush_frames_sfunc): Delete function.
* frame.c: Include "command.h" and "gdbcmd.h".
(frame_type_from_pc): New function.
(create_new_frame): Use frame_type_from_pc.
(legacy_get_prev_frame): New function.
(get_prev_frame): Rewrite. When an old style frame, call
legacy_get_prev_frame. Otherwize, unwind the PC first.
(_initialize_frame): Add ``set backtrace-below-main'' command.
* Makefile.in (frame.o): Update dependencies.
Diffstat (limited to 'gdb/blockframe.c')
-rw-r--r-- | gdb/blockframe.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 35fc798..df94e85 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -39,10 +39,6 @@ #include "command.h" #include "gdbcmd.h" -/* Flag to indicate whether backtraces should stop at main. */ - -static int backtrace_below_main; - /* Prototypes for exported functions. */ void _initialize_blockframe (void); @@ -697,53 +693,9 @@ frame_chain_valid (CORE_ADDR fp, struct frame_info *fi) if (inside_entry_file (frame_pc_unwind (fi))) return 0; - /* If we want backtraces to stop at main, and we're inside main, then it - isn't valid. */ - if (!backtrace_below_main && inside_main_func (get_frame_pc (fi))) - return 0; - /* If the architecture has a custom FRAME_CHAIN_VALID, call it now. */ if (FRAME_CHAIN_VALID_P ()) return FRAME_CHAIN_VALID (fp, fi); return 1; } - -void -do_flush_frames_sfunc (char *args, int from_tty, struct cmd_list_element *c) -{ - int saved_level; - struct frame_info *cur_frame; - - if (! target_has_stack) - return; - - saved_level = frame_relative_level (get_selected_frame ()); - - flush_cached_frames (); - - cur_frame = find_relative_frame (get_current_frame (), &saved_level); - select_frame (cur_frame); - - /* If we were below main and backtrace-below-main was turned off, - SAVED_LEVEL will be non-zero. CUR_FRAME will point to main. - Accept this but print the new frame. */ - if (saved_level != 0) - print_stack_frame (get_selected_frame (), -1, 0); -} - -void -_initialize_blockframe (void) -{ - add_setshow_boolean_cmd ("backtrace-below-main", class_obscure, - &backtrace_below_main, - "Set whether backtraces should continue past \"main\".\n" - "Normally the caller of \"main\" is not of interest, so GDB will terminate\n" - "the backtrace at \"main\". Set this variable if you need to see the rest\n" - "of the stack trace.", - "Show whether backtraces should continue past \"main\".\n" - "Normally the caller of \"main\" is not of interest, so GDB will terminate\n" - "the backtrace at \"main\". Set this variable if you need to see the rest\n" - "of the stack trace.", - do_flush_frames_sfunc, NULL, &setlist, &showlist); -} |