mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 18:14:13 +08:00
s/Linux/.../
Fix PR gdb/378.
This commit is contained in:
parent
a4b6fc86fa
commit
ca557f44a0
@ -4,6 +4,9 @@
|
||||
with either ``GNU/Linux'' or ``Linux kernel''. Update copyright.
|
||||
* m68klinux-nat.c, sparc-linux-nat.c, x86-64-linux-nat.c: Ditto.
|
||||
* x86-64-linux-tdep.c, gregset.h, gdb_wait.h: Ditto.
|
||||
* ia64-linux-nat.c, infrun.c, linux-proc.c: Ditto.
|
||||
* proc-service.c, i386-linux-tdep.c, ppc-linux-tdep.c: Ditto.
|
||||
* s390-tdep.c: Ditto.
|
||||
Fix PR gdb/378.
|
||||
|
||||
2002-02-23 Andrew Cagney <ac131313@redhat.com>
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* Target-dependent code for Linux running on i386's, for GDB.
|
||||
Copyright 2000, 2001 Free Software Foundation, Inc.
|
||||
/* Target-dependent code for GNU/Linux running on i386's, for GDB.
|
||||
|
||||
Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
@ -67,12 +68,12 @@ i386_linux_register_raw_size (int reg)
|
||||
|
||||
/* Recognizing signal handler frames. */
|
||||
|
||||
/* Linux has two flavors of signals. Normal signal handlers, and
|
||||
/* GNU/Linux has two flavors of signals. Normal signal handlers, and
|
||||
"realtime" (RT) signals. The RT signals can provide additional
|
||||
information to the signal handler if the SA_SIGINFO flag is set
|
||||
when establishing a signal handler using `sigaction'. It is not
|
||||
unlikely that future versions of Linux will support SA_SIGINFO for
|
||||
normal signals too. */
|
||||
unlikely that future versions of GNU/Linux will support SA_SIGINFO
|
||||
for normal signals too. */
|
||||
|
||||
/* When the i386 Linux kernel calls a signal handler and the
|
||||
SA_RESTORER flag isn't set, the return address points to a bit of
|
||||
@ -221,7 +222,7 @@ i386_linux_rt_sigtramp_start (CORE_ADDR pc)
|
||||
return pc;
|
||||
}
|
||||
|
||||
/* Return whether PC is in a Linux sigtramp routine. */
|
||||
/* Return whether PC is in a GNU/Linux sigtramp routine. */
|
||||
|
||||
int
|
||||
i386_linux_in_sigtramp (CORE_ADDR pc, char *name)
|
||||
@ -233,8 +234,8 @@ i386_linux_in_sigtramp (CORE_ADDR pc, char *name)
|
||||
|| i386_linux_rt_sigtramp_start (pc) != 0);
|
||||
}
|
||||
|
||||
/* Assuming FRAME is for a Linux sigtramp routine, return the address
|
||||
of the associated sigcontext structure. */
|
||||
/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
|
||||
address of the associated sigcontext structure. */
|
||||
|
||||
CORE_ADDR
|
||||
i386_linux_sigcontext_addr (struct frame_info *frame)
|
||||
@ -285,8 +286,8 @@ i386_linux_sigcontext_addr (struct frame_info *frame)
|
||||
/* Offset to saved PC in sigcontext, from <asm/sigcontext.h>. */
|
||||
#define LINUX_SIGCONTEXT_PC_OFFSET (56)
|
||||
|
||||
/* Assuming FRAME is for a Linux sigtramp routine, return the saved
|
||||
program counter. */
|
||||
/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
|
||||
saved program counter. */
|
||||
|
||||
static CORE_ADDR
|
||||
i386_linux_sigtramp_saved_pc (struct frame_info *frame)
|
||||
@ -299,8 +300,8 @@ i386_linux_sigtramp_saved_pc (struct frame_info *frame)
|
||||
/* Offset to saved SP in sigcontext, from <asm/sigcontext.h>. */
|
||||
#define LINUX_SIGCONTEXT_SP_OFFSET (28)
|
||||
|
||||
/* Assuming FRAME is for a Linux sigtramp routine, return the saved
|
||||
stack pointer. */
|
||||
/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
|
||||
saved stack pointer. */
|
||||
|
||||
static CORE_ADDR
|
||||
i386_linux_sigtramp_saved_sp (struct frame_info *frame)
|
||||
@ -448,7 +449,7 @@ skip_hurd_resolver (CORE_ADDR pc)
|
||||
It's kind of gross to do all these checks every time we're
|
||||
called, since they don't change once the executable has gotten
|
||||
started. But this is only a temporary hack --- upcoming versions
|
||||
of Linux will provide a portable, efficient interface for
|
||||
of GNU/Linux will provide a portable, efficient interface for
|
||||
debugging programs that use shared libraries. */
|
||||
|
||||
struct objfile *objfile;
|
||||
@ -488,11 +489,12 @@ i386_linux_skip_solib_resolver (CORE_ADDR pc)
|
||||
}
|
||||
|
||||
/* Fetch (and possibly build) an appropriate link_map_offsets
|
||||
structure for native Linux/x86 targets using the struct offsets
|
||||
structure for native GNU/Linux x86 targets using the struct offsets
|
||||
defined in link.h (but without actual reference to that file).
|
||||
|
||||
This makes it possible to access Linux/x86 shared libraries from a
|
||||
GDB that was not built on an Linux/x86 host (for cross debugging). */
|
||||
This makes it possible to access GNU/Linux x86 shared libraries
|
||||
from a GDB that was not built on an GNU/Linux x86 host (for cross
|
||||
debugging). */
|
||||
|
||||
struct link_map_offsets *
|
||||
i386_linux_svr4_fetch_link_map_offsets (void)
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* Intel 386 native support for SYSV systems (pre-SVR4).
|
||||
Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
|
||||
2000 Free Software Foundation, Inc.
|
||||
|
||||
Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
|
||||
1999, 2000, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
@ -46,12 +47,11 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
|
||||
/* FIXME: The following used to be just "#include <sys/debugreg.h>", but
|
||||
* the the Linux 2.1.x kernel and glibc 2.0.x are not in sync; including
|
||||
* <sys/debugreg.h> will result in an error. With luck, these losers
|
||||
* will get their act together and we can trash this hack in the near future.
|
||||
* --jsm 1998-10-21
|
||||
*/
|
||||
/* FIXME: 1998-10-21/jsm: The following used to be just "#include
|
||||
<sys/debugreg.h>", but the the Linux kernel (version 2.1.x) and
|
||||
glibc 2.0.x are not in sync; including <sys/debugreg.h> will result
|
||||
in an error. With luck, these losers will get their act together
|
||||
and we can trash this hack in the near future. */
|
||||
|
||||
#ifdef TARGET_HAS_HARDWARE_WATCHPOINTS
|
||||
#ifdef HAVE_ASM_DEBUGREG_H
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* Functions specific to running gdb native on IA-64 running Linux.
|
||||
Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
/* Functions specific to running gdb native on IA-64 running
|
||||
GNU/Linux.
|
||||
|
||||
Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Target-dependent code for the IA-64 for GDB, the GNU debugger.
|
||||
Copyright 1999, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
@ -1990,7 +1990,7 @@ ia64_pop_frame_regular (struct frame_info *frame)
|
||||
size of the frame and the size of the locals (both wrt the
|
||||
frame that we're going back to). This seems kind of strange,
|
||||
especially since it seems like we ought to be subtracting the
|
||||
size of the locals... and we should; but the linux kernel
|
||||
size of the locals... and we should; but the Linux kernel
|
||||
wants bsp to be set at the end of all used registers. It's
|
||||
likely that this code will need to be revised to accomodate
|
||||
other operating systems. */
|
||||
@ -2072,10 +2072,11 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
{
|
||||
os_ident = elf_elfheader (info.abfd)->e_ident[EI_OSABI];
|
||||
|
||||
/* If os_ident is 0, it is not necessarily the case that we're on a
|
||||
SYSV system. (ELFOSABI_NONE is defined to be 0.) GNU/Linux uses
|
||||
a note section to record OS/ABI info, but leaves e_ident[EI_OSABI]
|
||||
zero. So we have to check for note sections too. */
|
||||
/* If os_ident is 0, it is not necessarily the case that we're
|
||||
on a SYSV system. (ELFOSABI_NONE is defined to be 0.)
|
||||
GNU/Linux uses a note section to record OS/ABI info, but
|
||||
leaves e_ident[EI_OSABI] zero. So we have to check for note
|
||||
sections too. */
|
||||
if (os_ident == 0)
|
||||
{
|
||||
bfd_map_over_sections (info.abfd,
|
||||
@ -2112,12 +2113,13 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
else
|
||||
tdep->sigcontext_register_address = 0;
|
||||
|
||||
/* We know that Linux won't have to resort to the native_find_global_pointer
|
||||
hackery. But that's the only one we know about so far, so if
|
||||
native_find_global_pointer is set to something non-zero, then use
|
||||
it. Otherwise fall back to using generic_elf_find_global_pointer.
|
||||
This arrangement should (in theory) allow us to cross debug Linux
|
||||
binaries from an AIX machine. */
|
||||
/* We know that GNU/Linux won't have to resort to the
|
||||
native_find_global_pointer hackery. But that's the only one we
|
||||
know about so far, so if native_find_global_pointer is set to
|
||||
something non-zero, then use it. Otherwise fall back to using
|
||||
generic_elf_find_global_pointer. This arrangement should (in
|
||||
theory) allow us to cross debug GNU/Linux binaries from an AIX
|
||||
machine. */
|
||||
if (os_ident == ELFOSABI_LINUX)
|
||||
tdep->find_global_pointer = generic_elf_find_global_pointer;
|
||||
else if (native_find_global_pointer != 0)
|
||||
|
15
gdb/infrun.c
15
gdb/infrun.c
@ -1,4 +1,5 @@
|
||||
/* Target-struct-independent code to start (run) and stop an inferior process.
|
||||
/* Target-struct-independent code to start (run) and stop an inferior
|
||||
process.
|
||||
|
||||
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
|
||||
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
|
||||
@ -142,12 +143,12 @@ static int may_follow_exec = MAY_FOLLOW_EXEC;
|
||||
The simple approach is to single-step until control leaves the
|
||||
dynamic linker.
|
||||
|
||||
However, on some systems (e.g., Red Hat Linux 5.2) the dynamic
|
||||
linker calls functions in the shared C library, so you can't tell
|
||||
from the PC alone whether the dynamic linker is still running. In
|
||||
this case, we use a step-resume breakpoint to get us past the
|
||||
dynamic linker, as if we were using "next" to step over a function
|
||||
call.
|
||||
However, on some systems (e.g., Red Hat's 5.2 distribution) the
|
||||
dynamic linker calls functions in the shared C library, so you
|
||||
can't tell from the PC alone whether the dynamic linker is still
|
||||
running. In this case, we use a step-resume breakpoint to get us
|
||||
past the dynamic linker, as if we were using "next" to step over a
|
||||
function call.
|
||||
|
||||
IN_SOLIB_DYNSYM_RESOLVE_CODE says whether we're in the dynamic
|
||||
linker code or not. Normally, this means we single-step. However,
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Linux-specific methods for using the /proc file system.
|
||||
/* GNU/Linux specific methods for using the /proc file system.
|
||||
|
||||
Copyright 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Target-dependent code for GDB, the GNU debugger.
|
||||
|
||||
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
|
||||
2000, 2001 Free Software Foundation, Inc.
|
||||
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
|
||||
1997, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
#include "ppc-tdep.h"
|
||||
|
||||
/* The following two instructions are used in the signal trampoline
|
||||
code on linux/ppc */
|
||||
code on GNU/Linux PPC. */
|
||||
#define INSTR_LI_R0_0x7777 0x38007777
|
||||
#define INSTR_SC 0x44000002
|
||||
|
||||
@ -105,11 +105,11 @@ static int ppc_linux_at_sigtramp_return_path (CORE_ADDR pc);
|
||||
|
||||
/* Determine if pc is in a signal trampoline...
|
||||
|
||||
Ha! That's not what this does at all. wait_for_inferior in infrun.c
|
||||
calls IN_SIGTRAMP in order to detect entry into a signal trampoline
|
||||
just after delivery of a signal. But on linux, signal trampolines
|
||||
are used for the return path only. The kernel sets things up so that
|
||||
the signal handler is called directly.
|
||||
Ha! That's not what this does at all. wait_for_inferior in
|
||||
infrun.c calls IN_SIGTRAMP in order to detect entry into a signal
|
||||
trampoline just after delivery of a signal. But on GNU/Linux,
|
||||
signal trampolines are used for the return path only. The kernel
|
||||
sets things up so that the signal handler is called directly.
|
||||
|
||||
If we use in_sigtramp2() in place of in_sigtramp() (see below)
|
||||
we'll (often) end up with stop_pc in the trampoline and prev_pc in
|
||||
@ -773,11 +773,12 @@ ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
|
||||
}
|
||||
|
||||
/* Fetch (and possibly build) an appropriate link_map_offsets
|
||||
structure for Linux/PPC targets using the struct offsets
|
||||
structure for GNU/Linux PPC targets using the struct offsets
|
||||
defined in link.h (but without actual reference to that file).
|
||||
|
||||
This makes it possible to access Linux/PPC shared libraries from a
|
||||
GDB that was not built on an Linux/PPC host (for cross debugging). */
|
||||
This makes it possible to access GNU/Linux PPC shared libraries
|
||||
from a GDB that was not built on an GNU/Linux PPC host (for cross
|
||||
debugging). */
|
||||
|
||||
struct link_map_offsets *
|
||||
ppc_linux_svr4_fetch_link_map_offsets (void)
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* <proc_service.h> implementation.
|
||||
Copyright 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
@ -294,8 +295,8 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
|
||||
return PS_OK;
|
||||
}
|
||||
|
||||
/* Return overall process id of the target PH.
|
||||
Special for Linux -- not used on Solaris. */
|
||||
/* Return overall process id of the target PH. Special for GNU/Linux
|
||||
-- not used on Solaris. */
|
||||
|
||||
pid_t
|
||||
ps_getpid (gdb_ps_prochandle_t ph)
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* Target-dependent code for GDB, the GNU debugger.
|
||||
Copyright 2001 Free Software Foundation, Inc.
|
||||
|
||||
Copyright 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
|
||||
for IBM Deutschland Entwicklung GmbH, IBM Corporation.
|
||||
|
||||
@ -1354,7 +1356,7 @@ is_float_like (struct type *type)
|
||||
|
||||
/* Return non-zero if TYPE is considered a `DOUBLE_OR_FLOAT', as
|
||||
defined by the parameter passing conventions described in the
|
||||
"Linux for S/390 ELF Application Binary Interface Supplement".
|
||||
"GNU/Linux for S/390 ELF Application Binary Interface Supplement".
|
||||
Otherwise, return zero. */
|
||||
static int
|
||||
is_double_or_float (struct type *type)
|
||||
@ -1366,8 +1368,9 @@ is_double_or_float (struct type *type)
|
||||
|
||||
|
||||
/* Return non-zero if TYPE is considered a `SIMPLE_ARG', as defined by
|
||||
the parameter passing conventions described in the "Linux for S/390
|
||||
ELF Application Binary Interface Supplement". Return zero otherwise. */
|
||||
the parameter passing conventions described in the "GNU/Linux for
|
||||
S/390 ELF Application Binary Interface Supplement". Return zero
|
||||
otherwise. */
|
||||
static int
|
||||
is_simple_arg (struct type *type)
|
||||
{
|
||||
@ -1415,8 +1418,9 @@ extend_simple_arg (struct value *arg)
|
||||
|
||||
|
||||
/* Return non-zero if TYPE is a `DOUBLE_ARG', as defined by the
|
||||
parameter passing conventions described in the "Linux for S/390 ELF
|
||||
Application Binary Interface Supplement". Return zero otherwise. */
|
||||
parameter passing conventions described in the "GNU/Linux for S/390
|
||||
ELF Application Binary Interface Supplement". Return zero
|
||||
otherwise. */
|
||||
static int
|
||||
is_double_arg (struct type *type)
|
||||
{
|
||||
@ -1487,8 +1491,8 @@ alignment_of (struct type *type)
|
||||
|
||||
|
||||
/* Put the actual parameter values pointed to by ARGS[0..NARGS-1] in
|
||||
place to be passed to a function, as specified by the "Linux for
|
||||
S/390 ELF Application Binary Interface Supplement".
|
||||
place to be passed to a function, as specified by the "GNU/Linux
|
||||
for S/390 ELF Application Binary Interface Supplement".
|
||||
|
||||
SP is the current stack pointer. We must put arguments, links,
|
||||
padding, etc. whereever they belong, and return the new stack
|
||||
|
Loading…
Reference in New Issue
Block a user