From: Steve Chamberlain Date: Fri, 8 Nov 1991 02:22:46 +0000 (+0000) Subject: Fixed S?IP_OFFSETs for the Motorola Delta 88. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=12f2fd9f1fed0a37bec92d996b871fb40205b351;p=binutils-gdb.git Fixed S?IP_OFFSETs for the Motorola Delta 88. --- diff --git a/gdb/m88k-xdep.c b/gdb/m88k-xdep.c index 2247b15e1e5..5ecd12df306 100644 --- a/gdb/m88k-xdep.c +++ b/gdb/m88k-xdep.c @@ -31,8 +31,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "gdbcore.h" #include -#ifndef USER /* added to support BCS ptrace_user */ +#ifndef USER /* added to support BCS ptrace_user */ #define USER ptrace_user #endif #include @@ -44,14 +44,20 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "setjmp.h" #include "value.h" -/* define offsets to the pc instruction offsets in ptrace_user struct */ -#define SXIP_OFFSET (char *)&u.pt_sigframe.dg_sigframe.sc_sxip - \ - (char *)&u - -#define SNIP_OFFSET (char *)&u.pt_sigframe.dg_sigframe.sc_snip - \ - (char *)&u +#ifdef DELTA88 +#include +/* define offsets to the pc instruction offsets in ptrace_user struct */ +#define SXIP_OFFSET (char *)&u.pt_sigframe.sig_sxip - (char *)&u +#define SNIP_OFFSET (char *)&u.pt_sigframe.sig_snip - (char *)&u +#define SFIP_OFFSET (char *)&u.pt_sigframe.sig_sfip - (char *)&u +#else +/* define offsets to the pc instruction offsets in ptrace_user struct */ +#define SXIP_OFFSET (char *)&u.pt_sigframe.dg_sigframe.sc_sxip - (char *)&u +#define SNIP_OFFSET (char *)&u.pt_sigframe.dg_sigframe.sc_snip - (char *)&u #define SFIP_OFFSET (char *)&u.pt_sigframe.dg_sigframe.sc_sfip - (char *)&u +#endif + extern int have_symbol_file_p(); extern jmp_buf stack_jmp; @@ -87,11 +93,11 @@ fetch_inferior_registers () supply_register (regno, buf); } /* now load up registers 36 - 38; special pc registers */ - *(int *) &buf[0] = ptrace (3,inferior_pid,(char *)&u.pt_sigframe.dg_sigframe.sc_sxip - (char *)&u ,0); + *(int *) &buf[0] = ptrace (3,inferior_pid,SXIP_OFFSET ,0); supply_register (SXIP_REGNUM, buf); - *(int *) &buf[0] = ptrace (3, inferior_pid, (char *)&u.pt_sigframe.dg_sigframe.sc_snip - (char *)&u ,0); + *(int *) &buf[0] = ptrace (3, inferior_pid,SNIP_OFFSET,0); supply_register (SNIP_REGNUM, buf); - *(int *) &buf[0] = ptrace (3, inferior_pid, (char *)&u.pt_sigframe.dg_sigframe.sc_sfip - (char *)&u ,0); + *(int *) &buf[0] = ptrace (3, inferior_pid,SFIP_OFFSET,0); supply_register (SFIP_REGNUM, buf); } @@ -107,18 +113,9 @@ store_inferior_registers (regno) struct USER u; -#if defined(BCS) -#if defined(DGUX) unsigned int offset = (char *) &u.pt_r0 - (char *) &u; -#endif /* defined (DGUX) */ -#else - - unsigned int offset = (char *) &u.pt_r0 - (char *) &u; - -#endif /* defined(BCS) */ -/* offset = ptrace (3, inferior_pid, offset, 0) - KERNEL_U_ADDR; */ regaddr = offset; if (regno >= 0)