diff options
author | Mark Kettenis <kettenis@gnu.org> | 2002-09-06 20:17:40 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2002-09-06 20:17:40 +0000 |
commit | 43156d82f174844fcb1cd554a7a068867ce755da (patch) | |
tree | 6b681baf95d476ca093cf17d4e6fccc92dcffb29 | |
parent | e4512afa79ecdd0ef17f8871676df09f49015eda (diff) | |
download | gdb-43156d82f174844fcb1cd554a7a068867ce755da.zip gdb-43156d82f174844fcb1cd554a7a068867ce755da.tar.gz gdb-43156d82f174844fcb1cd554a7a068867ce755da.tar.bz2 |
* gdbarch.sh (SIGTRAMP_START, SIGTRAMP_END): New methods.
* gdbarch.h, gdbarch.c: Re-generate.
* blockframe.c (find_pc_sect_partial_function): Convert to use
SIGTRAMP_START_P predicate.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/blockframe.c | 4 | ||||
-rw-r--r-- | gdb/gdbarch.c | 73 | ||||
-rw-r--r-- | gdb/gdbarch.h | 51 | ||||
-rwxr-xr-x | gdb/gdbarch.sh | 2 |
5 files changed, 133 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 59b2c24..fb418c9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2002-09-06 Mark Kettenis <kettenis@gnu.org> + + * gdbarch.sh (SIGTRAMP_START, SIGTRAMP_END): New methods. + * gdbarch.h, gdbarch.c: Re-generate. + * blockframe.c (find_pc_sect_partial_function): Convert to use + SIGTRAMP_START_P predicate. + 2002-09-05 Michael Snyder <msnyder@redhat.com> * arm-tdep.c (arm_init_extra_frame_info): Distinguish between diff --git a/gdb/blockframe.c b/gdb/blockframe.c index b2c5d0e..3ff725b 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -816,8 +816,7 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name, /* If sigtramp is in the u area, it counts as a function (especially important for step_1). */ -#if defined SIGTRAMP_START - if (PC_IN_SIGTRAMP (mapped_pc, (char *) NULL)) + if (SIGTRAMP_START_P () && PC_IN_SIGTRAMP (mapped_pc, (char *) NULL)) { cache_pc_function_low = SIGTRAMP_START (mapped_pc); cache_pc_function_high = SIGTRAMP_END (mapped_pc); @@ -825,7 +824,6 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name, cache_pc_function_section = section; goto return_cached_value; } -#endif msymbol = lookup_minimal_symbol_by_pc_section (mapped_pc, section); pst = find_pc_sect_psymtab (mapped_pc, section); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index e930642..49c1152 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -260,6 +260,8 @@ struct gdbarch gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline; gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline; gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp; + gdbarch_sigtramp_start_ftype *sigtramp_start; + gdbarch_sigtramp_end_ftype *sigtramp_end; gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p; gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments; gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info; @@ -414,6 +416,8 @@ struct gdbarch startup_gdbarch = 0, 0, 0, + 0, + 0, generic_in_function_epilogue_p, construct_inferior_arguments, 0, @@ -786,6 +790,8 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */ /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */ /* Skip verify of pc_in_sigtramp, invalid_p == 0 */ + /* Skip verify of sigtramp_start, has predicate */ + /* Skip verify of sigtramp_end, invalid_p == 0 */ /* Skip verify of in_function_epilogue_p, invalid_p == 0 */ /* Skip verify of construct_inferior_arguments, invalid_p == 0 */ /* Skip verify of dwarf2_build_frame_info, has predicate */ @@ -1862,6 +1868,28 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->sdb_reg_to_regnum /*SDB_REG_TO_REGNUM ()*/); #endif +#ifdef SIGTRAMP_END + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "SIGTRAMP_END(pc)", + XSTRING (SIGTRAMP_END (pc))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: SIGTRAMP_END = 0x%08lx\n", + (long) current_gdbarch->sigtramp_end + /*SIGTRAMP_END ()*/); +#endif +#ifdef SIGTRAMP_START + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "SIGTRAMP_START(pc)", + XSTRING (SIGTRAMP_START (pc))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: SIGTRAMP_START = 0x%08lx\n", + (long) current_gdbarch->sigtramp_start + /*SIGTRAMP_START ()*/); +#endif #ifdef SIZEOF_CALL_DUMMY_WORDS fprintf_unfiltered (file, "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n", @@ -4781,6 +4809,51 @@ set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, } int +gdbarch_sigtramp_start_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->sigtramp_start != 0; +} + +CORE_ADDR +gdbarch_sigtramp_start (struct gdbarch *gdbarch, CORE_ADDR pc) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->sigtramp_start == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_sigtramp_start invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_sigtramp_start called\n"); + return gdbarch->sigtramp_start (pc); +} + +void +set_gdbarch_sigtramp_start (struct gdbarch *gdbarch, + gdbarch_sigtramp_start_ftype sigtramp_start) +{ + gdbarch->sigtramp_start = sigtramp_start; +} + +CORE_ADDR +gdbarch_sigtramp_end (struct gdbarch *gdbarch, CORE_ADDR pc) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->sigtramp_end == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_sigtramp_end invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_sigtramp_end called\n"); + return gdbarch->sigtramp_end (pc); +} + +void +set_gdbarch_sigtramp_end (struct gdbarch *gdbarch, + gdbarch_sigtramp_end_ftype sigtramp_end) +{ + gdbarch->sigtramp_end = sigtramp_end; +} + +int gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr) { gdb_assert (gdbarch != NULL); diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index b76bf4a..5976f46 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -2207,7 +2207,7 @@ extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_ #endif #endif -/* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into +/* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into ADDR_BITS_REMOVE. */ /* Default (function) for non- multi-arch platforms. */ @@ -2385,6 +2385,55 @@ extern void set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, gdbarch_pc_in_s #endif #endif +#if defined (SIGTRAMP_START) +/* Legacy for systems yet to multi-arch SIGTRAMP_START */ +#if !defined (SIGTRAMP_START_P) +#define SIGTRAMP_START_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_START_P) +#define SIGTRAMP_START_P() (0) +#endif + +extern int gdbarch_sigtramp_start_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_START_P) +#error "Non multi-arch definition of SIGTRAMP_START" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_START_P) +#define SIGTRAMP_START_P() (gdbarch_sigtramp_start_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_START) +#define SIGTRAMP_START(pc) (internal_error (__FILE__, __LINE__, "SIGTRAMP_START"), 0) +#endif + +typedef CORE_ADDR (gdbarch_sigtramp_start_ftype) (CORE_ADDR pc); +extern CORE_ADDR gdbarch_sigtramp_start (struct gdbarch *gdbarch, CORE_ADDR pc); +extern void set_gdbarch_sigtramp_start (struct gdbarch *gdbarch, gdbarch_sigtramp_start_ftype *sigtramp_start); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_START) +#error "Non multi-arch definition of SIGTRAMP_START" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_START) +#define SIGTRAMP_START(pc) (gdbarch_sigtramp_start (current_gdbarch, pc)) +#endif +#endif + +typedef CORE_ADDR (gdbarch_sigtramp_end_ftype) (CORE_ADDR pc); +extern CORE_ADDR gdbarch_sigtramp_end (struct gdbarch *gdbarch, CORE_ADDR pc); +extern void set_gdbarch_sigtramp_end (struct gdbarch *gdbarch, gdbarch_sigtramp_end_ftype *sigtramp_end); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_END) +#error "Non multi-arch definition of SIGTRAMP_END" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_END) +#define SIGTRAMP_END(pc) (gdbarch_sigtramp_end (current_gdbarch, pc)) +#endif +#endif + /* A target might have problems with watchpoints as soon as the stack frame of the current function has been destroyed. This mostly happens as the first action in a funtion's epilogue. in_function_epilogue_p() diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 1ce71af..ff1d6ed 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -636,6 +636,8 @@ f:2:IN_SOLIB_RETURN_TRAMPOLINE:int:in_solib_return_trampoline:CORE_ADDR pc, char # Some code also depends on SIGTRAMP_START and SIGTRAMP_END but other # does not. f:2:PC_IN_SIGTRAMP:int:pc_in_sigtramp:CORE_ADDR pc, char *name:pc, name:::legacy_pc_in_sigtramp::0 +F:2:SIGTRAMP_START:CORE_ADDR:sigtramp_start:CORE_ADDR pc:pc +f:2:SIGTRAMP_END:CORE_ADDR:sigtramp_end:CORE_ADDR pc:pc:::::0 # A target might have problems with watchpoints as soon as the stack # frame of the current function has been destroyed. This mostly happens # as the first action in a funtion's epilogue. in_function_epilogue_p() |