From e76f05face9b0db02774161727d82eac678a75ac Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Sat, 9 Jun 2007 14:20:24 +0000 Subject: [PATCH] 2007-06-09 Markus Deuling * gdbarch.sh (SKIP_TRAMPOLINE_CODE): Replace by gdbarch_skip_trampoline_code. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise (comment). * objc-lang.c (objc_skip_trampoline) (objc_submethod_helper_data): Likewise. * m32c-lang.c (m32c_skip_trampoline_code): Likewise (comment). * infrun.c (handle_inferior_event): Likewise. * gnu-v3-abi.c (gnuv3_skip_trampoline): Likewise. * gdbarch.sh (IN_SOLIB_RETURN_TRAMPOLINE): Replace by gdbarch_in_solib_return_trampoline. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise (comment). * infrun.c (handle_inferior_event): Likewise. * hppa-tdep.c (hppa_stub_unwind_sniffer): Likewise. * gdbarch.c, gdbarch.h: Regenerate. --- gdb/ChangeLog | 17 +++++++++++++++++ gdb/gdbarch.c | 12 ------------ gdb/gdbarch.h | 12 ------------ gdb/gdbarch.sh | 4 ++-- gdb/gnu-v3-abi.c | 5 +++-- gdb/hppa-tdep.c | 2 +- gdb/infrun.c | 8 +++++--- gdb/m32c-tdep.c | 4 ++-- gdb/objc-lang.c | 7 ++++--- gdb/rs6000-tdep.c | 4 ++-- 10 files changed, 36 insertions(+), 39 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c2dab55..7d40213 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,22 @@ 2007-06-09 Markus Deuling + * gdbarch.sh (SKIP_TRAMPOLINE_CODE): Replace by + gdbarch_skip_trampoline_code. + * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise (comment). + * objc-lang.c (objc_skip_trampoline) + (objc_submethod_helper_data): Likewise. + * m32c-lang.c (m32c_skip_trampoline_code): Likewise (comment). + * infrun.c (handle_inferior_event): Likewise. + * gnu-v3-abi.c (gnuv3_skip_trampoline): Likewise. + * gdbarch.sh (IN_SOLIB_RETURN_TRAMPOLINE): Replace by + gdbarch_in_solib_return_trampoline. + * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise (comment). + * infrun.c (handle_inferior_event): Likewise. + * hppa-tdep.c (hppa_stub_unwind_sniffer): Likewise. + * gdbarch.c, gdbarch.h: Regenerate. + +2007-06-09 Markus Deuling + * gdbarch.sh (SKIP_PROLOGUE): Replace by gdbarch_skip_prologue. * symtab.c (find_function_start_sal, in_prologue): Likewise. * linespec.c (minsym_found): Likewise. diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 2b44c82..f20b5bc 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -971,12 +971,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n", (long) current_gdbarch->in_function_epilogue_p); -#ifdef IN_SOLIB_RETURN_TRAMPOLINE - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)", - XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name))); -#endif fprintf_unfiltered (file, "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n", (long) current_gdbarch->in_solib_return_trampoline); @@ -1226,12 +1220,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: skip_solib_resolver = <0x%lx>\n", (long) current_gdbarch->skip_solib_resolver); -#ifdef SKIP_TRAMPOLINE_CODE - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "SKIP_TRAMPOLINE_CODE(pc)", - XSTRING (SKIP_TRAMPOLINE_CODE (pc))); -#endif fprintf_unfiltered (file, "gdbarch_dump: skip_trampoline_code = <0x%lx>\n", (long) current_gdbarch->skip_trampoline_code); diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index bd28b19..21f2602 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -923,12 +923,6 @@ extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_ typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype) (CORE_ADDR pc); extern CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc); extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code); -#if !defined (GDB_TM_FILE) && defined (SKIP_TRAMPOLINE_CODE) -#error "Non multi-arch definition of SKIP_TRAMPOLINE_CODE" -#endif -#if !defined (SKIP_TRAMPOLINE_CODE) -#define SKIP_TRAMPOLINE_CODE(pc) (gdbarch_skip_trampoline_code (current_gdbarch, pc)) -#endif /* If IN_SOLIB_DYNSYM_RESOLVE_CODE returns true, and SKIP_SOLIB_RESOLVER evaluates non-zero, this is the address where the debugger will place @@ -943,12 +937,6 @@ extern void set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, gdbarch_sk typedef int (gdbarch_in_solib_return_trampoline_ftype) (CORE_ADDR pc, char *name); extern int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name); extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline); -#if !defined (GDB_TM_FILE) && defined (IN_SOLIB_RETURN_TRAMPOLINE) -#error "Non multi-arch definition of IN_SOLIB_RETURN_TRAMPOLINE" -#endif -#if !defined (IN_SOLIB_RETURN_TRAMPOLINE) -#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (gdbarch_in_solib_return_trampoline (current_gdbarch, pc, name)) -#endif /* A target might have problems with watchpoints as soon as the stack frame of the current function has been destroyed. This mostly happens diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 2f7a7f5..b729c6b 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -621,7 +621,7 @@ M::int:single_step_through_delay:struct frame_info *frame:frame # FIXME: cagney/2003-08-28: Need to find a better way of selecting the # disassembler. Perhaps objdump can handle it? f:TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, struct disassemble_info *info:vma, info::0: -f:=:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc::generic_skip_trampoline_code::0 +f::CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc::generic_skip_trampoline_code::0 # If IN_SOLIB_DYNSYM_RESOLVE_CODE returns true, and SKIP_SOLIB_RESOLVER @@ -629,7 +629,7 @@ f:=:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc::generic_skip_trampoline_code # a step-resume breakpoint to get us past the dynamic linker. m::CORE_ADDR:skip_solib_resolver:CORE_ADDR pc:pc::generic_skip_solib_resolver::0 # Some systems also have trampoline code for returning from shared libs. -f:=:int:in_solib_return_trampoline:CORE_ADDR pc, char *name:pc, name::generic_in_solib_return_trampoline::0 +f::int:in_solib_return_trampoline:CORE_ADDR pc, char *name:pc, name::generic_in_solib_return_trampoline::0 # A target might have problems with watchpoints as soon as the stack # frame of the current function has been destroyed. This mostly happens diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index d3c278c..d7f00fc 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -685,7 +685,7 @@ gnuv3_skip_trampoline (CORE_ADDR stop_pc) struct obj_section *section; char *thunk_name, *fn_name; - real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc); + real_stop_pc = gdbarch_skip_trampoline_code (current_gdbarch, stop_pc); if (real_stop_pc == 0) real_stop_pc = stop_pc; @@ -708,7 +708,8 @@ gnuv3_skip_trampoline (CORE_ADDR stop_pc) return 0; method_stop_pc = SYMBOL_VALUE_ADDRESS (fn_sym); - real_stop_pc = SKIP_TRAMPOLINE_CODE (method_stop_pc); + real_stop_pc = gdbarch_skip_trampoline_code + (current_gdbarch, method_stop_pc); if (real_stop_pc == 0) real_stop_pc = method_stop_pc; diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 8a05c73..7658aec 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -2456,7 +2456,7 @@ hppa_stub_unwind_sniffer (struct frame_info *next_frame) if (pc == 0 || (tdep->in_solib_call_trampoline != NULL && tdep->in_solib_call_trampoline (pc, NULL)) - || IN_SOLIB_RETURN_TRAMPOLINE (pc, NULL)) + || gdbarch_in_solib_return_trampoline (current_gdbarch, pc, NULL)) return &hppa_stub_frame_unwind; return NULL; } diff --git a/gdb/infrun.c b/gdb/infrun.c index 3c64156..7b05504 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2458,7 +2458,7 @@ process_event_stop_test: end of, if we do step into it. */ real_stop_pc = skip_language_trampoline (stop_pc); if (real_stop_pc == 0) - real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc); + real_stop_pc = gdbarch_skip_trampoline_code (current_gdbarch, stop_pc); if (real_stop_pc != 0) ecs->stop_func_start = real_stop_pc; @@ -2516,10 +2516,12 @@ process_event_stop_test: /* If we're in the return path from a shared library trampoline, we want to proceed through the trampoline when stepping. */ - if (IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name)) + if (gdbarch_in_solib_return_trampoline (current_gdbarch, + stop_pc, ecs->stop_func_name)) { /* Determine where this trampoline returns. */ - CORE_ADDR real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc); + CORE_ADDR real_stop_pc = gdbarch_skip_trampoline_code + (current_gdbarch, stop_pc); if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: stepped into solib return tramp\n"); diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index 5763d5c..02b0541 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -2319,10 +2319,10 @@ m32c_return_value (struct gdbarch *gdbarch, their program is calling, not in some trampoline code they've never seen before.) - The SKIP_TRAMPOLINE_CODE gdbarch method tells GDB how to step + The gdbarch_skip_trampoline_code method tells GDB how to step through such trampoline functions transparently to the user. When given the address of a trampoline function's first instruction, - SKIP_TRAMPOLINE_CODE should return the address of the first + gdbarch_skip_trampoline_code should return the address of the first instruction of the function really being called. If GDB decides it wants to step into that function, it will set a breakpoint there and silently continue to it. diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 1f30d7c..261e818 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -576,7 +576,7 @@ objc_skip_trampoline (CORE_ADDR stop_pc) CORE_ADDR real_stop_pc; CORE_ADDR method_stop_pc; - real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc); + real_stop_pc = gdbarch_skip_trampoline_code (current_gdbarch, stop_pc); if (real_stop_pc != 0) find_objc_msgcall (real_stop_pc, &method_stop_pc); @@ -585,7 +585,8 @@ objc_skip_trampoline (CORE_ADDR stop_pc) if (method_stop_pc) { - real_stop_pc = SKIP_TRAMPOLINE_CODE (method_stop_pc); + real_stop_pc = gdbarch_skip_trampoline_code + (current_gdbarch, method_stop_pc); if (real_stop_pc == 0) real_stop_pc = method_stop_pc; } @@ -1647,7 +1648,7 @@ find_objc_msgsend (void) * The old function "pc_off_limits" used to do a lot of other things * in addition, such as detecting shared library jump stubs and * returning the address of the shlib function that would be called. - * That functionality has been moved into the SKIP_TRAMPOLINE_CODE and + * That functionality has been moved into the gdbarch_skip_trampoline_code and * IN_SOLIB_TRAMPOLINE macros, which are resolved in the target- * dependent modules. */ diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 50557c0..7712bd2 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -1946,8 +1946,8 @@ rs6000_return_value (struct gdbarch *gdbarch, struct type *valtype, branches, meaning that the link register doesn't get set. Therefore, GDB's usual step_over_function () mechanism won't work. - Instead, use the IN_SOLIB_RETURN_TRAMPOLINE and - SKIP_TRAMPOLINE_CODE hooks in handle_inferior_event() to skip past + Instead, use the gdbarch_skip_trampoline_code and + gdbarch_skip_trampoline_code hooks in handle_inferior_event() to skip past @FIX code. */ int -- 2.7.4