* arm-linux-nat.c: Linux -> GNU/Linux when not talking about the
kernel. * arm-linux-tdep.c: Likewise. * config/arm/tm-linux.h: Likewise.
This commit is contained in:
parent
93247f887c
commit
fdf39c9a14
4 changed files with 45 additions and 34 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2002-02-19 Richard Earnshaw <rearnsha@arm.com>
|
||||||
|
|
||||||
|
* arm-linux-nat.c: Linux -> GNU/Linux when not talking about the
|
||||||
|
kernel.
|
||||||
|
* arm-linux-tdep.c: Likewise.
|
||||||
|
* config/arm/tm-linux.h: Likewise.
|
||||||
|
|
||||||
2002-02-19 Richard Earnshaw <rearnsha@arm.com>
|
2002-02-19 Richard Earnshaw <rearnsha@arm.com>
|
||||||
|
|
||||||
* configure.tgt (arm*-*-netbsd*): This variant is now fully multi-arch.
|
* configure.tgt (arm*-*-netbsd*): This variant is now fully multi-arch.
|
||||||
|
|
|
@ -63,9 +63,9 @@ typedef struct tagFPA11
|
||||||
FPA11;
|
FPA11;
|
||||||
|
|
||||||
/* The following variables are used to determine the version of the
|
/* The following variables are used to determine the version of the
|
||||||
underlying Linux operating system. Examples:
|
underlying GNU/Linux operating system. Examples:
|
||||||
|
|
||||||
Linux 2.0.35 Linux 2.2.12
|
GNU/Linux 2.0.35 GNU/Linux 2.2.12
|
||||||
os_version = 0x00020023 os_version = 0x0002020c
|
os_version = 0x00020023 os_version = 0x0002020c
|
||||||
os_major = 2 os_major = 2
|
os_major = 2 os_major = 2
|
||||||
os_minor = 0 os_minor = 2
|
os_minor = 0 os_minor = 2
|
||||||
|
@ -78,11 +78,11 @@ FPA11;
|
||||||
|
|
||||||
static unsigned int os_version, os_major, os_minor, os_release;
|
static unsigned int os_version, os_major, os_minor, os_release;
|
||||||
|
|
||||||
/* On Linux, threads are implemented as pseudo-processes, in which
|
/* On GNU/Linux, threads are implemented as pseudo-processes, in which
|
||||||
case we may be tracing more than one process at a time. In that
|
case we may be tracing more than one process at a time. In that
|
||||||
case, inferior_ptid will contain the main process ID and the
|
case, inferior_ptid will contain the main process ID and the
|
||||||
individual thread (process) ID. get_thread_id () is used to
|
individual thread (process) ID. get_thread_id () is used to get
|
||||||
get the thread id if it's available, and the process id otherwise. */
|
the thread id if it's available, and the process id otherwise. */
|
||||||
|
|
||||||
int
|
int
|
||||||
get_thread_id (ptid_t ptid)
|
get_thread_id (ptid_t ptid)
|
||||||
|
@ -676,7 +676,7 @@ get_linux_version (unsigned int *vmajor,
|
||||||
|
|
||||||
if (-1 == uname (&info))
|
if (-1 == uname (&info))
|
||||||
{
|
{
|
||||||
warning ("Unable to determine Linux version.");
|
warning ("Unable to determine GNU/Linux version.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,12 +35,13 @@
|
||||||
#include "symfile.h"
|
#include "symfile.h"
|
||||||
#include "objfiles.h"
|
#include "objfiles.h"
|
||||||
|
|
||||||
/* Under ARM Linux the traditional way of performing a breakpoint is to
|
/* Under ARM GNU/Linux the traditional way of performing a breakpoint
|
||||||
execute a particular software interrupt, rather than use a particular
|
is to execute a particular software interrupt, rather than use a
|
||||||
undefined instruction to provoke a trap. Upon exection of the software
|
particular undefined instruction to provoke a trap. Upon exection
|
||||||
interrupt the kernel stops the inferior with a SIGTRAP, and wakes the
|
of the software interrupt the kernel stops the inferior with a
|
||||||
debugger. Since ARM Linux is little endian, and doesn't support Thumb
|
SIGTRAP, and wakes the debugger. Since ARM GNU/Linux is little
|
||||||
at the moment we only override the ARM little-endian breakpoint. */
|
endian, and doesn't support Thumb at the moment we only override
|
||||||
|
the ARM little-endian breakpoint. */
|
||||||
|
|
||||||
static const char arm_linux_arm_le_breakpoint[] = {0x01,0x00,0x9f,0xef};
|
static const char arm_linux_arm_le_breakpoint[] = {0x01,0x00,0x9f,0xef};
|
||||||
|
|
||||||
|
@ -72,7 +73,7 @@ arm_linux_extract_return_value (struct type *type,
|
||||||
char *valbuf)
|
char *valbuf)
|
||||||
{
|
{
|
||||||
/* ScottB: This needs to be looked at to handle the different
|
/* ScottB: This needs to be looked at to handle the different
|
||||||
floating point emulators on ARM Linux. Right now the code
|
floating point emulators on ARM GNU/Linux. Right now the code
|
||||||
assumes that fetch inferior registers does the right thing for
|
assumes that fetch inferior registers does the right thing for
|
||||||
GDB. I suspect this won't handle NWFPE registers correctly, nor
|
GDB. I suspect this won't handle NWFPE registers correctly, nor
|
||||||
will the default ARM version (arm_extract_return_value()). */
|
will the default ARM version (arm_extract_return_value()). */
|
||||||
|
@ -223,8 +224,8 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Dynamic Linking on ARM Linux
|
Dynamic Linking on ARM GNU/Linux
|
||||||
----------------------------
|
--------------------------------
|
||||||
|
|
||||||
Note: PLT = procedure linkage table
|
Note: PLT = procedure linkage table
|
||||||
GOT = global offset table
|
GOT = global offset table
|
||||||
|
@ -251,11 +252,11 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
|
||||||
When the executable or library is first loaded, each GOT entry is
|
When the executable or library is first loaded, each GOT entry is
|
||||||
initialized to point to the code which implements dynamic name
|
initialized to point to the code which implements dynamic name
|
||||||
resolution and code finding. This is normally a function in the
|
resolution and code finding. This is normally a function in the
|
||||||
program interpreter (on ARM Linux this is usually ld-linux.so.2,
|
program interpreter (on ARM GNU/Linux this is usually
|
||||||
but it does not have to be). On the first invocation, the function
|
ld-linux.so.2, but it does not have to be). On the first
|
||||||
is located and the GOT entry is replaced with the real function
|
invocation, the function is located and the GOT entry is replaced
|
||||||
address. Subsequent calls go through steps 1, 2 and 3 and end up
|
with the real function address. Subsequent calls go through steps
|
||||||
calling the real code.
|
1, 2 and 3 and end up calling the real code.
|
||||||
|
|
||||||
1) In the code:
|
1) In the code:
|
||||||
|
|
||||||
|
@ -388,7 +389,7 @@ skip_hurd_resolver (CORE_ADDR pc)
|
||||||
It's kind of gross to do all these checks every time we're
|
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
|
called, since they don't change once the executable has gotten
|
||||||
started. But this is only a temporary hack --- upcoming versions
|
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. */
|
debugging programs that use shared libraries. */
|
||||||
|
|
||||||
struct objfile *objfile;
|
struct objfile *objfile;
|
||||||
|
@ -469,7 +470,8 @@ arm_linux_sigcontext_register_address (CORE_ADDR sp, CORE_ADDR pc, int regno)
|
||||||
|
|
||||||
inst = read_memory_integer (pc, 4);
|
inst = read_memory_integer (pc, 4);
|
||||||
|
|
||||||
if (inst == ARM_LINUX_SIGRETURN_INSTR || inst == ARM_LINUX_RT_SIGRETURN_INSTR)
|
if (inst == ARM_LINUX_SIGRETURN_INSTR
|
||||||
|
|| inst == ARM_LINUX_RT_SIGRETURN_INSTR)
|
||||||
{
|
{
|
||||||
CORE_ADDR sigcontext_addr;
|
CORE_ADDR sigcontext_addr;
|
||||||
|
|
||||||
|
|
|
@ -63,29 +63,31 @@ extern void arm_linux_extract_return_value (struct type *, char[], char *);
|
||||||
extern CORE_ADDR arm_linux_push_arguments (int, struct value **, CORE_ADDR,
|
extern CORE_ADDR arm_linux_push_arguments (int, struct value **, CORE_ADDR,
|
||||||
int, CORE_ADDR);
|
int, CORE_ADDR);
|
||||||
|
|
||||||
/* The first page is not writeable in ARM Linux. */
|
/* The first page is not writeable in ARM GNU/Linux. */
|
||||||
#undef LOWEST_PC
|
#undef LOWEST_PC
|
||||||
#define LOWEST_PC 0x8000
|
#define LOWEST_PC 0x8000
|
||||||
|
|
||||||
/* Define NO_SINGLE_STEP if ptrace(PT_STEP,...) fails to function correctly
|
/* Define NO_SINGLE_STEP if ptrace(PT_STEP,...) fails to function
|
||||||
on ARM Linux. This is the case on 2.0.x kernels, 2.1.x kernels and some
|
correctly on ARM Linux kernel. This is the case on 2.0.x kernels,
|
||||||
2.2.x kernels. This will include the implementation of single_step()
|
2.1.x kernels and some 2.2.x kernels. This will include the
|
||||||
in armlinux-tdep.c. See armlinux-ss.c for more details. */
|
implementation of single_step() in armlinux-tdep.c. See
|
||||||
|
armlinux-ss.c for more details. */
|
||||||
/* #define NO_SINGLE_STEP 1 */
|
/* #define NO_SINGLE_STEP 1 */
|
||||||
|
|
||||||
/* Offset to saved PC in sigcontext structure, from <asm/sigcontext.h> */
|
/* Offset to saved PC in sigcontext structure, from <asm/sigcontext.h> */
|
||||||
#define SIGCONTEXT_PC_OFFSET (sizeof(unsigned long) * 18)
|
#define SIGCONTEXT_PC_OFFSET (sizeof(unsigned long) * 18)
|
||||||
|
|
||||||
/* On ARM Linux, each call to a library routine goes through a small piece
|
/* On ARM GNU/Linux, each call to a library routine goes through a
|
||||||
of trampoline code in the ".plt" section. The wait_for_inferior()
|
small piece of trampoline code in the ".plt" section. The
|
||||||
routine uses this macro to detect when we have stepped into one of
|
wait_for_inferior() routine uses this macro to detect when we have
|
||||||
these fragments. We do not use lookup_solib_trampoline_symbol_by_pc,
|
stepped into one of these fragments. We do not use
|
||||||
because we cannot always find the shared library trampoline symbols. */
|
lookup_solib_trampoline_symbol_by_pc, because we cannot always find
|
||||||
|
the shared library trampoline symbols. */
|
||||||
extern int in_plt_section (CORE_ADDR, char *);
|
extern int in_plt_section (CORE_ADDR, char *);
|
||||||
#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) in_plt_section((pc), (name))
|
#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) in_plt_section((pc), (name))
|
||||||
|
|
||||||
/* On ARM Linux, a call to a library routine does not have to go through
|
/* On ARM GNU/Linux, a call to a library routine does not have to go
|
||||||
any trampoline code. */
|
through any trampoline code. */
|
||||||
#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) 0
|
#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) 0
|
||||||
|
|
||||||
/* If PC is in a shared library trampoline code, return the PC
|
/* If PC is in a shared library trampoline code, return the PC
|
||||||
|
|
Loading…
Add table
Reference in a new issue