From 50c9bd316dea4c2a2103d5856a9a942c999e16ae Mon Sep 17 00:00:00 2001 From: Kevin Buettner Date: Tue, 22 Feb 2000 18:47:41 +0000 Subject: [PATCH] Cleanups and signal handler backtrace fix for GNU/Linux PPC port. --- gdb/ChangeLog | 19 +++++++++++++++++++ gdb/config/powerpc/tm-linux.h | 25 ++++++------------------- gdb/ppc-linux-nat.c | 2 ++ gdb/ppc-linux-tdep.c | 15 ++++++++++++--- 4 files changed, 39 insertions(+), 22 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a98f1d5..655f152 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,22 @@ +2000-02-22 Kevin Buettner + + * ppc-linux-nat.c (supply_gregset, supply_fpregset): Add return + type. + * ppc-linux-tdep.c (ppc_linux_at_sigtramp_return_path): Add + forward declaration. + + * ppc-linux-tdep.c (ppc_linux_frame_saved_pc): Handle case + where the next frame is a signal handler caller. + + * config/powerpc/tm-linux.h (PUSH_ARGUMENTS): Remove extraneous + undef. + (tm-linux.h): Include. + (tm-sysv4.h): Don't include (directly). config/tm-linux.h will + include this file for us. + (REALTIME_LO, REALTIME_HI): Don't define. These are defined by + config/tm-linux.h for us. + (SOFUN_ADDRESS_MAYBE_MISSING): Define. + 2000-02-21 Kevin Buettner * Makefile.in (ppc-linux-nat.c, ppc-linux-tdep.c): New files. diff --git a/gdb/config/powerpc/tm-linux.h b/gdb/config/powerpc/tm-linux.h index 13a5327..271c302 100644 --- a/gdb/config/powerpc/tm-linux.h +++ b/gdb/config/powerpc/tm-linux.h @@ -21,8 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define TM_LINUX_H #include "powerpc/tm-ppc-eabi.h" - -#undef PUSH_ARGUMENTS +/* Avoid warning from redefinition in tm-sysv4.h (included from tm-linux.h) */ +#undef SKIP_TRAMPOLINE_CODE +#include "tm-linux.h" /* We can single step on linux */ #undef SOFTWARE_SINGLE_STEP @@ -44,12 +45,6 @@ extern int at_subroutine_call_instruction_target(); /* Offset to saved PC in sigcontext, from . */ #define SIGCONTEXT_PC_OFFSET 184 -/* Avoid warning from redefinition in tm-sysv4.h */ -#undef SKIP_TRAMPOLINE_CODE - -/* We need this file for the SOLIB_TRAMPOLINE stuff. */ -#include "tm-sysv4.h" - extern CORE_ADDR ppc_linux_skip_trampoline_code (CORE_ADDR pc); #undef SKIP_TRAMPOLINE_CODE #define SKIP_TRAMPOLINE_CODE(pc) ppc_linux_skip_trampoline_code (pc) @@ -98,16 +93,8 @@ CORE_ADDR ppc_sysv_abi_push_arguments PARAMS ((int, struct value **, CORE_ADDR, #define PROLOGUE_FIRSTLINE_OVERLAP #endif -/* Some versions of Linux have real-time signal support in the C library, and - some don't. We have to include this file to find out. */ -#include - -#ifdef __SIGRTMIN -#define REALTIME_LO __SIGRTMIN -#define REALTIME_HI (__SIGRTMAX + 1) -#else -#define REALTIME_LO 32 -#define REALTIME_HI 64 -#endif +/* N_FUN symbols in shared libaries have 0 for their values and need + to be relocated. */ +#define SOFUN_ADDRESS_MAYBE_MISSING #endif /* #ifndef TM_LINUX_H */ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 1522f96..2f242a8 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -54,6 +54,7 @@ ppc_register_u_addr (int ustart, int regnum) return (ustart + 4 * regmap[regnum]); } +void supply_gregset (gregset_t * gregsetp) { int regi; @@ -66,6 +67,7 @@ supply_gregset (gregset_t * gregsetp) supply_register (regi, (char *) (regp + regmap[regi])); } +void supply_fpregset (fpregset_t * fpregsetp) { int regi; diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index c9a6812..b7182f9 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -95,6 +95,8 @@ #define PPC_LINUX_PT_FPR31 (PPC_LINUX_PT_FPR0 + 2*31) #define PPC_LINUX_PT_FPSCR (PPC_LINUX_PT_FPR0 + 2*32 + 1) +int ppc_linux_at_sigtramp_return_path (CORE_ADDR pc); + /* Determine if pc is in a signal trampoline... Ha! That's not what this does at all. wait_for_inferior in infrun.c @@ -312,12 +314,19 @@ ppc_linux_frame_saved_pc (struct frame_info *fi) if (fi->signal_handler_caller) { CORE_ADDR regs_addr = - read_memory_integer (fi->frame + PPC_LINUX_REGS_PTR_OFFSET, 4); + read_memory_integer (fi->frame + PPC_LINUX_REGS_PTR_OFFSET, 4); /* return the NIP in the regs array */ return read_memory_integer (regs_addr + 4 * PPC_LINUX_PT_NIP, 4); } - - return rs6000_frame_saved_pc (fi); + else if (fi->next && fi->next->signal_handler_caller) + { + CORE_ADDR regs_addr = + read_memory_integer (fi->next->frame + PPC_LINUX_REGS_PTR_OFFSET, 4); + /* return LNK in the regs array */ + return read_memory_integer (regs_addr + 4 * PPC_LINUX_PT_LNK, 4); + } + else + return rs6000_frame_saved_pc (fi); } void -- 2.7.4