aboutsummaryrefslogtreecommitdiff
path: root/gdb/x86-64-linux-nat.c
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2002-01-20 09:29:41 +0000
committerAndreas Jaeger <aj@suse.de>2002-01-20 09:29:41 +0000
commitb7c4cbf8b4a2e7982be529ef16721b26f8d987b0 (patch)
treec82ea7a5e251064e53a22184a49bd8a2a37a1deb /gdb/x86-64-linux-nat.c
parentabf22e64b87ca49a240cf75576070fc8cd3db04b (diff)
downloadgdb-b7c4cbf8b4a2e7982be529ef16721b26f8d987b0.zip
gdb-b7c4cbf8b4a2e7982be529ef16721b26f8d987b0.tar.gz
gdb-b7c4cbf8b4a2e7982be529ef16721b26f8d987b0.tar.bz2
2002-01-20 Jiri Smid <smid@suse.cz>
* config/i386/x86-64linux.mh (NATDEPFILES): x86-64-nat.o removed. * x86-64-linux-nat.c (x86_64_register_u_addr): New function. * config/i386/nm-x86-64.h (ATTACH_LWP): Removed. * Makefile.in (x86-64-tdep.o, x86-64-linux-tdep.o, x86-64-linux-nat.o): Fix dependencies.
Diffstat (limited to 'gdb/x86-64-linux-nat.c')
-rw-r--r--gdb/x86-64-linux-nat.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/x86-64-linux-nat.c b/gdb/x86-64-linux-nat.c
index 978df95..eb63566 100644
--- a/gdb/x86-64-linux-nat.c
+++ b/gdb/x86-64-linux-nat.c
@@ -558,6 +558,29 @@ static long debug_control_mirror;
/* Record which address associates with which register. */
static CORE_ADDR address_lookup[DR_LASTADDR - DR_FIRSTADDR + 1];
+/* Return the address of register REGNUM. BLOCKEND is the value of
+ u.u_ar0, which should point to the registers. */
+CORE_ADDR
+x86_64_register_u_addr (CORE_ADDR blockend, int regnum)
+{
+ struct user u;
+ CORE_ADDR fpstate;
+ CORE_ADDR ubase;
+ ubase = blockend;
+ if (IS_FP_REGNUM(regnum))
+ {
+ fpstate = ubase + ((char *) &u.i387.st_space - (char *) &u);
+ return (fpstate + 16 * (regnum - FP0_REGNUM));
+ }
+ else if (IS_SSE_REGNUM(regnum))
+ {
+ fpstate = ubase + ((char *) &u.i387.xmm_space - (char *) &u);
+ return (fpstate + 16 * (regnum - XMM0_REGNUM));
+ }
+ else
+ return (ubase + 8 * x86_64_regmap[regnum]);
+}
+
void
_initialize_x86_64_linux_nat (void)
{