Delete IRIX support

This does most of the mechanical removal.  IOW, the easy part.

This doesn't touch procfs.c as that'd be a harder excision,
potentially affecting Solaris.

mips-tdep.c is left alone.  E.g., I didn't delete the GDB_OSABI_IRIX
enum value, nor references to it in mips-tdep.c.  Some comments
mentioning IRIX ABIs may still be relevant and I wouldn't know what to
do with them. in That can always be done on a separate pass,
preferably by someone who can test on MIPS.

I didn't remove a reference to IRIX in testsuite/lib/future.exp, as I
believe that code is imported from DejaGNU.

Built and tested on x86_64 Fedora 20, with --enable-targets=all.

Tested that building for --target=mips-sgi-irix6 on x86_64 Fedora 20
fails with:

 checking for default auto-load directory... $debugdir:$datadir/auto-load
 checking for default auto-load safe-path... $debugdir:$datadir/auto-load
 *** Configuration mips-sgi-irix6 is obsolete.
 *** Support has been REMOVED.
 make[1]: *** [configure-gdb] Error 1
 make[1]: Leaving directory `/home/pedro/gdb/mygit/build-irix'
 make: *** [all] Error 2

gdb/
2014-10-10  Pedro Alves  <palves@redhat.com>

	* Makefile.in (ALL_TARGET_OBS): Remove mips-irix-tdep.o and solib-irix.o.
	(ALLDEPFILES): Remove mips-irix-tdep.c and solib-irix.c.
	(HFILES_NO_SRCDIR): Remove solib-irix.h.
	* NEWS: Mention that support for mips-sgi-irix5* mips-sgi-irix6*
	and been removed.
	* config/mips/irix5.mh, config/mips/irix6.mh: Delete files.
	* configure.ac: Remove references to IRIX.
	* configure.host: Add *-*-irix* to the obsolete hosts section.
	Remove all other references to irix.
	* irix5-nat.c, mips-irix-tdep.c, solib-irix.c, solib-irix.h:
	Delete files.

gdb/testsuite/
2014-10-10  Pedro Alves  <palves@redhat.com>

	* gdb.base/bigcore.exp: Remove references to IRIX.
	* gdb.base/funcargs.exp: Likewise.
	* gdb.base/interrupt.exp: Likewise.
	* gdb.base/mips_pro.exp: Likewise.
	* gdb.base/nodebug.exp: Likewise.
	* gdb.base/setvar.exp: Likewise.
	* lib/gdb.exp (gdb_compile_shlib): Remove mips-sgi-irix* case.
This commit is contained in:
Pedro Alves 2014-10-10 18:18:52 +01:00
parent cc3afae25a
commit 3831839c08
23 changed files with 52 additions and 1321 deletions

View file

@ -1,3 +1,17 @@
2014-10-10 Pedro Alves <palves@redhat.com>
* Makefile.in (ALL_TARGET_OBS): Remove mips-irix-tdep.o and solib-irix.o.
(ALLDEPFILES): Remove mips-irix-tdep.c and solib-irix.c.
(HFILES_NO_SRCDIR): Remove solib-irix.h.
* NEWS: Mention that support for mips-sgi-irix5* mips-sgi-irix6*
and been removed.
* config/mips/irix5.mh, config/mips/irix6.mh: Delete files.
* configure.ac: Remove references to IRIX.
* configure.host: Add *-*-irix* to the obsolete hosts section.
Remove all other references to irix.
* irix5-nat.c, mips-irix-tdep.c, solib-irix.c, solib-irix.h:
Delete files.
2014-10-10 Ajit Agarwal <ajitkum@xilinx.com>
* microblaze-tdep.c (microblaze_gdbarch_init): If the description

View file

@ -644,7 +644,7 @@ ALL_TARGET_OBS = \
m88k-tdep.o \
mep-tdep.o \
microblaze-tdep.o microblaze-linux-tdep.o \
mips-irix-tdep.o mips-linux-tdep.o \
mips-linux-tdep.o \
mipsnbsd-tdep.o mips-tdep.o \
mn10300-linux-tdep.o mn10300-tdep.o \
moxie-tdep.o \
@ -673,7 +673,7 @@ ALL_TARGET_OBS = \
bsd-uthread.o \
nbsd-tdep.o obsd-tdep.o \
sol2-tdep.o \
solib-frv.o solib-irix.o solib-svr4.o \
solib-frv.o solib-svr4.o \
solib-som.o solib-pa64.o solib-darwin.o solib-dsbt.o \
dbug-rom.o dink32-rom.o ppcbug-rom.o m32r-rom.o dsrec.o monitor.o \
remote-m32r-sdi.o remote-mips.o \
@ -903,7 +903,7 @@ interps.h auxv.h gdbcmd.h tramp-frame.h mipsnbsd-tdep.h \
amd64-linux-tdep.h linespec.h i387-tdep.h mn10300-tdep.h \
sparc64-tdep.h monitor.h ppcobsd-tdep.h srec.h solib-pa64.h \
coff-pe-read.h parser-defs.h gdb_ptrace.h mips-linux-tdep.h \
m68k-tdep.h spu-tdep.h jv-lang.h environ.h solib-irix.h amd64-tdep.h \
m68k-tdep.h spu-tdep.h jv-lang.h environ.h amd64-tdep.h \
doublest.h regset.h hppa-tdep.h ppc-linux-tdep.h ppc64-tdep.h \
rs6000-tdep.h rs6000-aix-tdep.h \
common/gdb_locale.h arch-utils.h trad-frame.h gnu-nat.h \
@ -1661,7 +1661,6 @@ ALLDEPFILES = \
microblaze-tdep.c microblaze-linux-tdep.c \
mingw-hdep.c \
mips-linux-nat.c mips-linux-tdep.c \
mips-irix-tdep.c \
mips-tdep.c \
mipsnbsd-nat.c mipsnbsd-tdep.c \
mips64obsd-nat.c mips64obsd-tdep.c \
@ -1689,7 +1688,7 @@ ALLDEPFILES = \
ser-go32.c ser-pipe.c ser-tcp.c ser-mingw.c \
sh-tdep.c sh64-tdep.c shnbsd-tdep.c shnbsd-nat.c \
sol2-tdep.c \
solib-irix.c solib-svr4.c \
solib-svr4.c \
sparc-linux-nat.c sparc-linux-tdep.c \
sparc-sol2-nat.c sparc-sol2-tdep.c sparc64-sol2-tdep.c \
sparc-nat.c sparc-tdep.c sparc64-linux-nat.c sparc64-linux-tdep.c \

View file

@ -45,6 +45,13 @@ queue-signal signal-name-or-number
** The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
* Removed targets
Support for these obsolete configurations has been removed.
mips-sgi-irix5*
mips-sgi-irix6*
*** Changes in GDB 7.8
* New command line options

View file

@ -1,4 +0,0 @@
# Host: SGI Iris running irix 5.x
NATDEPFILES= fork-child.o irix5-nat.o procfs.o \
proc-api.o proc-events.o proc-flags.o proc-why.o
HAVE_NATIVE_GCORE_HOST = 1

View file

@ -1,4 +0,0 @@
# Host: SGI Iris running irix 6.x
NATDEPFILES= fork-child.o irix5-nat.o procfs.o \
proc-api.o proc-events.o proc-flags.o proc-why.o
HAVE_NATIVE_GCORE_HOST = 1

13
gdb/configure vendored
View file

@ -8716,15 +8716,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
$as_echo "${PYTHON_CFLAGS}" >&6; }
fi
# On IRIX, type siginfo is not defined. Instead, sys/siginfo.h provides:
# #if _SGIAPI
# #define siginfo __siginfo
# #endif
# The problem is that including Python causes some XOPEN macros to be
# unilaterally defined, and that in turn causes _SGIAPI to evaluate
# to false. So, we work around this issue by defining siginfo ourself
# though the command-line.
#
# On x64 Windows, Python's include headers, and pyconfig.h in
# particular, rely on MS_WIN64 macro to detect that it's a 64bit
# version of Windows. Unfortunately, MS_WIN64 is only defined if
@ -8734,10 +8725,6 @@ $as_echo "${PYTHON_CFLAGS}" >&6; }
# solved as of 2012-10-02 (http://bugs.python.org/issue4709).
case "$gdb_host" in
irix*) if test "${GCC}" = yes; then
CPPFLAGS="$CPPFLAGS -Dsiginfo=__siginfo"
fi
;;
mingw64)
if test "${GCC}" = yes; then
CPPFLAGS="$CPPFLAGS -DMS_WIN64"

View file

@ -999,15 +999,6 @@ if test "${have_libpython}" != no; then
AC_MSG_RESULT(${PYTHON_CFLAGS})
fi
# On IRIX, type siginfo is not defined. Instead, sys/siginfo.h provides:
# #if _SGIAPI
# #define siginfo __siginfo
# #endif
# The problem is that including Python causes some XOPEN macros to be
# unilaterally defined, and that in turn causes _SGIAPI to evaluate
# to false. So, we work around this issue by defining siginfo ourself
# though the command-line.
#
# On x64 Windows, Python's include headers, and pyconfig.h in
# particular, rely on MS_WIN64 macro to detect that it's a 64bit
# version of Windows. Unfortunately, MS_WIN64 is only defined if
@ -1017,10 +1008,6 @@ if test "${have_libpython}" != no; then
# solved as of 2012-10-02 (http://bugs.python.org/issue4709).
case "$gdb_host" in
irix*) if test "${GCC}" = yes; then
CPPFLAGS="$CPPFLAGS -Dsiginfo=__siginfo"
fi
;;
mingw64)
if test "${GCC}" = yes; then
CPPFLAGS="$CPPFLAGS -DMS_WIN64"

View file

@ -19,6 +19,7 @@ case $host in
sparc-*-netbsdelf* | \
vax-*-netbsdelf*)
;;
*-*-irix* | \
alpha*-*-osf1* | \
alpha*-*-osf2* | \
arm*-*-netbsd* | \
@ -126,8 +127,6 @@ m68*-*-openbsd*) gdb_host=obsd ;;
m88*-*-openbsd*) gdb_host=obsd ;;
mips-sgi-irix5*) gdb_host=irix5 ;;
mips-sgi-irix6*) gdb_host=irix6 ;;
mips*-*-linux*) gdb_host=linux ;;
mips*-*-netbsd* | mips*-*-knetbsd*-gnu)
gdb_host=nbsd ;;

View file

@ -13,6 +13,7 @@
# in Makefile.in!
case $targ in
*-*-irix* | \
d10v-*-* | \
hppa*-*-hiux* | \
i[34567]86-ncr-* | \
@ -350,14 +351,6 @@ microblaze*-*-*)
gdb_sim=../sim/microblaze/libsim.a
;;
mips*-sgi-irix5*)
# Target: MIPS SGI running Irix 5
gdb_target_obs="mips-tdep.o mips-irix-tdep.o solib-irix.o"
;;
mips*-sgi-irix6*)
# Target: MIPS SGI running Irix 6.x
gdb_target_obs="mips-tdep.o mips-irix-tdep.o solib-irix.o"
;;
mips*-*-linux*)
# Target: Linux/MIPS
gdb_target_obs="mips-tdep.o mips-linux-tdep.o glibc-tdep.o \

View file

@ -1,272 +0,0 @@
/* Native support for the SGI Iris running IRIX version 5, for GDB.
Copyright (C) 1988-2014 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.
Modified for Irix 5.x by Ian Lance Taylor.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "inferior.h"
#include "gdbcore.h"
#include "target.h"
#include "regcache.h"
#include "procfs.h"
#include <sys/time.h>
#include <sys/procfs.h>
#include <setjmp.h> /* For JB_XXX. */
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
#include "mips-tdep.h"
static void fetch_core_registers (struct regcache *, char *,
unsigned int, int, CORE_ADDR);
/*
* See the comment in m68k-tdep.c regarding the utility of these functions.
*
* These definitions are from the MIPS SVR4 ABI, so they may work for
* any MIPS SVR4 target.
*/
void
supply_gregset (struct regcache *regcache, const gregset_t *gregsetp)
{
int regi;
const greg_t *regp = &(*gregsetp)[0];
struct gdbarch *gdbarch = get_regcache_arch (regcache);
int gregoff = sizeof (greg_t) - mips_isa_regsize (gdbarch);
static char zerobuf[32] = {0};
for (regi = 0; regi <= CTX_RA; regi++)
regcache_raw_supply (regcache, regi,
(const char *) (regp + regi) + gregoff);
regcache_raw_supply (regcache, mips_regnum (gdbarch)->pc,
(const char *) (regp + CTX_EPC) + gregoff);
regcache_raw_supply (regcache, mips_regnum (gdbarch)->hi,
(const char *) (regp + CTX_MDHI) + gregoff);
regcache_raw_supply (regcache, mips_regnum (gdbarch)->lo,
(const char *) (regp + CTX_MDLO) + gregoff);
regcache_raw_supply (regcache, mips_regnum (gdbarch)->cause,
(const char *) (regp + CTX_CAUSE) + gregoff);
/* Fill inaccessible registers with zero. */
regcache_raw_supply (regcache, mips_regnum (gdbarch)->badvaddr, zerobuf);
}
void
fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno)
{
int regi, size;
greg_t *regp = &(*gregsetp)[0];
gdb_byte buf[MAX_REGISTER_SIZE];
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
/* Under Irix6, if GDB is built with N32 ABI and is debugging an O32
executable, we have to sign extend the registers to 64 bits before
filling in the gregset structure. */
for (regi = 0; regi <= CTX_RA; regi++)
if ((regno == -1) || (regno == regi))
{
size = register_size (gdbarch, regi);
regcache_raw_collect (regcache, regi, buf);
*(regp + regi) = extract_signed_integer (buf, size, byte_order);
}
if ((regno == -1) || (regno == mips_regnum (gdbarch)->pc))
{
regi = mips_regnum (gdbarch)->pc;
size = register_size (gdbarch, regi);
regcache_raw_collect (regcache, regi, buf);
*(regp + CTX_EPC) = extract_signed_integer (buf, size, byte_order);
}
if ((regno == -1) || (regno == mips_regnum (gdbarch)->cause))
{
regi = mips_regnum (gdbarch)->cause;
size = register_size (gdbarch, regi);
regcache_raw_collect (regcache, regi, buf);
*(regp + CTX_CAUSE) = extract_signed_integer (buf, size, byte_order);
}
if ((regno == -1) || (regno == mips_regnum (gdbarch)->hi))
{
regi = mips_regnum (gdbarch)->hi;
size = register_size (gdbarch, regi);
regcache_raw_collect (regcache, regi, buf);
*(regp + CTX_MDHI) = extract_signed_integer (buf, size, byte_order);
}
if ((regno == -1) || (regno == mips_regnum (gdbarch)->lo))
{
regi = mips_regnum (gdbarch)->lo;
size = register_size (gdbarch, regi);
regcache_raw_collect (regcache, regi, buf);
*(regp + CTX_MDLO) = extract_signed_integer (buf, size, byte_order);
}
}
/*
* Now we do the same thing for floating-point registers.
* We don't bother to condition on gdbarch_fp0_regnum since any
* reasonable MIPS configuration has an R3010 in it.
*
* Again, see the comments in m68k-tdep.c.
*/
void
supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
{
int regi;
static char zerobuf[32] = {0};
char fsrbuf[8];
struct gdbarch *gdbarch = get_regcache_arch (regcache);
/* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
for (regi = 0; regi < 32; regi++)
regcache_raw_supply (regcache, gdbarch_fp0_regnum (gdbarch) + regi,
(const char *) &fpregsetp->__fp_r.__fp_regs[regi]);
/* We can't supply the FSR register directly to the regcache,
because there is a size issue: On one hand, fpregsetp->fp_csr
is 32bits long, while the regcache expects a 64bits long value.
So we use a buffer of the correct size and copy into it the register
value at the proper location. */
memset (fsrbuf, 0, 4);
memcpy (fsrbuf + 4, &fpregsetp->__fp_csr, 4);
regcache_raw_supply (regcache,
mips_regnum (gdbarch)->fp_control_status, fsrbuf);
/* FIXME: how can we supply FCRIR? SGI doesn't tell us. */
regcache_raw_supply (regcache,
mips_regnum (gdbarch)->fp_implementation_revision,
zerobuf);
}
void
fill_fpregset (const struct regcache *regcache,
fpregset_t *fpregsetp, int regno)
{
int regi;
char *from, *to;
struct gdbarch *gdbarch = get_regcache_arch (regcache);
/* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
for (regi = gdbarch_fp0_regnum (gdbarch);
regi < gdbarch_fp0_regnum (gdbarch) + 32; regi++)
{
if ((regno == -1) || (regno == regi))
{
const int fp0_regnum = gdbarch_fp0_regnum (gdbarch);
to = (char *) &(fpregsetp->__fp_r.__fp_regs[regi - fp0_regnum]);
regcache_raw_collect (regcache, regi, to);
}
}
if (regno == -1
|| regno == mips_regnum (gdbarch)->fp_control_status)
{
char fsrbuf[8];
/* We can't fill the FSR register directly from the regcache,
because there is a size issue: On one hand, fpregsetp->fp_csr
is 32bits long, while the regcache expects a 64bits long buffer.
So we use a buffer of the correct size and copy the register
value from that buffer. */
regcache_raw_collect (regcache,
mips_regnum (gdbarch)->fp_control_status, fsrbuf);
memcpy (&fpregsetp->__fp_csr, fsrbuf + 4, 4);
}
}
/* Provide registers to GDB from a core file.
CORE_REG_SECT points to an array of bytes, which were obtained from
a core file which BFD thinks might contain register contents.
CORE_REG_SIZE is its size.
Normally, WHICH says which register set corelow suspects this is:
0 --- the general-purpose register set
2 --- the floating-point register set
However, for Irix 5, WHICH isn't used.
REG_ADDR is also unused. */
static void
fetch_core_registers (struct regcache *regcache,
char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
char *srcp = core_reg_sect;
struct gdbarch *gdbarch = get_regcache_arch (regcache);
int regsize = mips_isa_regsize (gdbarch);
int regno;
/* If regsize is 8, this is a N32 or N64 core file.
If regsize is 4, this is an O32 core file. */
if (core_reg_size != regsize * gdbarch_num_regs (gdbarch))
{
warning (_("wrong size gregset struct in core file"));
return;
}
for (regno = 0; regno < gdbarch_num_regs (gdbarch); regno++)
{
regcache_raw_supply (regcache, regno, srcp);
srcp += regsize;
}
}
/* Register that we are able to handle irix5 core file formats.
This really is bfd_target_unknown_flavour. */
static struct core_fns irix5_core_fns =
{
bfd_target_unknown_flavour, /* core_flavour */
default_check_format, /* check_format */
default_core_sniffer, /* core_sniffer */
fetch_core_registers, /* core_read_registers */
NULL /* next */
};
/* Provide a prototype to silence -Wmissing-prototypes. */
extern initialize_file_ftype _initialize_irix5_nat;
void
_initialize_irix5_nat (void)
{
struct target_ops *t;
t = procfs_target ();
procfs_use_watchpoints (t);
add_target (t);
deprecated_add_core_fns (&irix5_core_fns);
}

View file

@ -1,294 +0,0 @@
/* Target-dependent code for the MIPS architecture running on IRIX,
for GDB, the GNU Debugger.
Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "osabi.h"
#include "solib.h"
#include "solib-irix.h"
#include "elf-bfd.h"
#include "mips-tdep.h"
#include "trad-frame.h"
#include "tramp-frame.h"
static void
mips_irix_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect,
void *obj)
{
enum gdb_osabi *os_ident_ptr = obj;
const char *name;
unsigned int sectsize;
name = bfd_get_section_name (abfd, sect);
sectsize = bfd_section_size (abfd, sect);
/* The presence of a section named with a ".MIPS." prefix is usually
indicative of an IRIX binary, however there are exceptions that
are present universally, so check for those names and avoid
switching away from the default OS ABI in the case of a match. */
if (strncmp (name, ".MIPS.", 6) == 0
&& strcmp (name, ".MIPS.abiflags") != 0
&& strcmp (name, ".MIPS.options") != 0
&& strcmp (name, ".MIPS.stubs") != 0
&& sectsize > 0)
*os_ident_ptr = GDB_OSABI_IRIX;
}
static enum gdb_osabi
mips_irix_elf_osabi_sniffer (bfd *abfd)
{
unsigned int elfosabi;
enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
/* If the generic sniffer gets a hit, return and let other sniffers
get a crack at it. */
bfd_map_over_sections (abfd,
generic_elf_osabi_sniff_abi_tag_sections,
&osabi);
if (osabi != GDB_OSABI_UNKNOWN)
return GDB_OSABI_UNKNOWN;
elfosabi = elf_elfheader (abfd)->e_ident[EI_OSABI];
if (elfosabi == ELFOSABI_NONE)
{
/* When elfosabi is ELFOSABI_NONE (0), then the ELF structures in the
file are conforming to the base specification for that machine
(there are no OS-specific extensions). In order to determine the
real OS in use we must look for OS notes that have been added.
For IRIX, we simply look for sections named with .MIPS. as
prefixes. */
bfd_map_over_sections (abfd,
mips_irix_elf_osabi_sniff_abi_tag_sections,
&osabi);
}
return osabi;
}
/* Unwinding past the signal handler on mips-irix.
Note: The following has only been tested with N32, but can probably
be made to work with a small number of adjustments.
On mips-irix, the sigcontext_t structure is stored at the base
of the frame established by the _sigtramp function. The definition
of this structure can be found in <sys/signal.h> (comments have been
C++'ified to avoid a collision with the C-style comment delimiters
used by this comment):
typedef struct sigcontext {
__uint32_t sc_regmask; // regs to restore in sigcleanup
__uint32_t sc_status; // cp0 status register
__uint64_t sc_pc; // pc at time of signal
// General purpose registers
__uint64_t sc_regs[32]; // processor regs 0 to 31
// Floating point coprocessor state
__uint64_t sc_fpregs[32]; // fp regs 0 to 31
__uint32_t sc_ownedfp; // fp has been used
__uint32_t sc_fpc_csr; // fpu control and status reg
__uint32_t sc_fpc_eir; // fpu exception instruction reg
// implementation/revision
__uint32_t sc_ssflags; // signal stack state to restore
__uint64_t sc_mdhi; // Multiplier hi and low regs
__uint64_t sc_mdlo;
// System coprocessor registers at time of signal
__uint64_t sc_cause; // cp0 cause register
__uint64_t sc_badvaddr; // cp0 bad virtual address
__uint64_t sc_triggersave; // state of graphics trigger (SGI)
sigset_t sc_sigset; // signal mask to restore
__uint64_t sc_fp_rounded_result; // for Ieee 754 support
__uint64_t sc_pad[31];
} sigcontext_t;
The following macros provide the offset of some of the fields
used to retrieve the value of the registers before the signal
was raised. */
/* The size of the sigtramp frame. The sigtramp frame base can then
be computed by adding this size to the SP. */
#define SIGTRAMP_FRAME_SIZE 48
/* The offset in sigcontext_t where the PC is saved. */
#define SIGCONTEXT_PC_OFF 8
/* The offset in sigcontext_t where the GP registers are saved. */
#define SIGCONTEXT_REGS_OFF (SIGCONTEXT_PC_OFF + 8)
/* The offset in sigcontext_t where the FP regsiters are saved. */
#define SIGCONTEXT_FPREGS_OFF (SIGCONTEXT_REGS_OFF + 32 * 8)
/* The offset in sigcontext_t where the FP CSR register is saved. */
#define SIGCONTEXT_FPCSR_OFF (SIGCONTEXT_FPREGS_OFF + 32 * 8 + 4)
/* The offset in sigcontext_t where the multiplier hi register is saved. */
#define SIGCONTEXT_HI_OFF (SIGCONTEXT_FPCSR_OFF + 2 * 4)
/* The offset in sigcontext_t where the multiplier lo register is saved. */
#define SIGCONTEXT_LO_OFF (SIGCONTEXT_HI_OFF + 4)
/* Implement the "init" routine in struct tramp_frame for the N32 ABI
on mips-irix. */
static void
mips_irix_n32_tramp_frame_init (const struct tramp_frame *self,
struct frame_info *this_frame,
struct trad_frame_cache *this_cache,
CORE_ADDR func)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
const int num_regs = gdbarch_num_regs (gdbarch);
int sp_cooked_regno = num_regs + MIPS_SP_REGNUM;
const CORE_ADDR sp = get_frame_register_signed (this_frame, sp_cooked_regno);
const CORE_ADDR sigcontext_base = sp + 48;
const struct mips_regnum *regs = mips_regnum (gdbarch);
int ireg;
trad_frame_set_reg_addr (this_cache, regs->pc + gdbarch_num_regs (gdbarch),
sigcontext_base + SIGCONTEXT_PC_OFF);
for (ireg = 1; ireg < 32; ireg++)
trad_frame_set_reg_addr (this_cache, ireg + MIPS_ZERO_REGNUM + num_regs,
sigcontext_base + SIGCONTEXT_REGS_OFF + ireg * 8);
for (ireg = 0; ireg < 32; ireg++)
trad_frame_set_reg_addr (this_cache, ireg + regs->fp0 + num_regs,
sigcontext_base + SIGCONTEXT_FPREGS_OFF
+ ireg * 8);
trad_frame_set_reg_addr (this_cache, regs->fp_control_status + num_regs,
sigcontext_base + SIGCONTEXT_FPCSR_OFF);
trad_frame_set_reg_addr (this_cache, regs->hi + num_regs,
sigcontext_base + SIGCONTEXT_HI_OFF);
trad_frame_set_reg_addr (this_cache, regs->lo + num_regs,
sigcontext_base + SIGCONTEXT_LO_OFF);
trad_frame_set_id (this_cache, frame_id_build (sigcontext_base, func));
}
/* The tramp_frame structure describing sigtramp frames on mips-irix N32.
Note that the list of instructions below is pretty much a pure dump
of function _sigtramp on mips-irix. A few instructions are actually
not tested (mask set to 0), because a portion of these instructions
contain an address which changes due to relocation. We could use
a smarter mask that checks the instrutction code alone, but given
the number of instructions already being checked, this seemed
unnecessary. */
static const struct tramp_frame mips_irix_n32_tramp_frame =
{
SIGTRAMP_FRAME,
4,
{
{ 0x3c0c8000, -1 }, /* lui t0,0x8000 */
{ 0x27bdffd0, -1 }, /* addiu sp,sp,-48 */
{ 0x008c6024, -1 }, /* and t0,a0,t0 */
{ 0xffa40018, -1 }, /* sd a0,24(sp) */
{ 0x00000000, 0 }, /* beqz t0,0xfaefcb8 <_sigtramp+40> */
{ 0xffa60028, -1 }, /* sd a2,40(sp) */
{ 0x01806027, -1 }, /* nor t0,t0,zero */
{ 0xffa00020, -1 }, /* sd zero,32(sp) */
{ 0x00000000, 0 }, /* b 0xfaefcbc <_sigtramp+44> */
{ 0x008c2024, -1 }, /* and a0,a0,t0 */
{ 0xffa60020, -1 }, /* sd a2,32(sp) */
{ 0x03e0c025, -1 }, /* move t8,ra */
{ 0x00000000, 0 }, /* bal 0xfaefcc8 <_sigtramp+56> */
{ 0x00000000, -1 }, /* nop */
{ 0x3c0c0007, -1 }, /* lui t0,0x7 */
{ 0x00e0c825, -1 }, /* move t9,a3 */
{ 0x658c80fc, -1 }, /* daddiu t0,t0,-32516 */
{ 0x019f602d, -1 }, /* daddu t0,t0,ra */
{ 0x0300f825, -1 }, /* move ra,t8 */
{ 0x8d8c9880, -1 }, /* lw t0,-26496(t0) */
{ 0x8d8c0000, -1 }, /* lw t0,0(t0) */
{ 0x8d8d0000, -1 }, /* lw t1,0(t0) */
{ 0xffac0008, -1 }, /* sd t0,8(sp) */
{ 0x0320f809, -1 }, /* jalr t9 */
{ 0xffad0010, -1 }, /* sd t1,16(sp) */
{ 0xdfad0010, -1 }, /* ld t1,16(sp) */
{ 0xdfac0008, -1 }, /* ld t0,8(sp) */
{ 0xad8d0000, -1 }, /* sw t1,0(t0) */
{ 0xdfa40020, -1 }, /* ld a0,32(sp) */
{ 0xdfa50028, -1 }, /* ld a1,40(sp) */
{ 0xdfa60018, -1 }, /* ld a2,24(sp) */
{ 0x24020440, -1 }, /* li v0,1088 */
{ 0x0000000c, -1 }, /* syscall */
{ TRAMP_SENTINEL_INSN, -1 }
},
mips_irix_n32_tramp_frame_init
};
/* Implement the "init" routine in struct tramp_frame for the stack-based
trampolines used on mips-irix. */
static void
mips_irix_n32_stack_tramp_frame_init (const struct tramp_frame *self,
struct frame_info *this_frame,
struct trad_frame_cache *this_cache,
CORE_ADDR func)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
const int num_regs = gdbarch_num_regs (gdbarch);
int sp_cooked_regno = num_regs + MIPS_SP_REGNUM;
const CORE_ADDR sp = get_frame_register_signed (this_frame, sp_cooked_regno);
/* The previous frame's PC is stored in RA. */
trad_frame_set_reg_realreg (this_cache, gdbarch_pc_regnum (gdbarch),
num_regs + MIPS_RA_REGNUM);
trad_frame_set_id (this_cache, frame_id_build (sp, func));
}
/* A tramp_frame structure describing the stack-based trampoline
used on mips-irix. These trampolines are created on the stack
before being called. */
static const struct tramp_frame mips_irix_n32_stack_tramp_frame =
{
SIGTRAMP_FRAME,
4,
{
{ 0x8f210000, 0xffff0000 }, /* lw at, N(t9) */
{ 0x8f2f0000, 0xffff0000 }, /* lw t3, M(t9) */
{ 0x00200008, 0xffffffff }, /* jr at */
{ 0x0020c82d, 0xffffffff }, /* move t9, at */
{ TRAMP_SENTINEL_INSN, -1 }
},
mips_irix_n32_stack_tramp_frame_init
};
static void
mips_irix_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
{
set_solib_ops (gdbarch, &irix_so_ops);
tramp_frame_prepend_unwinder (gdbarch, &mips_irix_n32_stack_tramp_frame);
tramp_frame_prepend_unwinder (gdbarch, &mips_irix_n32_tramp_frame);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
extern initialize_file_ftype _initialize_mips_irix_tdep;
void
_initialize_mips_irix_tdep (void)
{
/* Register an ELF OS ABI sniffer for IRIX binaries. */
gdbarch_register_osabi_sniffer (bfd_arch_mips,
bfd_target_elf_flavour,
mips_irix_elf_osabi_sniffer);
gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_IRIX,
mips_irix_init_abi);
}

View file

@ -1,610 +0,0 @@
/* Shared library support for IRIX.
Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file was created using portions of irix5-nat.c originally
contributed to GDB by Ian Lance Taylor.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "symtab.h"
#include "bfd.h"
/* FIXME: ezannoni/2004-02-13 Verify that the include below is
really needed. */
#include "symfile.h"
#include "objfiles.h"
#include "gdbcore.h"
#include "target.h"
#include "inferior.h"
#include "infrun.h"
#include "gdbthread.h"
#include "solist.h"
#include "solib.h"
#include "solib-irix.h"
/* Link map info to include in an allocate so_list entry. Unlike some
of the other solib backends, this (Irix) backend chooses to decode
the link map info obtained from the target and store it as (mostly)
CORE_ADDRs which need no further decoding. This is more convenient
because there are three different link map formats to worry about.
We use a single routine (fetch_lm_info) to read (and decode) the target
specific link map data. */
struct lm_info
{
CORE_ADDR addr; /* address of obj_info or obj_list
struct on target (from which the
following information is obtained). */
CORE_ADDR next; /* address of next item in list. */
CORE_ADDR reloc_offset; /* amount to relocate by */
CORE_ADDR pathname_addr; /* address of pathname */
int pathname_len; /* length of pathname */
};
/* It's not desirable to use the system header files to obtain the
structure of the obj_list or obj_info structs. Therefore, we use a
platform neutral representation which has been derived from the IRIX
header files. */
typedef struct
{
gdb_byte b[4];
}
gdb_int32_bytes;
typedef struct
{
gdb_byte b[8];
}
gdb_int64_bytes;
/* The "old" obj_list struct. This is used with old (o32) binaries.
The ``data'' member points at a much larger and more complicated
struct which we will only refer to by offsets. See
fetch_lm_info(). */
struct irix_obj_list
{
gdb_int32_bytes data;
gdb_int32_bytes next;
gdb_int32_bytes prev;
};
/* The ELF32 and ELF64 versions of the above struct. The oi_magic value
corresponds to the ``data'' value in the "old" struct. When this value
is 0xffffffff, the data will be in one of the following formats. The
``oi_size'' field is used to decide which one we actually have. */
struct irix_elf32_obj_info
{
gdb_int32_bytes oi_magic;
gdb_int32_bytes oi_size;
gdb_int32_bytes oi_next;
gdb_int32_bytes oi_prev;
gdb_int32_bytes oi_ehdr;
gdb_int32_bytes oi_orig_ehdr;
gdb_int32_bytes oi_pathname;
gdb_int32_bytes oi_pathname_len;
};
struct irix_elf64_obj_info
{
gdb_int32_bytes oi_magic;
gdb_int32_bytes oi_size;
gdb_int64_bytes oi_next;
gdb_int64_bytes oi_prev;
gdb_int64_bytes oi_ehdr;
gdb_int64_bytes oi_orig_ehdr;
gdb_int64_bytes oi_pathname;
gdb_int32_bytes oi_pathname_len;
gdb_int32_bytes padding;
};
/* Union of all of the above (plus a split out magic field). */
union irix_obj_info
{
gdb_int32_bytes magic;
struct irix_obj_list ol32;
struct irix_elf32_obj_info oi32;
struct irix_elf64_obj_info oi64;
};
/* MIPS sign extends its 32 bit addresses. We could conceivably use
extract_typed_address here, but to do so, we'd have to construct an
appropriate type. Calling extract_signed_integer seems simpler. */
static CORE_ADDR
extract_mips_address (void *addr, int len, enum bfd_endian byte_order)
{
return extract_signed_integer (addr, len, byte_order);
}
/* Fetch and return the link map data associated with ADDR. Note that
this routine automatically determines which (of three) link map
formats is in use by the target. */
static struct lm_info
fetch_lm_info (CORE_ADDR addr)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct lm_info li;
union irix_obj_info buf;
li.addr = addr;
/* The smallest region that we'll need is for buf.ol32. We'll read
that first. We'll read more of the buffer later if we have to deal
with one of the other cases. (We don't want to incur a memory error
if we were to read a larger region that generates an error due to
being at the end of a page or the like.) */
read_memory (addr, (gdb_byte *) &buf, sizeof (buf.ol32));
if (extract_unsigned_integer (buf.magic.b, sizeof (buf.magic), byte_order)
!= 0xffffffff)
{
/* Use buf.ol32... */
gdb_byte obj_buf[432];
CORE_ADDR obj_addr = extract_mips_address (&buf.ol32.data,
sizeof (buf.ol32.data),
byte_order);
li.next = extract_mips_address (&buf.ol32.next,
sizeof (buf.ol32.next), byte_order);
read_memory (obj_addr, obj_buf, sizeof (obj_buf));
li.pathname_addr = extract_mips_address (&obj_buf[236], 4, byte_order);
li.pathname_len = 0; /* unknown */
li.reloc_offset = extract_mips_address (&obj_buf[196], 4, byte_order)
- extract_mips_address (&obj_buf[248], 4, byte_order);
}
else if (extract_unsigned_integer (buf.oi32.oi_size.b,
sizeof (buf.oi32.oi_size), byte_order)
== sizeof (buf.oi32))
{
/* Use buf.oi32... */
/* Read rest of buffer. */
read_memory (addr + sizeof (buf.ol32),
((gdb_byte *) &buf) + sizeof (buf.ol32),
sizeof (buf.oi32) - sizeof (buf.ol32));
/* Fill in fields using buffer contents. */
li.next = extract_mips_address (&buf.oi32.oi_next,
sizeof (buf.oi32.oi_next), byte_order);
li.reloc_offset = extract_mips_address (&buf.oi32.oi_ehdr,
sizeof (buf.oi32.oi_ehdr),
byte_order)
- extract_mips_address (&buf.oi32.oi_orig_ehdr,
sizeof (buf.oi32.oi_orig_ehdr), byte_order);
li.pathname_addr = extract_mips_address (&buf.oi32.oi_pathname,
sizeof (buf.oi32.oi_pathname),
byte_order);
li.pathname_len = extract_unsigned_integer (buf.oi32.oi_pathname_len.b,
sizeof (buf.oi32.
oi_pathname_len),
byte_order);
}
else if (extract_unsigned_integer (buf.oi64.oi_size.b,
sizeof (buf.oi64.oi_size), byte_order)
== sizeof (buf.oi64))
{
/* Use buf.oi64... */
/* Read rest of buffer. */
read_memory (addr + sizeof (buf.ol32),
((gdb_byte *) &buf) + sizeof (buf.ol32),
sizeof (buf.oi64) - sizeof (buf.ol32));
/* Fill in fields using buffer contents. */
li.next = extract_mips_address (&buf.oi64.oi_next,
sizeof (buf.oi64.oi_next), byte_order);
li.reloc_offset = extract_mips_address (&buf.oi64.oi_ehdr,
sizeof (buf.oi64.oi_ehdr),
byte_order)
- extract_mips_address (&buf.oi64.oi_orig_ehdr,
sizeof (buf.oi64.oi_orig_ehdr), byte_order);
li.pathname_addr = extract_mips_address (&buf.oi64.oi_pathname,
sizeof (buf.oi64.oi_pathname),
byte_order);
li.pathname_len = extract_unsigned_integer (buf.oi64.oi_pathname_len.b,
sizeof (buf.oi64.
oi_pathname_len),
byte_order);
}
else
{
error (_("Unable to fetch shared library obj_info or obj_list info."));
}
return li;
}
/* The symbol which starts off the list of shared libraries. */
#define DEBUG_BASE "__rld_obj_head"
static CORE_ADDR debug_base; /* Base of dynamic linker structures. */
/* Locate the base address of dynamic linker structs.
For both the SunOS and SVR4 shared library implementations, if the
inferior executable has been linked dynamically, there is a single
address somewhere in the inferior's data space which is the key to
locating all of the dynamic linker's runtime structures. This
address is the value of the symbol defined by the macro DEBUG_BASE.
The job of this function is to find and return that address, or to
return 0 if there is no such address (the executable is statically
linked for example).
For SunOS, the job is almost trivial, since the dynamic linker and
all of it's structures are statically linked to the executable at
link time. Thus the symbol for the address we are looking for has
already been added to the minimal symbol table for the executable's
objfile at the time the symbol file's symbols were read, and all we
have to do is look it up there. Note that we explicitly do NOT want
to find the copies in the shared library.
The SVR4 version is much more complicated because the dynamic linker
and it's structures are located in the shared C library, which gets
run as the executable's "interpreter" by the kernel. We have to go
to a lot more work to discover the address of DEBUG_BASE. Because
of this complexity, we cache the value we find and return that value
on subsequent invocations. Note there is no copy in the executable
symbol tables.
Irix 5 is basically like SunOS.
Note that we can assume nothing about the process state at the time
we need to find this address. We may be stopped on the first instruc-
tion of the interpreter (C shared library), the first instruction of
the executable itself, or somewhere else entirely (if we attached
to the process for example). */
static CORE_ADDR
locate_base (void)
{
struct bound_minimal_symbol msymbol;
CORE_ADDR address = 0;
msymbol = lookup_minimal_symbol (DEBUG_BASE, NULL, symfile_objfile);
if ((msymbol.minsym != NULL) && (BMSYMBOL_VALUE_ADDRESS (msymbol) != 0))
{
address = BMSYMBOL_VALUE_ADDRESS (msymbol);
}
return (address);
}
/* Arrange for dynamic linker to hit breakpoint.
This functions inserts a breakpoint at the entry point of the
main executable, where all shared libraries are mapped in. */
static int
enable_break (void)
{
if (symfile_objfile != NULL && has_stack_frames ())
{
CORE_ADDR entry_point;
if (entry_point_address_query (&entry_point))
{
create_solib_event_breakpoint (target_gdbarch (), entry_point);
return 1;
}
}
return 0;
}
/* Implement the "handle_event" target_solib_ops method. */
static void
irix_solib_handle_event (void)
{
/* We are now at the "mapping complete" breakpoint, we no longer
need it. Note that it is possible that we have stopped at a
location that is different from the location where we inserted
our breakpoint: On mips-irix, we can actually land in
__dbx_link(), so we should not check the PC against our
breakpoint address here. See procfs.c for more details. Note
we're being called by the bpstat handling code, and so can't
delete the breakpoint immediately. Mark it for later deletion,
which has the same effect (it'll be removed before we next resume
or if we're stopping). */
remove_solib_event_breakpoints_at_next_stop ();
/* The caller calls solib_add, which will add any shared libraries
that were mapped in. */
}
/* Implement the "create_inferior_hook" target_solib_ops method.
For SunOS executables, this first instruction is typically the
one at "_start", or a similar text label, regardless of whether
the executable is statically or dynamically linked. The runtime
startup code takes care of dynamically linking in any shared
libraries, once gdb allows the inferior to continue.
For SVR4 executables, this first instruction is either the first
instruction in the dynamic linker (for dynamically linked
executables) or the instruction at "start" for statically linked
executables. For dynamically linked executables, the system
first exec's /lib/libc.so.N, which contains the dynamic linker,
and starts it running. The dynamic linker maps in any needed
shared libraries, maps in the actual user executable, and then
jumps to "start" in the user executable.
For both SunOS shared libraries, and SVR4 shared libraries, we
can arrange to cooperate with the dynamic linker to discover the
names of shared libraries that are dynamically linked, and the
base addresses to which they are linked.
This function is responsible for discovering those names and
addresses, and saving sufficient information about them to allow
their symbols to be read at a later time.
FIXME
Between enable_break() and disable_break(), this code does not
properly handle hitting breakpoints which the user might have
set in the startup code or in the dynamic linker itself. Proper
handling will probably have to wait until the implementation is
changed to use the "breakpoint handler function" method.
Also, what if child has exit()ed? Must exit loop somehow. */
static void
irix_solib_create_inferior_hook (int from_tty)
{
struct inferior *inf;
struct thread_info *tp;
inf = current_inferior ();
/* If we are attaching to the inferior, the shared libraries
have already been mapped, so nothing more to do. */
if (inf->attach_flag)
return;
/* Likewise when debugging from a core file, the shared libraries
have already been mapped, so nothing more to do. */
if (!target_can_run (&current_target))
return;
if (!enable_break ())
{
warning (_("shared library handler failed to enable breakpoint"));
return;
}
/* The target will eventually hit the breakpoint, at which point all
of the libraries will have been mapped in and we can go groveling
around in the dynamic linker structures to find out what we need
to know about them. */
}
/* Implement the "current_sos" target_so_ops method. */
static struct so_list *
irix_current_sos (void)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int addr_size = gdbarch_addr_bit (target_gdbarch ()) / TARGET_CHAR_BIT;
CORE_ADDR lma;
gdb_byte addr_buf[8];
struct so_list *head = 0;
struct so_list **link_ptr = &head;
int is_first = 1;
struct lm_info lm;
/* Make sure we've looked up the inferior's dynamic linker's base
structure. */
if (!debug_base)
{
debug_base = locate_base ();
/* If we can't find the dynamic linker's base structure, this
must not be a dynamically linked executable. Hmm. */
if (!debug_base)
return 0;
}
read_memory (debug_base, addr_buf, addr_size);
lma = extract_mips_address (addr_buf, addr_size, byte_order);
while (lma)
{
lm = fetch_lm_info (lma);
if (!is_first)
{
int errcode;
char *name_buf;
int name_size;
struct so_list *new
= (struct so_list *) xmalloc (sizeof (struct so_list));
struct cleanup *old_chain = make_cleanup (xfree, new);
memset (new, 0, sizeof (*new));
new->lm_info = xmalloc (sizeof (struct lm_info));
make_cleanup (xfree, new->lm_info);
*new->lm_info = lm;
/* Extract this shared object's name. */
name_size = lm.pathname_len;
if (name_size == 0)
name_size = SO_NAME_MAX_PATH_SIZE - 1;
if (name_size >= SO_NAME_MAX_PATH_SIZE)
{
name_size = SO_NAME_MAX_PATH_SIZE - 1;
warning (_("current_sos: truncating name of "
"%d characters to only %d characters"),
lm.pathname_len, name_size);
}
target_read_string (lm.pathname_addr, &name_buf,
name_size, &errcode);
if (errcode != 0)
warning (_("Can't read pathname for load map: %s."),
safe_strerror (errcode));
else
{
strncpy (new->so_name, name_buf, name_size);
new->so_name[name_size] = '\0';
xfree (name_buf);
strcpy (new->so_original_name, new->so_name);
}
new->next = 0;
*link_ptr = new;
link_ptr = &new->next;
discard_cleanups (old_chain);
}
is_first = 0;
lma = lm.next;
}
return head;
}
/* Implement the "open_symbol_file_object" target_so_ops method.
If no open symbol file, attempt to locate and open the main symbol
file. On IRIX, this is the first link map entry. If its name is
here, we can open it. Useful when attaching to a process without
first loading its symbol file. */
static int
irix_open_symbol_file_object (void *from_ttyp)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int addr_size = gdbarch_addr_bit (target_gdbarch ()) / TARGET_CHAR_BIT;
CORE_ADDR lma;
gdb_byte addr_buf[8];
struct lm_info lm;
struct cleanup *cleanups;
int errcode;
int from_tty = *(int *) from_ttyp;
char *filename;
if (symfile_objfile)
if (!query (_("Attempt to reload symbols from process? ")))
return 0;
if ((debug_base = locate_base ()) == 0)
return 0; /* failed somehow... */
/* First link map member should be the executable. */
read_memory (debug_base, addr_buf, addr_size);
lma = extract_mips_address (addr_buf, addr_size, byte_order);
if (lma == 0)
return 0; /* failed somehow... */
lm = fetch_lm_info (lma);
if (lm.pathname_addr == 0)
return 0; /* No filename. */
/* Now fetch the filename from target memory. */
target_read_string (lm.pathname_addr, &filename, SO_NAME_MAX_PATH_SIZE - 1,
&errcode);
if (errcode)
{
warning (_("failed to read exec filename from attached file: %s"),
safe_strerror (errcode));
return 0;
}
cleanups = make_cleanup (xfree, filename);
/* Have a pathname: read the symbol file. */
symbol_file_add_main (filename, from_tty);
do_cleanups (cleanups);
return 1;
}
/* Implement the "special_symbol_handling" target_so_ops method.
For IRIX, there's nothing to do. */
static void
irix_special_symbol_handling (void)
{
}
/* Using the solist entry SO, relocate the addresses in SEC. */
static void
irix_relocate_section_addresses (struct so_list *so,
struct target_section *sec)
{
sec->addr += so->lm_info->reloc_offset;
sec->endaddr += so->lm_info->reloc_offset;
}
/* Free the lm_info struct. */
static void
irix_free_so (struct so_list *so)
{
xfree (so->lm_info);
}
/* Clear backend specific state. */
static void
irix_clear_solib (void)
{
debug_base = 0;
}
/* Return 1 if PC lies in the dynamic symbol resolution code of the
run time loader. */
static int
irix_in_dynsym_resolve_code (CORE_ADDR pc)
{
return 0;
}
struct target_so_ops irix_so_ops;
/* Provide a prototype to silence -Wmissing-prototypes. */
extern initialize_file_ftype _initialize_irix_solib;
void
_initialize_irix_solib (void)
{
irix_so_ops.relocate_section_addresses = irix_relocate_section_addresses;
irix_so_ops.free_so = irix_free_so;
irix_so_ops.clear_solib = irix_clear_solib;
irix_so_ops.solib_create_inferior_hook = irix_solib_create_inferior_hook;
irix_so_ops.special_symbol_handling = irix_special_symbol_handling;
irix_so_ops.current_sos = irix_current_sos;
irix_so_ops.open_symbol_file_object = irix_open_symbol_file_object;
irix_so_ops.in_dynsym_resolve_code = irix_in_dynsym_resolve_code;
irix_so_ops.bfd_open = solib_bfd_open;
irix_so_ops.handle_event = irix_solib_handle_event;
}

View file

@ -1,26 +0,0 @@
/* Handle shared libraries for GDB, the GNU Debugger.
Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef SOLIB_IRIX_H
#define SOLIB_IRIX_H
struct target_so_ops;
extern struct target_so_ops irix_so_ops;
#endif /* solib-irix.h */

View file

@ -1,3 +1,13 @@
2014-10-10 Pedro Alves <palves@redhat.com>
* gdb.base/bigcore.exp: Remove references to IRIX.
* gdb.base/funcargs.exp: Likewise.
* gdb.base/interrupt.exp: Likewise.
* gdb.base/mips_pro.exp: Likewise.
* gdb.base/nodebug.exp: Likewise.
* gdb.base/setvar.exp: Likewise.
* lib/gdb.exp (gdb_compile_shlib): Remove mips-sgi-irix* case.
2014-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
Pedro Alves <palves@redhat.com>

View file

@ -39,13 +39,6 @@ if { [istarget "*-*-*bsd*"]
return
}
# This testcase causes too much stress (in terms of memory usage)
# on certain systems...
if { [istarget "*-*-*irix*"] } {
untested "Testcase too stressful for this system"
return
}
standard_testfile .c
set corefile [standard_output_file ${binfile}.corefile]

View file

@ -158,7 +158,7 @@ proc float_and_integral_args {} {
# Run; should stop at call2a and print actual arguments.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_run_cmd
set test "run to call2a"
gdb_test_multiple "" $test {
@ -181,7 +181,6 @@ proc float_and_integral_args {} {
gdb_test "print d2" ".* = 5" "print d2 after run to call2a"
setup_xfail "rs6000-*-*"
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
# Continue; should stop at call2b and print actual arguments.
if [gdb_test "cont" ".* call2b \\(f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a'\\) .*" "continue to call2b"] {
gdb_suppress_tests
@ -486,10 +485,6 @@ proc discard_and_shuffle {} {
setup_xfail "rs6000-*-*"
if {!$gcc_compiled} {
setup_xfail "mips-sgi-irix5*"
}
gdb_test_multiple "backtrace 100" "backtrace from call6a" {
-re " call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .* main \\(.*\\) .*$gdb_prompt $" {
pass "backtrace from call6a"
@ -710,7 +705,7 @@ proc shuffle_round_robin {} {
gdb_run_cmd
gdb_test "" "Breakpoint $decimal, call7a .*" "run to call7a"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test_multiple "backtrace 100" "backtrace from call7a" {
-re " call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .* main \\(.*\\) .*$gdb_prompt $" {
pass "backtrace from call7a"
@ -863,7 +858,6 @@ proc shuffle_round_robin {} {
gdb_continue call7k
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
gdb_test_sequence "backtrace 100" "backtrace from call7k" {
"\[\r\n\]#0 .* call7k \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
"\[\r\n\]#1 .* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\) "

View file

@ -119,7 +119,6 @@ if ![file exists $binfile] then {
setup_xfail "vax-*-*"
setup_xfail "alpha-*-*"
setup_xfail "*-*-*bsd*"
setup_xfail "*-*-irix*"
setup_xfail "*-*-hpux*"
setup_xfail "*-*-*lynx*"
fail "call function when asleep (stays asleep)"

View file

@ -40,7 +40,7 @@ if [runto middle] then {
# warning: Hit heuristic-fence-post without finding
# warning: enclosing function for pc 0x1006ead0
if { [test_compiler_info gcc-*-*] } then {
setup_xfail "mips*-sgi-irix4*" "mips64*-*-elf"
setup_xfail "mips64*-*-elf"
}
# The call chain is main -> top -> middle. But gcc can optimize a tail
# call to a jump, so the stack may contain either main -> top -> middle

View file

@ -58,29 +58,17 @@ if [runto inner] then {
# On alpha (and other ecoff systems) the native compilers put
# out debugging info for non-aggregate return values of functions
# even without -g, which should be accepted.
# Irix5, even though it is ELF, counts as "ecoff" because it
# encapsulates ecoff debugging info in a .mdebug section.
# Irix6 gcc emits no debug info at all for static functions and
# variables, so all tests involving statics fail.
if {![test_compiler_info "gcc-*"]} then { setup_xfail "mips-sgi-irix5*" "mips-sgi-irix6*" }
gdb_test "p top" \
"\{(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))\} \[0-9a-fx]* <\\.?top(\\(int\\)|)>"
if {![test_compiler_info "gcc-*"]} then { setup_xfail "mips-sgi-irix5*" "mips-sgi-irix6*" }
gdb_test "whatis top" \
"(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))"
if {![test_compiler_info "gcc-*"]} then { setup_xfail "mips-sgi-irix6*" }
gdb_test "ptype top" "(short|int) \\((|void|int|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
if {![test_compiler_info "gcc-*"]} then { setup_xfail "mips-sgi-irix5*" }
setup_xfail "mips-sgi-irix6*"
gdb_test "p middle" \
"\{(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))\} \[0-9a-fx]* <\\.?middle(\\(int\\)|)>"
if {![test_compiler_info "gcc-*"]} then { setup_xfail "mips-sgi-irix5*" }
setup_xfail "mips-sgi-irix6*"
gdb_test "whatis middle" \
"(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))"
setup_xfail "mips-sgi-irix6*"
gdb_test "ptype middle" "(short|int) \\((|void|int|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
gdb_test "p dataglobal" "= 3"
@ -93,9 +81,7 @@ if [runto inner] then {
# doesn't know the variables exist at all.
setup_xfail "rs6000*-*-aix*"
setup_xfail "powerpc*-*-aix*"
if [test_compiler_info "gcc-*"] {
setup_xfail "mips-sgi-irix6*"
} else {
if ![test_compiler_info "gcc-*"] {
setup_xfail "hppa*-*-hpux*"
}
@ -103,9 +89,7 @@ if [runto inner] then {
setup_xfail "rs6000*-*-aix*"
setup_xfail "powerpc*-*-aix*"
if [test_compiler_info "gcc-*"] {
setup_xfail "mips-sgi-irix6*"
} else {
if ![test_compiler_info "gcc-*"] {
setup_xfail "hppa*-*-hpux*"
}
@ -113,9 +97,7 @@ if [runto inner] then {
setup_xfail "rs6000*-*-aix*"
setup_xfail "powerpc*-*-aix*"
if [test_compiler_info "gcc-*"] {
setup_xfail "mips-sgi-irix6*"
} else {
if ![test_compiler_info "gcc-*"] {
setup_xfail "hppa*-*-hpux*"
}
@ -126,9 +108,7 @@ if [runto inner] then {
setup_xfail "rs6000*-*-aix*"
setup_xfail "powerpc*-*-aix*"
if [test_compiler_info "gcc-*"] {
setup_xfail "mips-sgi-irix6*"
} else {
if ![test_compiler_info "gcc-*"] {
setup_xfail "hppa*-*-hpux*"
}
@ -136,9 +116,7 @@ if [runto inner] then {
setup_xfail "rs6000*-*-aix*"
setup_xfail "powerpc*-*-aix*"
if [test_compiler_info "gcc-*"] {
setup_xfail "mips-sgi-irix6*"
} else {
if ![test_compiler_info "gcc-*"] {
setup_xfail "hppa*-*-hpux*"
}
@ -146,17 +124,11 @@ if [runto inner] then {
setup_xfail "rs6000*-*-aix*"
setup_xfail "powerpc*-*-aix*"
if [test_compiler_info "gcc-*"] {
setup_xfail "mips-sgi-irix6*"
} else {
if ![test_compiler_info "gcc-*"] {
setup_xfail "hppa*-*-hpux*"
}
gdb_test "ptype bsslocal" "<(data variable|variable), no debug info>"
if [test_compiler_info "gcc-*"] {
setup_xfail "mips-sgi-irix6*"
}
gdb_test "backtrace 10" "#0.*inner.*#1.*middle.*#2.*top.*#3.*main.*" \
"backtrace from inner in nodebug.exp"
# Or if that doesn't work, at least hope for the external symbols
@ -167,9 +139,6 @@ if [runto inner] then {
# This test is not as obscure as it might look. `p getenv ("TERM")'
# is a real-world example, at least on many systems.
if { ! [test_compiler_info "gcc-*"]} {
setup_xfail "mips-sgi-irix6*"
}
if [target_info exists gdb,cannot_call_functions] {
setup_xfail "*-*-*" 2416
fail "p/c array_index(\"abcdef\",2)"
@ -204,9 +173,6 @@ if [runto inner] then {
# Now, try that we can give names of file-local symbols which happen
# to be unique, and have it still work
if [test_compiler_info "gcc-*"] {
setup_xfail "mips-sgi-irix6*"
}
if [runto middle] then {
gdb_test "backtrace 10" "#0.*middle.*#1.*top.*#2.*main.*" \
"backtrace from middle in nodebug.exp"

View file

@ -56,9 +56,9 @@ proc setup_xfail_on_opaque_pointer {} {
global gcc_compiled
setup_xfail "vax-*-*" "i*86-sequent-bsd*"
if {!$gcc_compiled} then {
setup_xfail "alpha-*-*" "mips-sgi-irix5*"
}
if {!$gcc_compiled} then {
setup_xfail "alpha-*-*"
}
}
# This seems easier than trying to track different versions of xlc; I'm

View file

@ -123,7 +123,6 @@ test_set "set variable v_signed_char=97" "print v_signed_char" ".\[0-9\]* = 97 \
test_set "set variable v_signed_char=126" "print v_signed_char" ".\[0-9\]* = 126 \'~\'" "set variable signed char=126 ('~')"
test_set "set variable v_signed_char=127" "print v_signed_char" ".\[0-9\]* = 127 \'.177\'" "set variable signed char=127 (8-bit)"
gdb_test_no_output "set variable v_signed_char=-1"
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix4*" }
with_target_charset "ASCII" {
gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \
@ -131,7 +130,6 @@ with_target_charset "ASCII" {
}
gdb_test_no_output "set variable v_signed_char=0xFF"
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix4*" }
with_target_charset "ASCII" {
gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \

View file

@ -67,7 +67,6 @@ gdb_test "whatis v_char" \
"type = (unsigned char|char)" \
"whatis char"
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
gdb_test "whatis v_signed_char" \
"type = (signed char|char)" \
"whatis signed char"

View file

@ -2563,8 +2563,8 @@ set hp_aCC_compiler 0
# if the build machine is the same as the host machine, which is
# usually true of the targets which are not gcc. But this code does
# not figure which compiler to call, and it always ends up using the C
# compiler. Not good for setting hp_aCC_compiler. Targets
# hppa*-*-hpux* and mips*-*-irix* used to do this.
# compiler. Not good for setting hp_aCC_compiler. Target
# hppa*-*-hpux* used to do this.
#
# [ gdb_compile -E $ifile > $binfile.ci ]
# source $binfile.ci
@ -2975,10 +2975,6 @@ proc gdb_compile_shlib {sources dest options} {
"hppa*-hp-hpux*" {
lappend obj_options "additional_flags=+z"
}
"mips-sgi-irix*" {
# Disable SGI compiler's implicit -Dsgi
lappend obj_options "additional_flags=-Usgi"
}
default {
# don't know what the compiler is...
}