diff options
author | John Gilmore <gnu@cygnus> | 1992-10-16 10:47:34 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1992-10-16 10:47:34 +0000 |
commit | 2268d619462dfcaf7055aede6cde6f7015be29ba (patch) | |
tree | ce9959452b2add6e01740f5860fcc2f73f97cabe /gdb/mips-nat.c | |
parent | c3bbca3aad11d35978fbd96c6672eb4cbe6960f3 (diff) | |
download | gdb-2268d619462dfcaf7055aede6cde6f7015be29ba.zip gdb-2268d619462dfcaf7055aede6cde6f7015be29ba.tar.gz gdb-2268d619462dfcaf7055aede6cde6f7015be29ba.tar.bz2 |
Avoid longjmp()-catching compilation errors in cross-ports.
* doc/gdbint.texinfo: Update GET_LONGJMP_TARGET, L_SET doc.
* irix4-nat.c, mips-nat.c (JB_ELEMENT_SIZE, get_longjmp_target):
Move from mips-tdep.c and tm-{irix3,mips}.h.
* mips-nat.c: Remove a bunch of code that was ifdef'd out of
native MIPS ports.
* nm-irix3.h, nm-mips.h (GET_LONGJMP_TARGET): Move from tm-irix3.h
and tm-mips.h.
* ultra3-nat.c (register_addr): Move from ultra3-xdep.c.
(fetch_core_registers): Fix bfd_seek arguments.
Diffstat (limited to 'gdb/mips-nat.c')
-rw-r--r-- | gdb/mips-nat.c | 69 |
1 files changed, 25 insertions, 44 deletions
diff --git a/gdb/mips-nat.c b/gdb/mips-nat.c index 458f91f..b47f756 100644 --- a/gdb/mips-nat.c +++ b/gdb/mips-nat.c @@ -1,4 +1,4 @@ -/* Low level MIPS interface to ptrace, for GDB when running under Unix. +/* Low level DECstation interface to ptrace, for GDB when running native. Copyright 1988, 1989, 1991, 1992 Free Software Foundation, Inc. Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin. @@ -22,50 +22,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "defs.h" #include "inferior.h" #include "gdbcore.h" +#include <sys/ptrace.h> +#include <setjmp.h> /* For JB_XXX. */ -/* For now we stub this out; sgi core format is super-hairy (and completely - different in the new release). - For most mips systems, this function is defined in coredep.c. */ - -#if defined(sgi) -void -fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) - char *core_reg_sect; - unsigned core_reg_size; - int which; - unsigned int reg_addr; -{ - return; -} -#endif - -/* Access to the inferior is only good for native systems, not cross. - I am not sure why this is stubbed out on SGI... --gnu@cygnus.com */ - -#if defined(sgi) || !defined(GDB_TARGET_IS_MIPS) - -/* ARGSUSED */ -void -fetch_inferior_registers (regno) - int regno; -{ - return; -} - -/* ARGSUSED */ -void -store_inferior_registers (regno) - int regno; -{ - return; -} - - -#else - -/* DECstation native... */ +/* Size of elements in jmpbuf */ -#include <sys/ptrace.h> +#define JB_ELEMENT_SIZE 4 /* Map gdb internal register number to ptrace ``address''. These ``addresses'' are defined in DECstation <sys/ptrace.h> */ @@ -160,6 +122,25 @@ store_inferior_registers (regno) } } -#endif /* sgi */ +/* Figure out where the longjmp will land. + We expect the first arg to be a pointer to the jmp_buf structure from which + we extract the pc (JB_PC) that we will land at. The pc is copied into PC. + This routine returns true on success. */ + +int +get_longjmp_target(pc) + CORE_ADDR *pc; +{ + CORE_ADDR jb_addr; + + jb_addr = read_register(A0_REGNUM); + if (target_read_memory(jb_addr + JB_PC * JB_ELEMENT_SIZE, pc, + sizeof(CORE_ADDR))) + return 0; + + SWAP_TARGET_AND_HOST(pc, sizeof(CORE_ADDR)); + + return 1; +} |