aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-linux-nat.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2007-04-25 22:10:09 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2007-04-25 22:10:09 +0000
commitde732108dddc7254366a437fae458ecac7d45b84 (patch)
treed173fea0e1c74ffccdea7d6235fde816391f9e5d /gdb/i386-linux-nat.c
parentef783a7dfcaf475fef1fc46bc987bfd5e8b66839 (diff)
downloadgdb-de732108dddc7254366a437fae458ecac7d45b84.zip
gdb-de732108dddc7254366a437fae458ecac7d45b84.tar.gz
gdb-de732108dddc7254366a437fae458ecac7d45b84.tar.bz2
* core-aout.c: Delete file.
* Makefile.in (ALLDEPFILES): Remove core-aout.c. (core-aout.o): Delete rule. * gdbcore.h (kernel_u_addr, KERNEL_U_ADDR): Remove. * config/alpha/nm-linux.h (U_REGS_OFFSET): Remove. * arm-linux-nat.c (arm_linux_kernel_u_size): Remove. * config/arm/nm-linux.h (U_REGS_OFFSET, KERNEL_U_SIZE, KERNEL_U_ADDR): Remove. * i386-linux-nat.c (register_u_addr, kernel_u_size): Remove. (cannot_fetch_register, cannot_store_register): Remove. (fetch_register): Inline cannot_fetch_register and register_addr. (store_register): Inline cannot_store_register and register_addr. * config/i386/linux.mh (NATDEPFILES): Remove core-aout.o. * config/i386/nm-linux.h (KERNEL_U_SIZE, KERNEL_U_ADDR, REGISTER_U_ADDR, CANNOT_FETCH_REGISTER, CANNOT_STORE_REGISTER): Remove. * m68klinux-nat.c (m68k_linux_register_u_addr, kernel_u_size): Remove. (fetch_register): Inline register_addr. (store_register): Inline register_addr. * config/m68k/linux.mh (NATDEPFILES): Remove core-aout.o. * config/m68k/nm-linux.h (KERNEL_U_SIZE, KERNEL_U_ADDR, U_REGS_OFFSET, REGISTER_U_ADDR): Remove. * config/mips/nm-irix5.h (REGISTER_U_ADDR): Remove. * config/mips/nm-linux.h (KERNEL_U_SIZE, U_REGS_OFFSET, REGISTER_U_ADDR): Remove. * hppa-linux-nat.c (register_addr): Rename to ... (hppa_linux_register_addr): ... this. Make static. (fetch_register, store_register): Adapt callers. * config/pa/nm-linux.h (U_REGS_OFFSET): Remove. * ppc-linux-nat.c (kernel_u_size): Remove. * config/powerpc/nm-linux.h (KERNEL_U_SIZE, KERNEL_U_ADDR): Remove. * vax-nat.c (vax_kernel_u_addr, vax_register_u_addr): Make static. * config/vax/vax.mh (NATDEPFILES): Remove core-aout.o. (NAT_FILE): Remove. * config/vax/nm-vax.h: Delete file.
Diffstat (limited to 'gdb/i386-linux-nat.c')
-rw-r--r--gdb/i386-linux-nat.c47
1 files changed, 4 insertions, 43 deletions
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 93b335b..dfa260e 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -137,26 +137,6 @@ int have_ptrace_getfpxregs =
;
-/* Support for the user struct. */
-
-/* Return the address of register REGNUM. BLOCKEND is the value of
- u.u_ar0, which should point to the registers. */
-
-CORE_ADDR
-register_u_addr (CORE_ADDR blockend, int regnum)
-{
- return (blockend + 4 * regmap[regnum]);
-}
-
-/* Return the size of the user struct. */
-
-int
-kernel_u_size (void)
-{
- return (sizeof (struct user));
-}
-
-
/* Accessing registers through the U area, one at a time. */
/* Fetch one register. */
@@ -168,7 +148,7 @@ fetch_register (int regno)
int val;
gdb_assert (!have_ptrace_getregs);
- if (cannot_fetch_register (regno))
+ if (regmap[regno] == -1)
{
regcache_raw_supply (current_regcache, regno, NULL);
return;
@@ -180,7 +160,7 @@ fetch_register (int regno)
tid = PIDGET (inferior_ptid); /* Not a threaded program. */
errno = 0;
- val = ptrace (PTRACE_PEEKUSER, tid, register_addr (regno, 0), 0);
+ val = ptrace (PTRACE_PEEKUSER, tid, 4 * regmap[regno], 0);
if (errno != 0)
error (_("Couldn't read register %s (#%d): %s."), REGISTER_NAME (regno),
regno, safe_strerror (errno));
@@ -197,7 +177,7 @@ store_register (int regno)
int val;
gdb_assert (!have_ptrace_getregs);
- if (cannot_store_register (regno))
+ if (regmap[regno] == -1)
return;
/* GNU/Linux LWP ID's are process ID's. */
@@ -207,7 +187,7 @@ store_register (int regno)
errno = 0;
regcache_raw_collect (current_regcache, regno, &val);
- ptrace (PTRACE_POKEUSER, tid, register_addr (regno, 0), val);
+ ptrace (PTRACE_POKEUSER, tid, 4 * regmap[regno], val);
if (errno != 0)
error (_("Couldn't write register %s (#%d): %s."), REGISTER_NAME (regno),
regno, safe_strerror (errno));
@@ -458,25 +438,6 @@ static int store_fpxregs (int tid, int regno) { return 0; }
/* Transferring arbitrary registers between GDB and inferior. */
-/* Check if register REGNO in the child process is accessible.
- If we are accessing registers directly via the U area, only the
- general-purpose registers are available.
- All registers should be accessible if we have GETREGS support. */
-
-int
-cannot_fetch_register (int regno)
-{
- gdb_assert (regno >= 0 && regno < NUM_REGS);
- return (!have_ptrace_getregs && regmap[regno] == -1);
-}
-
-int
-cannot_store_register (int regno)
-{
- gdb_assert (regno >= 0 && regno < NUM_REGS);
- return (!have_ptrace_getregs && regmap[regno] == -1);
-}
-
/* Fetch register REGNO from the child process. If REGNO is -1, do
this for all registers (including the floating point and SSE
registers). */