home *** CD-ROM | disk | FTP | other *** search
- diff -c gnu/gdb/bfd/elfcode.h:1.1.1.2 gnu/gdb/bfd/elfcode.h:1.2
- *** gnu/gdb/bfd/elfcode.h:1.1.1.2 Mon Jun 12 20:09:28 1995
- --- gnu/gdb/bfd/elfcode.h Mon Jun 12 20:09:28 1995
- ***************
- *** 3541,3547 ****
-
- if (core_prpsinfo (core_bfd))
- {
- ! corename = (((struct prpsinfo *) core_prpsinfo (core_bfd))->pr_fname);
- }
- else
- {
- --- 3541,3547 ----
-
- if (core_prpsinfo (core_bfd))
- {
- ! corename = (((prpsinfo_t *) core_prpsinfo (core_bfd))->pr_fname);
- }
- else
- {
- diff -c gnu/gdb/bfd/hosts/i386linux.h:1.1.1.1 gnu/gdb/bfd/hosts/i386linux.h:1.2
- *** gnu/gdb/bfd/hosts/i386linux.h:1.1.1.1 Mon Jun 12 20:09:30 1995
- --- gnu/gdb/bfd/hosts/i386linux.h Mon Jun 12 20:09:30 1995
- ***************
- *** 15,17 ****
- --- 15,19 ----
- the end. */
-
- #define TRAD_CORE_EXTRA_SIZE_ALLOWED 4096
- +
- + #define HAVE_PROCFS /* Used for core file stuff only */
- diff -c /dev/null gnu/gdb/gdb/core-linux.c:1.2
- *** /dev/null Mon Jun 12 20:09:33 1995
- --- gnu/gdb/gdb/core-linux.c Mon Jun 12 20:09:33 1995
- ***************
- *** 0 ****
- --- 1,181 ----
- + /* Support for Linux ELF core files for GDB.
- + Copyright 1995 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. */
- +
- +
- + #include "defs.h"
- +
- + #include <sys/procfs.h>
- + #include <sys/user.h>
- + #include <sys/ptrace.h>
- +
- + #include "inferior.h"
- + #include "target.h"
- + #include "command.h"
- + #include "gdbcore.h"
- +
- + extern void supply_gregset PARAMS ((gregset_t *gregsetp));
- +
- + /*
- +
- + LOCAL FUNCTION
- +
- + fetch_elf_core_registers -- fetch current registers from
- + ELF core file data
- +
- + SYNOPSIS
- +
- + void fetch_elf_core_registers (char *core_reg_sect, unsigned core_reg_size,
- + int which, unsigned in reg_addr)
- +
- + DESCRIPTION
- +
- + Read the values of either the general register set (WHICH equals 0)
- + or the floating point register set (WHICH equals 2) from the core
- + file data (pointed to by CORE_REG_SECT), and update gdb's idea of
- + their current values. The CORE_REG_SIZE parameter is ignored.
- +
- + NOTES
- +
- + Use the indicated sizes to validate the gregset and fpregset
- + structures.
- + */
- +
- + static void
- + fetch_elf_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; /* Unused in this version */
- + {
- + gregset_t gregset;
- + fpregset_t fpregset;
- +
- + if (which == 0)
- + {
- + if (core_reg_size != sizeof (gregset))
- + {
- + warning ("wrong size gregset struct in core file");
- + }
- + else
- + {
- + memcpy ((char *) &gregset, core_reg_sect, sizeof (gregset));
- + supply_gregset (&gregset);
- + }
- + }
- + else if (which == 2)
- + {
- + if (core_reg_size != sizeof (fpregset))
- + {
- + warning ("wrong size fpregset struct in core file");
- + }
- + else
- + {
- + memcpy ((char *) &fpregset, core_reg_sect, sizeof (fpregset));
- + #if defined (FP0_REGNUM)
- + supply_fpregset (&fpregset);
- + #endif
- + }
- + }
- + }
- +
- +
- + #define CORE_REGISTER_ADDR(regno, regptr) register_addr(regno, regptr)
- +
- + /* Return the address in the core dump or inferior of register REGNO.
- + BLOCKEND is the address of the end of the user structure. */
- +
- + unsigned int
- + register_addr (regno, blockend)
- + int regno;
- + int blockend;
- + {
- + int addr;
- +
- + if (regno < 0 || regno >= ARCH_NUM_REGS)
- + error ("Invalid register number %d.", regno);
- +
- + REGISTER_U_ADDR (addr, blockend, regno);
- +
- + return addr;
- + }
- +
- + /* Extract the register values out of the core file and store
- + them where `read_register' will find them.
- +
- + CORE_REG_SECT points to the register values themselves, read into memory.
- + CORE_REG_SIZE is the size of that area.
- + WHICH says which set of registers we are handling (0 = int, 2 = float
- + on machines where they are discontiguous).
- + REG_ADDR is the offset from u.u_ar0 to the register values relative to
- + core_reg_sect. This is used with old-fashioned core files to
- + locate the registers in a large upage-plus-stack ".reg" section.
- + Original upage address X is at location core_reg_sect+x+reg_addr.
- + */
- +
- + static void
- + fetch_aout_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
- + char *core_reg_sect;
- + unsigned core_reg_size;
- + int which;
- + unsigned reg_addr;
- + {
- + register int regno;
- + register unsigned int addr;
- + int bad_reg = -1;
- + register reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */
- + int numregs = ARCH_NUM_REGS;
- +
- + /* If u.u_ar0 was an absolute address in the core file, relativize it now,
- + so we can use it as an offset into core_reg_sect. When we're done,
- + "register 0" will be at core_reg_sect+reg_ptr, and we can use
- + CORE_REGISTER_ADDR to offset to the other registers. If this is a modern
- + core file without a upage, reg_ptr will be zero and this is all a big
- + NOP. */
- + if (reg_ptr > core_reg_size)
- + reg_ptr -= KERNEL_U_ADDR;
- +
- + for (regno = 0; regno < numregs; regno++)
- + {
- + addr = CORE_REGISTER_ADDR (regno, reg_ptr);
- + if (addr >= core_reg_size) {
- + if (bad_reg < 0)
- + bad_reg = regno;
- + } else {
- + supply_register (regno, core_reg_sect + addr);
- + }
- + }
- + if (bad_reg >= 0)
- + {
- + error ("Register %s not found in core file.", reg_names[bad_reg]);
- + }
- + }
- +
- + /* Ikky, but it seems like the cleanest way */
- + 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;
- + {
- + if (core_bfd->xvec->flavour == bfd_target_elf_flavour)
- + fetch_elf_core_registers(core_reg_sect, core_reg_size, which, reg_addr);
- + else
- + fetch_aout_core_registers(core_reg_sect, core_reg_size, which, reg_addr);
- + }
- diff -c /dev/null gnu/gdb/gdb/i386lnx-nat.c:1.1
- *** /dev/null Mon Jun 12 20:09:33 1995
- --- gnu/gdb/gdb/i386lnx-nat.c Mon Jun 12 20:09:33 1995
- ***************
- *** 0 ****
- --- 1,58 ----
- + /* Intel 386 native support for Linux.
- + Copyright 1995 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. */
- +
- +
- + #include "defs.h"
- +
- + #include <sys/procfs.h>
- + #include <sys/user.h>
- + #include <sys/ptrace.h>
- +
- + #include "inferior.h"
- + #include "target.h"
- + #include "command.h"
- + #include "gdbcore.h"
- +
- + /* This is a duplicate of the table in i386-xdep.c. */
- +
- + static int regmap[] =
- + {
- + EAX, ECX, EDX, EBX,
- + UESP, EBP, ESI, EDI,
- + EIP, EFL, CS, SS,
- + DS, ES, FS, GS,
- + };
- +
- +
- + /* Given a pointer to a general register set in /proc format (gregset_t *),
- + unpack the register contents and supply them as gdb's idea of the current
- + register values. Copied from tm-i386v4.h */
- +
- + void
- + supply_gregset (gregsetp)
- + gregset_t *gregsetp;
- + {
- + register int regi;
- + register greg_t *regp = (greg_t *) gregsetp;
- +
- + for (regi = 0 ; regi < NUM_REGS ; regi++)
- + {
- + supply_register (regi, (char *) (regp + regmap[regi]));
- + }
- + }
- diff -c gnu/gdb/gdb/config/i386/linux.mh:1.1.1.1 gnu/gdb/gdb/config/i386/linux.mh:1.4
- *** gnu/gdb/gdb/config/i386/linux.mh:1.1.1.1 Mon Jun 12 20:09:36 1995
- --- gnu/gdb/gdb/config/i386/linux.mh Mon Jun 12 20:09:36 1995
- ***************
- *** 3,10 ****
- XM_FILE= xm-linux.h
- XDEPFILES=
-
- ! # Needed for frexp() in libiberty.
- ! XM_CLIBS= -lm
-
- NAT_FILE= nm-linux.h
- ! NATDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o i386v-nat.o corelow.o
- --- 3,15 ----
- XM_FILE= xm-linux.h
- XDEPFILES=
-
- ! # Needed for frexp() in libiberty. Not needed any more.
- ! # XM_CLIBS= -lm
-
- NAT_FILE= nm-linux.h
- ! NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o core-linux.o \
- ! i386v-nat.o corelow.o i386lnx-nat.o
- !
- ! # We don't want to use MMALLOC in gdb because the native one is better.
- ! MMALLOC =
- ! MMALLOC_DISABLE = -DNO_MMALLOC
- diff -c gnu/gdb/gdb/config/i386/linux.mt:1.1.1.1 gnu/gdb/gdb/config/i386/linux.mt:1.2
- *** gnu/gdb/gdb/config/i386/linux.mt:1.1.1.1 Mon Jun 12 20:09:36 1995
- --- gnu/gdb/gdb/config/i386/linux.mt Mon Jun 12 20:09:36 1995
- ***************
- *** 1,3 ****
- ! # Target: Intel 386 with a.out
- TDEPFILES= i386-tdep.o i387-tdep.o
- TM_FILE= tm-linux.h
- --- 1,3 ----
- ! # Target: Intel 386 with a.out and ELF
- TDEPFILES= i386-tdep.o i387-tdep.o
- TM_FILE= tm-linux.h
- diff -c gnu/gdb/gdb/config/i386/tm-linux.h:1.1.1.1 gnu/gdb/gdb/config/i386/tm-linux.h:1.2
- *** gnu/gdb/gdb/config/i386/tm-linux.h:1.1.1.1 Mon Jun 12 20:09:36 1995
- --- gnu/gdb/gdb/config/i386/tm-linux.h Mon Jun 12 20:09:36 1995
- ***************
- *** 24,26 ****
- --- 24,32 ----
- #define START_INFERIOR_TRAPS_EXPECTED 2
-
- #include "i386/tm-i386v.h"
- +
- + /*
- + * We need this file for the SOLIB_TRAMPOLINE stuff.
- + */
- +
- + #include "tm-sysv4.h"
- diff -c gnu/gdb/gdb/config/i386/xm-linux.h:1.1.1.1 gnu/gdb/gdb/config/i386/xm-linux.h:1.2
- *** gnu/gdb/gdb/config/i386/xm-linux.h:1.1.1.1 Mon Jun 12 20:09:36 1995
- --- gnu/gdb/gdb/config/i386/xm-linux.h Mon Jun 12 20:09:36 1995
- ***************
- *** 30,32 ****
- --- 30,41 ----
-
- /* Need R_OK etc, but USG isn't defined. */
- #include <unistd.h>
- +
- +
- + /*
- + * We define this because with ELF we use SVR4 style shared libraries.
- + */
- +
- + #include "solib.h" /* Support for shared libraries. */
- +
- + #define SVR4_SHARED_LIBS
-