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.
This commit is contained in:
John Gilmore
1992-10-16 10:47:34 +00:00
parent c3bbca3aad
commit 2268d61946
10 changed files with 150 additions and 168 deletions

View File

@@ -1,7 +1,8 @@
/* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger.
/* Native support for the SGI Iris running IRIX version 4, for GDB.
Copyright 1988, 1989, 1990, 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.
Implemented for Irix 4.x by Garrett A. Wollman.
This file is part of GDB.
@@ -21,12 +22,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "defs.h"
/*
* Implemented for Irix 4.x by Garrett A. Wollman
*/
#include <sys/time.h>
#include <sys/procfs.h>
#include <setjmp.h> /* For JB_XXX. */
/* Size of elements in jmpbuf */
#define JB_ELEMENT_SIZE 4
typedef unsigned int greg_t; /* why isn't this defined? */
@@ -124,3 +126,26 @@ fill_fpregset (fpregsetp, regno)
if ((regno == -1) || (regno == FCRCS_REGNUM))
fpregsetp->fp_csr = *(unsigned *) &registers[REGISTER_BYTE(FCRCS_REGNUM)];
}
/* 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;
}