diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b31281dedc..7404eb6540 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,21 @@ +2003-05-30 Richard Henderson + + * alpha-mdebug-tdep.c (alpha_mdebug_frame_p): Reject prologues. + (alpha_mdebug_frame_unwind_cache): Don't call the heuristic unwinder. + (alpha_mdebug_frame_this_id): Likewise. + (alpha_mdebug_frame_prev_register): Likewise. + (alpha_mdebug_frame_base_address): Likewise. + (alpha_mdebug_frame_locals_address): Likewise. + (alpha_mdebug_frame_args_address): Likewise. + (struct alpha_mdebug_unwind_cache): Remove in_prologue_cache. + * alpha-tdep.c (alpha_heuristic_proc_start): Use get_pc_function_start. + (alpha_heuristic_frame_unwind_cache): Make static; add missing + loop increment. + (alpha_heuristic_frame_this_id): Make static. + (alpha_heuristic_frame_prev_register): Likewise. + (alpha_heuristic_frame_base_address): Likewise. + * alpha-tdep.h: Update. + 2003-05-30 Mark Kettenis * i386-tdep.h (i386bsd_sigcontext_addr): Remove prototype. @@ -674,10 +692,10 @@ 2003-05-15 David Carlton Committed by Elena Zannoni - * symtab.c (lookup_symbol_aux): Delete calls to - lookup_symbol_aux_minsyms. - (lookup_symbol_aux_minsyms): Comment out function and - prototype. Delete lookup by mangled name. + * symtab.c (lookup_symbol_aux): Delete calls to + lookup_symbol_aux_minsyms. + (lookup_symbol_aux_minsyms): Comment out function and + prototype. Delete lookup by mangled name. 2003-05-14 Kevin Buettner @@ -1543,7 +1561,7 @@ 2003-04-18 Jim Blandy * s390-tdep.c (s390_frame_align): New function. - (s390_gdbarch_init): Register it with the gdbarch object. + (s390_gdbarch_init): Register it with the gdbarch object. 2003-04-17 Richard Henderson @@ -1558,7 +1576,7 @@ 2003-04-17 Elena Zannoni * values.c (value_being_returned): Don't fetch the return - value if the return type is void. + value if the return type is void. 2003-04-17 Jeff Johnston @@ -2083,7 +2101,7 @@ 2003-04-08 Elena Zannoni - * infrun.c (stop_soon): Rename from stop_soon_quietly. + * infrun.c (stop_soon): Rename from stop_soon_quietly. (struct inferior_status): Rename stop_soon_quietly field to stop_soon. (clear_proceed_status): Rename stop_soon_quietly to stop_soon. (start_remote): Ditto. @@ -2092,7 +2110,7 @@ (restore_inferior_status): Ditto. * infcmd.c (attach_command): Ditto. * fork-child.c (startup_inferior): Ditto. - * inferior.h (stop_soon): Rename from stop_soon_quietly. + * inferior.h (stop_soon): Rename from stop_soon_quietly. * alpha-tdep.c (heuristic_proc_start): Ditto. * mips-tdep.c (heuristic_proc_start): Ditto. * solib-svr4.c (svr4_solib_create_inferior_hook): Ditto. @@ -2126,11 +2144,11 @@ 2003-04-07 Elena Zannoni * disasm.c (dump_insns): Move variables inside loop, or they will - be freed more than once, causing wild memory corruptions. + be freed more than once, causing wild memory corruptions. (gdb_disassembly): Look for the substring "-thread", - instead of "-threads" in the target name, to make sure to find - the 'multi-thread' target. Also, make sure we do the right thing - with the "core" target. + instead of "-threads" in the target name, to make sure to find + the 'multi-thread' target. Also, make sure we do the right thing + with the "core" target. 2003-04-07 Kevin Buettner @@ -2291,9 +2309,9 @@ 2003-04-04 Elena Zannoni - * x86-64-tdep.c (x86_64_push_arguments): Handle correctly the - signed integer case. - (classify_argument): Handle enumerations and references. + * x86-64-tdep.c (x86_64_push_arguments): Handle correctly the + signed integer case. + (classify_argument): Handle enumerations and references. 2003-04-04 Andrew Cagney @@ -2331,15 +2349,15 @@ * language.c (language_demangle): New function. (unk_lang_demangle): Likewise. (unknown_language_defn, auto_language_defn, local_language_defn): - Add ukn_lang_demangle. + Add ukn_lang_demangle. * ada-lang.c (ada_language_defn): Add NULL for la_demangle element. - * f-lang.c, m2-lang.c, p-lang.c, scm-lang.c: Likewise. + * f-lang.c, m2-lang.c, p-lang.c, scm-lang.c: Likewise. * c-lang.c (c_language_defn, asm_language_defn): Likewise. (cplus_language_defn): Add cplus_demangle for la_demangle element. * jv-lang.c (java_demangle): New function (java_language_defn): Use it for la_demangle element. - * objc-lang.c (objc_demangle): Add options argument - (objc_language_defn): Use objc_demangle for la_demangle element. + * objc-lang.c (objc_demangle): Add options argument + (objc_language_defn): Use objc_demangle for la_demangle element. * maint.c (maintenance_demangle): Replace switch with call to language_demangle. * utils.c (fprintf_symbol_filtered): Likewise. @@ -2573,7 +2591,7 @@ 2003-03-30 Andrew Cagney 2002-11-10 Klee Dienes - * value.h (struct value): Update comment. + * value.h (struct value): Update comment. 2003-03-30 Andrew Cagney @@ -2732,7 +2750,7 @@ 2003-03-28 Bob Rossi - * MAINTAINERS (write after approval): Add myself. + * MAINTAINERS (write after approval): Add myself. 2003-03-27 Theodore A. Roth @@ -3361,12 +3379,12 @@ 2003-03-13 D. Venkatasubramanian - * MAINTAINERS (write after approval): Alphabetically + * MAINTAINERS (write after approval): Alphabetically listing corrected. 2003-03-13 D. Venkatasubramanian - * MAINTAINERS (write after approval): Add myself. + * MAINTAINERS (write after approval): Add myself. 2003-03-12 Andrew Cagney @@ -4288,7 +4306,7 @@ 2003-02-20 Adam Fedor * objc-lang.h (find_methods): Remove declaration. - * objc-lang.c (find_methods): Make static. + * objc-lang.c (find_methods): Make static. 2003-02-20 Christopher Faylor @@ -4484,10 +4502,10 @@ 2003-02-18 Elena Zannoni From Jim Ingham : - * dbxread.c (process_one_symbol): Use last_function_start rather - than function_start_offset to find the real beginning of the - current function. The latter is just the text section offset on - some systems, the former is always the real function start. + * dbxread.c (process_one_symbol): Use last_function_start rather + than function_start_offset to find the real beginning of the + current function. The latter is just the text section offset on + some systems, the former is always the real function start. 2003-02-17 Andrew Cagney @@ -4502,7 +4520,7 @@ 2003-02-14 Elena Zannoni - From Brian Ford + From Brian Ford * cli/cli-decode.c (lookup_cmd_composition) [TUI]: Properly conditionalize tui_active test. @@ -4540,8 +4558,8 @@ 2003-02-12 Jason Molenda (jmolenda@apple.com) - * symmisc.c (print_objfile_statistics): Include information about - the number of psymtabs and symtabs in each object file. + * symmisc.c (print_objfile_statistics): Include information about + the number of psymtabs and symtabs in each object file. 2003-02-13 Keith R Seitz @@ -4665,9 +4683,9 @@ (threads_continue_all_with_signals): Ditto. 2003-02-05 Jim Ingham - Keith Seitz - Elena Zannoni - Andrew Cagney + Keith Seitz + Elena Zannoni + Andrew Cagney * Makefile.in (SUBDIR_CLI_OBS): Add "cli-interp.o". (SUBDIR_CLI_SRCS): Add "cli/cli-interp.c". @@ -4926,11 +4944,11 @@ From Kevin Buettner : * ui-out.h (make_cleanup_ui_out_table_begin_end): New function. - * ui-out.c (make_cleanup_ui_out_table_begin_end) - (do_cleanup_table_end): New functions. - * breakpoint.c (print_it_typical, print_one_breakpoint, mention): - Use cleanups to invoke_ui_out_tuple_end(). - (breakpoint_1): Use cleanup to invoke ui_out_table_end(). + * ui-out.c (make_cleanup_ui_out_table_begin_end) + (do_cleanup_table_end): New functions. + * breakpoint.c (print_it_typical, print_one_breakpoint, mention): + Use cleanups to invoke_ui_out_tuple_end(). + (breakpoint_1): Use cleanup to invoke ui_out_table_end(). * cli/cli-setshow.c (cmd_show_list): Use make_cleanup_ui_out_tuple_begin_end. @@ -4967,8 +4985,8 @@ 2003-02-01 Andrew Cagney From 2002-11-09 Jason Molenda (jason-cl@molenda.com) - * stack.c (print_frame_info_base): Output complete FRAME tuple - for synthesized frames. + * stack.c (print_frame_info_base): Output complete FRAME tuple + for synthesized frames. 2003-02-02 Andrew Cagney diff --git a/gdb/alpha-mdebug-tdep.c b/gdb/alpha-mdebug-tdep.c index 2f84d6d409..2f49e08260 100644 --- a/gdb/alpha-mdebug-tdep.c +++ b/gdb/alpha-mdebug-tdep.c @@ -174,7 +174,6 @@ struct alpha_mdebug_unwind_cache alpha_extra_func_info_t proc_desc; CORE_ADDR vfp; CORE_ADDR *saved_regs; - void *in_prologue_cache; }; /* Extract all of the information about the frame from PROC_DESC @@ -205,21 +204,6 @@ alpha_mdebug_frame_unwind_cache (struct frame_info *next_frame, info->proc_desc = proc_desc; gdb_assert (proc_desc != NULL); - /* If we're in the prologue, the PDR for this frame is not yet valid. */ - /* ??? We could have said "no" in alpha_mdebug_frame_p, and we'd - walk down the list of unwinders and try the heuristic unwinder - and things would have been fine. However, since we have the PDR, - we know how to skip the search for the start of the procedure, - and all the uncertainty involved there. So instead, arrange for - us to defer to the heuristic unwinder directly. */ - if (alpha_mdebug_in_prologue (pc, proc_desc)) - { - alpha_heuristic_frame_unwind_cache (next_frame, - &info->in_prologue_cache, - PROC_LOW_ADDR (proc_desc)); - return info; - } - info->saved_regs = frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS); /* The VFP of the frame is at FRAME_REG+FRAME_OFFSET. */ @@ -275,12 +259,7 @@ alpha_mdebug_frame_this_id (struct frame_info *next_frame, struct alpha_mdebug_unwind_cache *info = alpha_mdebug_frame_unwind_cache (next_frame, this_prologue_cache); - /* If we're in the prologue, defer to the heuristic unwinder. */ - if (info->in_prologue_cache) - alpha_heuristic_frame_this_id (next_frame, &info->in_prologue_cache, - this_id); - else - *this_id = frame_id_build (info->vfp, frame_func_unwind (next_frame)); + *this_id = frame_id_build (info->vfp, frame_func_unwind (next_frame)); } /* Retrieve the value of REGNUM in FRAME. Don't give up! */ @@ -295,16 +274,6 @@ alpha_mdebug_frame_prev_register (struct frame_info *next_frame, struct alpha_mdebug_unwind_cache *info = alpha_mdebug_frame_unwind_cache (next_frame, this_prologue_cache); - /* If we're in the prologue, defer to the heuristic unwinder. */ - if (info->in_prologue_cache) - { - alpha_heuristic_frame_prev_register (next_frame, - &info->in_prologue_cache, - regnum, optimizedp, lvalp, - addrp, realnump, bufferp); - return; - } - /* The PC of the previous frame is stored in the link register of the current frame. Frob regnum so that we pull the value from the correct place. */ @@ -359,6 +328,11 @@ alpha_mdebug_frame_p (CORE_ADDR pc) if (proc_desc == NULL) return NULL; + /* If we're in the prologue, the PDR for this frame is not yet valid. + Say no here and we'll fall back on the heuristic unwinder. */ + if (alpha_mdebug_in_prologue (pc, proc_desc)) + return NULL; + return &alpha_mdebug_frame_unwind; } @@ -369,11 +343,7 @@ alpha_mdebug_frame_base_address (struct frame_info *next_frame, struct alpha_mdebug_unwind_cache *info = alpha_mdebug_frame_unwind_cache (next_frame, this_prologue_cache); - if (info->in_prologue_cache) - return alpha_heuristic_frame_base_address (next_frame, - &info->in_prologue_cache); - else - return info->vfp; + return info->vfp; } static CORE_ADDR @@ -382,15 +352,8 @@ alpha_mdebug_frame_locals_address (struct frame_info *next_frame, { struct alpha_mdebug_unwind_cache *info = alpha_mdebug_frame_unwind_cache (next_frame, this_prologue_cache); - CORE_ADDR vfp; - if (info->in_prologue_cache) - vfp = alpha_heuristic_frame_base_address (next_frame, - &info->in_prologue_cache); - else - vfp = info->vfp; - - return vfp - PROC_LOCALOFF (info->proc_desc); + return info->vfp - PROC_LOCALOFF (info->proc_desc); } static CORE_ADDR @@ -399,15 +362,8 @@ alpha_mdebug_frame_args_address (struct frame_info *next_frame, { struct alpha_mdebug_unwind_cache *info = alpha_mdebug_frame_unwind_cache (next_frame, this_prologue_cache); - CORE_ADDR vfp; - if (info->in_prologue_cache) - vfp = alpha_heuristic_frame_base_address (next_frame, - &info->in_prologue_cache); - else - vfp = info->vfp; - - return vfp - ALPHA_NUM_ARG_REGS * 8; + return info->vfp - ALPHA_NUM_ARG_REGS * 8; } static const struct frame_base alpha_mdebug_frame_base = { diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 2bd3b266ce..cd29c95e4f 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -666,10 +666,18 @@ alpha_heuristic_proc_start (CORE_ADDR pc) CORE_ADDR last_non_nop = pc; CORE_ADDR fence = pc - heuristic_fence_post; CORE_ADDR orig_pc = pc; + CORE_ADDR func; if (pc == 0) return 0; + /* First see if we can find the start of the function from minimal + symbol information. This can succeed with a binary that doesn't + have debug info, but hasn't been stripped. */ + func = get_pc_function_start (pc); + if (func) + return func; + if (heuristic_fence_post == UINT_MAX || fence < tdep->vm_min_address) fence = tdep->vm_min_address; @@ -725,7 +733,7 @@ Otherwise, you told GDB there was a function where there isn't one, or\n\ return 0; } -struct alpha_heuristic_unwind_cache * +static struct alpha_heuristic_unwind_cache * alpha_heuristic_frame_unwind_cache (struct frame_info *next_frame, void **this_prologue_cache, CORE_ADDR start_pc) @@ -882,7 +890,7 @@ alpha_heuristic_frame_unwind_cache (struct frame_info *next_frame, /* Given a GDB frame, determine the address of the calling function's frame. This will be used to create a new GDB frame struct. */ -void +static void alpha_heuristic_frame_this_id (struct frame_info *next_frame, void **this_prologue_cache, struct frame_id *this_id) @@ -890,12 +898,17 @@ alpha_heuristic_frame_this_id (struct frame_info *next_frame, struct alpha_heuristic_unwind_cache *info = alpha_heuristic_frame_unwind_cache (next_frame, this_prologue_cache, 0); + /* This is meant to halt the backtrace at "_start". Make sure we + don't halt it at a generic dummy frame. */ + if (inside_entry_file (info->start_pc)) + return; + *this_id = frame_id_build (info->vfp, info->start_pc); } /* Retrieve the value of REGNUM in FRAME. Don't give up! */ -void +static void alpha_heuristic_frame_prev_register (struct frame_info *next_frame, void **this_prologue_cache, int regnum, int *optimizedp, @@ -954,7 +967,7 @@ alpha_heuristic_frame_p (CORE_ADDR pc) return &alpha_heuristic_frame_unwind; } -CORE_ADDR +static CORE_ADDR alpha_heuristic_frame_base_address (struct frame_info *next_frame, void **this_prologue_cache) { diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h index 412ec37c5a..5def15a845 100644 --- a/gdb/alpha-tdep.h +++ b/gdb/alpha-tdep.h @@ -99,19 +99,7 @@ struct gdbarch_tdep extern unsigned int alpha_read_insn (CORE_ADDR pc); extern void alpha_software_single_step (enum target_signal, int); - -/* Let other files poke at the heuristic unwinder. */ extern CORE_ADDR alpha_after_prologue (CORE_ADDR pc); -extern struct alpha_heuristic_unwind_cache * - alpha_heuristic_frame_unwind_cache (struct frame_info *, void **, CORE_ADDR); -extern void alpha_heuristic_frame_this_id (struct frame_info *, void **, - struct frame_id *); -extern void alpha_heuristic_frame_prev_register (struct frame_info *, - void **, int, int *, - enum lval_type *, - CORE_ADDR *, int *, void *); -extern CORE_ADDR alpha_heuristic_frame_base_address (struct frame_info *, - void **); extern void alpha_mdebug_init_abi (struct gdbarch_info, struct gdbarch *);