mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-11 08:25:30 +08:00
* config.sub configure.in config/.Sanitize config/mh-irix4
gdb/.Sanitize gdb/configure.in gdb/mips-tdep.c gdb/mipsread.c gdb/procfs.c gdb/signame.h gdb/tm-irix3.h gdb/tm-mips.h gdb/xm-irix4.h gdb/config/.Sanitize gdb/config/mt-irix3 gdb/config/mh-irix4 texinfo/configure.in: Port to SGI Irix-4.x.
This commit is contained in:
@ -25,6 +25,7 @@ mh-apollo68
|
|||||||
mh-decstation
|
mh-decstation
|
||||||
mh-delta88
|
mh-delta88
|
||||||
mh-dgux
|
mh-dgux
|
||||||
|
mh-irix4
|
||||||
mh-sco
|
mh-sco
|
||||||
mh-sysv
|
mh-sysv
|
||||||
mh-sysv4
|
mh-sysv4
|
||||||
|
5
config/mh-irix4
Normal file
5
config/mh-irix4
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Makefile changes for SGI's running IRIX-4.x.
|
||||||
|
# Tell compiler to use K&R C. We can't compile under the SGI Ansi environment.
|
||||||
|
CC = cc -cckr
|
||||||
|
SYSV = -DSYSV
|
||||||
|
RANLIB = echo >/dev/null
|
@ -14,7 +14,8 @@ srcname="gnu development package"
|
|||||||
case "${host_os}" in
|
case "${host_os}" in
|
||||||
m88kbcs) host_makefile_frag=config/mh-delta88;;
|
m88kbcs) host_makefile_frag=config/mh-delta88;;
|
||||||
sysv4*) host_makefile_frag=config/mh-sysv4 ;;
|
sysv4*) host_makefile_frag=config/mh-sysv4 ;;
|
||||||
sysv* | irix*) host_makefile_frag=config/mh-sysv ;;
|
sysv* | irix3) host_makefile_frag=config/mh-sysv ;;
|
||||||
|
irix4) host_makefile_frag=config/mh-irix4 ;;
|
||||||
ultrix*)
|
ultrix*)
|
||||||
case "${host_cpu}" in
|
case "${host_cpu}" in
|
||||||
mips) host_makefile_frag=config/mh-decstation ;;
|
mips) host_makefile_frag=config/mh-decstation ;;
|
||||||
|
@ -266,6 +266,7 @@ xm-i386v.h
|
|||||||
xm-i386v4.h
|
xm-i386v4.h
|
||||||
xm-i386v32.h
|
xm-i386v32.h
|
||||||
xm-irix3.h
|
xm-irix3.h
|
||||||
|
xm-irix4.h
|
||||||
xm-isi.h
|
xm-isi.h
|
||||||
xm-m68k.h
|
xm-m68k.h
|
||||||
xm-merlin.h
|
xm-merlin.h
|
||||||
|
@ -41,6 +41,7 @@ mh-i386v-g
|
|||||||
mh-i386v32
|
mh-i386v32
|
||||||
mh-i386v32-g
|
mh-i386v32-g
|
||||||
mh-irix3
|
mh-irix3
|
||||||
|
mh-irix4
|
||||||
mh-isi
|
mh-isi
|
||||||
mh-littlemips
|
mh-littlemips
|
||||||
mh-m88k
|
mh-m88k
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# Target: Big-endian MIPS machine such as Sony News
|
# Target: SGI mips
|
||||||
TDEPFILES= mips-pinsn.o mips-tdep.o mipsread.o exec.o
|
TDEPFILES= mips-pinsn.o mips-tdep.o mipsread.o exec.o
|
||||||
TM_FILE= tm-irix3.h
|
TM_FILE= tm-irix3.h
|
||||||
|
7
gdb/config/irix4.mh
Normal file
7
gdb/config/irix4.mh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Host: SGI Iris running irix 4.x
|
||||||
|
XDEPFILES= procfs.o coredep.o
|
||||||
|
XM_FILE= xm-irix4.h
|
||||||
|
ALLOCA=alloca.o
|
||||||
|
ALLOCA1=alloca.o
|
||||||
|
MUNCH_DEFINE=-B
|
||||||
|
XM_CLIBS=-lbsd
|
@ -80,7 +80,12 @@ mips)
|
|||||||
sony) gdb_host=bigmips ;;
|
sony) gdb_host=bigmips ;;
|
||||||
dec) gdb_host=decstation ;;
|
dec) gdb_host=decstation ;;
|
||||||
little) gdb_host=littlemips ;;
|
little) gdb_host=littlemips ;;
|
||||||
sgi) gdb_host=irix3 ;;
|
sgi)
|
||||||
|
case "${host_os}" in
|
||||||
|
sysv) gdb_host=irix3 ;;
|
||||||
|
irix4) gdb_host=irix4 ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
113
gdb/mips-tdep.c
113
gdb/mips-tdep.c
@ -36,6 +36,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
|
#ifdef sgi
|
||||||
|
/* Must do it this way only for SGIs, as other mips platforms get their
|
||||||
|
JB_ symbols from machine/pcb.h (included via sys/user.h). */
|
||||||
|
#include <setjmp.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "gdbcore.h"
|
#include "gdbcore.h"
|
||||||
|
|
||||||
#ifndef MIPSMAGIC
|
#ifndef MIPSMAGIC
|
||||||
@ -641,7 +647,114 @@ isa_NAN(p, len)
|
|||||||
}
|
}
|
||||||
else return 1;
|
else return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Implemented for Irix 4.x by Garrett A. Wollman
|
||||||
|
*/
|
||||||
|
#ifdef USE_PROC_FS /* Target-dependent /proc support */
|
||||||
|
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/procfs.h>
|
||||||
|
|
||||||
|
typedef unsigned int greg_t; /* why isn't this defined? */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* See the comment in m68k-tdep.c regarding the utility of these functions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
supply_gregset (gregsetp)
|
||||||
|
gregset_t *gregsetp;
|
||||||
|
{
|
||||||
|
register int regno;
|
||||||
|
register greg_t *regp = (greg_t *)(gregsetp->gp_regs);
|
||||||
|
|
||||||
|
/* FIXME: somewhere, there should be a #define for the meaning
|
||||||
|
of this magic number 32; we should use that. */
|
||||||
|
for(regno = 0; regno < 32; regno++)
|
||||||
|
supply_register (regno, (char *)(regp + regno));
|
||||||
|
|
||||||
|
supply_register (PC_REGNUM, (char *)&(gregsetp->gp_pc));
|
||||||
|
supply_register (HI_REGNUM, (char *)&(gregsetp->gp_mdhi));
|
||||||
|
supply_register (LO_REGNUM, (char *)&(gregsetp->gp_mdlo));
|
||||||
|
supply_register (PS_REGNUM, (char *)&(gregsetp->gp_cause));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
fill_gregset (gregsetp, regno)
|
||||||
|
gregset_t *gregsetp;
|
||||||
|
int regno;
|
||||||
|
{
|
||||||
|
int regi;
|
||||||
|
register greg_t *regp = (greg_t *)(gregsetp->gp_regs);
|
||||||
|
extern char registers[];
|
||||||
|
|
||||||
|
/* same FIXME as above wrt 32*/
|
||||||
|
for (regi = 0; regi < 32; regi++)
|
||||||
|
if ((regno == -1) || (regno == regi))
|
||||||
|
*(regp + regno) = *(greg_t *) ®isters[REGISTER_BYTE (regi)];
|
||||||
|
|
||||||
|
if ((regno == -1) || (regno == PC_REGNUM))
|
||||||
|
gregsetp->gp_pc = *(greg_t *) ®isters[REGISTER_BYTE (PC_REGNUM)];
|
||||||
|
|
||||||
|
if ((regno == -1) || (regno == PS_REGNUM))
|
||||||
|
gregsetp->gp_cause = *(greg_t *) ®isters[REGISTER_BYTE (PS_REGNUM)];
|
||||||
|
|
||||||
|
if ((regno == -1) || (regno == HI_REGNUM))
|
||||||
|
gregsetp->gp_mdhi = *(greg_t *) ®isters[REGISTER_BYTE (HI_REGNUM)];
|
||||||
|
|
||||||
|
if ((regno == -1) || (regno == LO_REGNUM))
|
||||||
|
gregsetp->gp_mdlo = *(greg_t *) ®isters[REGISTER_BYTE (LO_REGNUM)];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Now we do the same thing for floating-point registers.
|
||||||
|
* We don't bother to condition on FP0_REGNUM since any
|
||||||
|
* reasonable MIPS configuration has an R3010 in it.
|
||||||
|
*
|
||||||
|
* Again, see the comments in m68k-tdep.c.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
supply_fpregset (fpregsetp)
|
||||||
|
fpregset_t *fpregsetp;
|
||||||
|
{
|
||||||
|
register int regno;
|
||||||
|
|
||||||
|
for (regno = 0; regno < 32; regno++)
|
||||||
|
supply_register (FP0_REGNUM + regno,
|
||||||
|
(char *)&fpregsetp->fp_r.fp_regs[regno]);
|
||||||
|
|
||||||
|
supply_register (FCRCS_REGNUM, (char *)&fpregsetp->fp_csr);
|
||||||
|
|
||||||
|
/* FIXME: how can we supply FCRIR_REGNUM? SGI doesn't tell us. */
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
fill_fpregset (fpregsetp, regno)
|
||||||
|
fpregset_t *fpregsetp;
|
||||||
|
int regno;
|
||||||
|
{
|
||||||
|
int regi;
|
||||||
|
char *from, *to;
|
||||||
|
extern char registers[];
|
||||||
|
|
||||||
|
for (regi = FP0_REGNUM; regi < FP0_REGNUM + 32; regi++)
|
||||||
|
{
|
||||||
|
if ((regno == -1) || (regno == regi))
|
||||||
|
{
|
||||||
|
from = (char *) ®isters[REGISTER_BYTE (regi)];
|
||||||
|
to = (char *) &(fpregsetp->fp_r.fp_regs[regi]);
|
||||||
|
bcopy(from, to, REGISTER_RAW_SIZE (regno));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((regno == -1) || (regno == FCRCS_REGNUM))
|
||||||
|
fpregsetp->fp_csr = *(unsigned *) ®isters[REGISTER_BYTE(FCRCS_REGNUM)];
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* USE_PROC_FS */
|
||||||
|
|
||||||
/* To skip prologues, I use this predicate. Returns either PC
|
/* To skip prologues, I use this predicate. Returns either PC
|
||||||
itself if the code at PC does not look like a function prologue,
|
itself if the code at PC does not look like a function prologue,
|
||||||
PC+4 if it does (our caller does not need anything more fancy). */
|
PC+4 if it does (our caller does not need anything more fancy). */
|
||||||
|
@ -2347,10 +2347,11 @@ psymtab_to_symtab_1(pst, filename)
|
|||||||
/* Procedures next, note we need to look-ahead to
|
/* Procedures next, note we need to look-ahead to
|
||||||
find out where the procedure's code ends */
|
find out where the procedure's code ends */
|
||||||
|
|
||||||
for (i = 0; i < fh->cpd-1; i++) {
|
if (fh->cpd > 0)
|
||||||
|
for (i = 0; i < fh->cpd-1; i++) {
|
||||||
pr = (PDR *) (IPDFIRST(cur_hdr, fh)) + i;
|
pr = (PDR *) (IPDFIRST(cur_hdr, fh)) + i;
|
||||||
parse_procedure(pr, pr[1].adr); /* next proc up */
|
parse_procedure(pr, pr[1].adr); /* next proc up */
|
||||||
}
|
}
|
||||||
if (fh->cpd) {
|
if (fh->cpd) {
|
||||||
pr = (PDR *) (IPDFIRST(cur_hdr, fh)) + i;
|
pr = (PDR *) (IPDFIRST(cur_hdr, fh)) + i;
|
||||||
parse_procedure(pr, bound); /* next file up */
|
parse_procedure(pr, bound); /* next file up */
|
||||||
|
33
gdb/procfs.c
33
gdb/procfs.c
@ -36,6 +36,7 @@ regardless of whether or not the actual target has floating point hardware.
|
|||||||
|
|
||||||
#ifdef USE_PROC_FS /* Entire file goes away if not using /proc */
|
#ifdef USE_PROC_FS /* Entire file goes away if not using /proc */
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
#include <sys/procfs.h>
|
#include <sys/procfs.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -466,8 +467,23 @@ proc_set_exec_trap ()
|
|||||||
_exit (127);
|
_exit (127);
|
||||||
}
|
}
|
||||||
premptyset (&exitset);
|
premptyset (&exitset);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GW: Rationale...
|
||||||
|
* Not all systems with /proc have all the exec* syscalls with the same
|
||||||
|
* names. On the SGI, for example, there is no SYS_exec, but there
|
||||||
|
* *is* a SYS_execv. So, we try to account for that.
|
||||||
|
*/
|
||||||
|
#ifdef SYS_exec
|
||||||
praddset (&exitset, SYS_exec);
|
praddset (&exitset, SYS_exec);
|
||||||
|
#endif
|
||||||
|
#ifdef SYS_execve
|
||||||
praddset (&exitset, SYS_execve);
|
praddset (&exitset, SYS_execve);
|
||||||
|
#endif
|
||||||
|
#ifdef SYS_execv
|
||||||
|
praddset(&exitset, SYS_execv);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ioctl (fd, PIOCSEXIT, &exitset) < 0)
|
if (ioctl (fd, PIOCSEXIT, &exitset) < 0)
|
||||||
{
|
{
|
||||||
perror (procname);
|
perror (procname);
|
||||||
@ -886,8 +902,21 @@ proc_wait (statloc)
|
|||||||
{
|
{
|
||||||
statval = (what << 8) | 0177;
|
statval = (what << 8) | 0177;
|
||||||
}
|
}
|
||||||
else if ((why == PR_SYSEXIT) &&
|
else if ((why == PR_SYSEXIT)
|
||||||
(what == SYS_exec || what == SYS_execve))
|
&&
|
||||||
|
(
|
||||||
|
#ifdef SYS_exec
|
||||||
|
what == SYS_exec
|
||||||
|
#else
|
||||||
|
0 == 0
|
||||||
|
#endif
|
||||||
|
#ifdef SYS_execve
|
||||||
|
|| what == SYS_execve
|
||||||
|
#endif
|
||||||
|
#ifdef SYS_execv
|
||||||
|
|| what == SYS_execv
|
||||||
|
#endif
|
||||||
|
))
|
||||||
{
|
{
|
||||||
statval = (SIGTRAP << 8) | 0177;
|
statval = (SIGTRAP << 8) | 0177;
|
||||||
}
|
}
|
||||||
|
@ -34,10 +34,12 @@ sig_abbrev PARAMS ((int));
|
|||||||
extern int
|
extern int
|
||||||
sig_number PARAMS ((const char *));
|
sig_number PARAMS ((const char *));
|
||||||
|
|
||||||
|
#ifndef PSIGNAL_IN_SIGNAL_H
|
||||||
/* Print to standard error the name of SIGNAL, preceded by MESSAGE and
|
/* Print to standard error the name of SIGNAL, preceded by MESSAGE and
|
||||||
a colon, and followed by a newline. */
|
a colon, and followed by a newline. */
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
psignal PARAMS ((unsigned, const char *));
|
psignal PARAMS ((unsigned, const char *));
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* !defined (SIGNAME_H) */
|
#endif /* !defined (SIGNAME_H) */
|
||||||
|
@ -102,6 +102,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
to be actual register numbers as far as the user is concerned
|
to be actual register numbers as far as the user is concerned
|
||||||
but do serve to get the desired values when passed to read_register. */
|
but do serve to get the desired values when passed to read_register. */
|
||||||
|
|
||||||
|
#define A0_REGNUM 4 /* Loc of first arg during a subr call */
|
||||||
#define SP_REGNUM 29 /* Contains address of top of stack */
|
#define SP_REGNUM 29 /* Contains address of top of stack */
|
||||||
#define FP_REGNUM 30 /* Pseudo register that contains true address of executing stack frame */
|
#define FP_REGNUM 30 /* Pseudo register that contains true address of executing stack frame */
|
||||||
#define RA_REGNUM 31 /* Contains return address value */
|
#define RA_REGNUM 31 /* Contains return address value */
|
||||||
@ -323,3 +324,16 @@ typedef struct mips_extra_func_info {
|
|||||||
struct frame_saved_regs *saved_regs;
|
struct frame_saved_regs *saved_regs;
|
||||||
|
|
||||||
#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci)
|
#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci)
|
||||||
|
|
||||||
|
/* Size of elements in jmpbuf */
|
||||||
|
|
||||||
|
#define JB_ELEMENT_SIZE 4
|
||||||
|
|
||||||
|
/* Figure out where the longjmp will land. We expect that we have just entered
|
||||||
|
longjmp and haven't yet setup the stack frame, so the args are still in the
|
||||||
|
argument regs. a0 (CALL_ARG0) points at the jmp_buf structure from which we
|
||||||
|
extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
|
||||||
|
This routine returns true on success */
|
||||||
|
|
||||||
|
/* Note that caller must #include <setjmp.h> in order to get def of JB_* */
|
||||||
|
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
|
||||||
|
@ -122,7 +122,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
but do serve to get the desired values when passed to read_register. */
|
but do serve to get the desired values when passed to read_register. */
|
||||||
|
|
||||||
#define ZERO_REGNUM 0 /* read-only register, always 0 */
|
#define ZERO_REGNUM 0 /* read-only register, always 0 */
|
||||||
#define A0_REGNUM 4 /* Lo of first arg during a subr call */
|
#define A0_REGNUM 4 /* Loc of first arg during a subr call */
|
||||||
#define SP_REGNUM 29 /* Contains address of top of stack */
|
#define SP_REGNUM 29 /* Contains address of top of stack */
|
||||||
#define RA_REGNUM 31 /* Contains return address value */
|
#define RA_REGNUM 31 /* Contains return address value */
|
||||||
#define PS_REGNUM 32 /* Contains processor status */
|
#define PS_REGNUM 32 /* Contains processor status */
|
||||||
|
50
gdb/xm-irix4.h
Normal file
50
gdb/xm-irix4.h
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
/* Copyright (C) 1991 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 2 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, write to the Free Software
|
||||||
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
/* This is for the iris. */
|
||||||
|
|
||||||
|
#define HAVE_TERMIO
|
||||||
|
|
||||||
|
#define U_REGS_OFFSET 0
|
||||||
|
|
||||||
|
#include "xm-bigmips.h"
|
||||||
|
|
||||||
|
/* Override register locations in upage for SGI machines */
|
||||||
|
#undef REGISTER_U_ADDR
|
||||||
|
#define REGISTER_U_ADDR(addr, blockend, regno) \
|
||||||
|
if (regno < PC_REGNUM) \
|
||||||
|
addr = regno; \
|
||||||
|
else \
|
||||||
|
addr = regno + NSIG_HNDLRS; /* Skip over signal handlers */
|
||||||
|
|
||||||
|
/* Don't need special routines for the SGI -- we can use infptrace.c */
|
||||||
|
#undef FETCH_INFERIOR_REGISTERS
|
||||||
|
|
||||||
|
/* BEGIN GW MODS */
|
||||||
|
/*
|
||||||
|
* Let's use /debug instead of all this dangerous mucking about
|
||||||
|
* with ptrace(), which seems *extremely* fragile, anyway.
|
||||||
|
*/
|
||||||
|
#define USE_PROC_FS
|
||||||
|
#define PROC_NAME_FMT "/debug/%d"
|
||||||
|
#define CREATE_INFERIOR_HOOK(pid) inferior_proc_init(pid)
|
||||||
|
|
||||||
|
/* Irix defines psignal() in signal.h, which gets gcc rather angry at us
|
||||||
|
* because their definition is markedly different.
|
||||||
|
*/
|
||||||
|
#define PSIGNAL_IN_SIGNAL_H
|
Reference in New Issue
Block a user