aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-linux-nat.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>2000-09-22 17:45:47 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>2000-09-22 17:45:47 +0000
commitd5d653533c52e5f5f417afedf6ff3c6e6311e5ac (patch)
treed0c7459f1a757906fb5810a8400b11ab629b24f9 /gdb/i386-linux-nat.c
parent151337e87933dfb13a87703c0c9c2cf2f1f6084e (diff)
downloadfsf-binutils-gdb-d5d653533c52e5f5f417afedf6ff3c6e6311e5ac.zip
fsf-binutils-gdb-d5d653533c52e5f5f417afedf6ff3c6e6311e5ac.tar.gz
fsf-binutils-gdb-d5d653533c52e5f5f417afedf6ff3c6e6311e5ac.tar.bz2
* i386-linux-nat.c (OLD_CANNOT_FETCH_REGISTER,
OLD_CANNOT_FETCH_REGISTER): New definitions for accessible registers when accessing the registers via the U area. (fetch_register, store_register): Use them. (cannot_fetch_register, cannot_store_register): New functions, all registers should be accessible if we have GETREGS support. * config/i386/nm-linux.h: Use cannot_fetch/store_register for CANNOT_FETCH/STORE_REGISTER definitions.
Diffstat (limited to 'gdb/i386-linux-nat.c')
-rw-r--r--gdb/i386-linux-nat.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 15e6a18..a1bc3d7 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -133,9 +133,7 @@ int have_ptrace_getfpxregs =
#endif
/* Registers we shouldn't try to fetch. */
-#if !defined (CANNOT_FETCH_REGISTER)
-#define CANNOT_FETCH_REGISTER(regno) 0
-#endif
+#define OLD_CANNOT_FETCH_REGISTER(regno) ((regno) >= NUM_GREGS)
/* Fetch one register. */
@@ -150,7 +148,7 @@ fetch_register (int regno)
char buf[MAX_REGISTER_RAW_SIZE];
int tid;
- if (CANNOT_FETCH_REGISTER (regno))
+ if (OLD_CANNOT_FETCH_REGISTER (regno))
{
memset (buf, '\0', REGISTER_RAW_SIZE (regno)); /* Supply zeroes */
supply_register (regno, buf);
@@ -201,9 +199,7 @@ old_fetch_inferior_registers (int regno)
}
/* Registers we shouldn't try to store. */
-#if !defined (CANNOT_STORE_REGISTER)
-#define CANNOT_STORE_REGISTER(regno) 0
-#endif
+#define OLD_CANNOT_STORE_REGISTER(regno) ((regno) >= NUM_GREGS)
/* Store one register. */
@@ -217,7 +213,7 @@ store_register (int regno)
unsigned int offset; /* Offset of registers within the u area. */
int tid;
- if (CANNOT_STORE_REGISTER (regno))
+ if (OLD_CANNOT_STORE_REGISTER (regno))
{
return;
}
@@ -513,6 +509,26 @@ static void dummy_sse_values (void) {}
/* 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)
+{
+ if (! have_ptrace_getregs)
+ return OLD_CANNOT_FETCH_REGISTER (regno);
+ return 0;
+}
+int
+cannot_store_register (int regno)
+{
+ if (! have_ptrace_getregs)
+ return OLD_CANNOT_STORE_REGISTER (regno);
+ return 0;
+}
+
/* Fetch register REGNO from the child process. If REGNO is -1, do
this for all registers (including the floating point and SSE
registers). */