aboutsummaryrefslogtreecommitdiff
path: root/gdb/x86-64-linux-nat.c
diff options
context:
space:
mode:
authorMichal Ludvig <mludvig@suse.cz>2002-04-04 13:18:59 +0000
committerMichal Ludvig <mludvig@suse.cz>2002-04-04 13:18:59 +0000
commit7b3fabf05efd936e000be6423eb7540e3570bbe3 (patch)
treebae4bfc62b6d713f446abfcb2a23e14b447a788c /gdb/x86-64-linux-nat.c
parentf22ba854c71b449a6010911d8b7decf66ca1f0a7 (diff)
downloadgdb-7b3fabf05efd936e000be6423eb7540e3570bbe3.zip
gdb-7b3fabf05efd936e000be6423eb7540e3570bbe3.tar.gz
gdb-7b3fabf05efd936e000be6423eb7540e3570bbe3.tar.bz2
* x86-64-linux-nat.c (child_xfer_memory): x86-64 ptrace() ABI change sync
Diffstat (limited to 'gdb/x86-64-linux-nat.c')
-rw-r--r--gdb/x86-64-linux-nat.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/gdb/x86-64-linux-nat.c b/gdb/x86-64-linux-nat.c
index 4e15cb9..596e393 100644
--- a/gdb/x86-64-linux-nat.c
+++ b/gdb/x86-64-linux-nat.c
@@ -43,7 +43,7 @@ static int x86_64_regmap[] = {
RSI, RDI, RBP, RSP,
R8, R9, R10, R11,
R12, R13, R14, R15,
- RIP, EFLAGS,
+ RIP, EFLAGS,
DS, ES, FS, GS
};
@@ -87,8 +87,7 @@ x86_64_linux_dr_set (int regnum, unsigned long value)
tid = PIDGET (inferior_ptid);
errno = 0;
- ptrace (PT_WRITE_U, tid,
- offsetof (struct user, u_debugreg[regnum]), value);
+ ptrace (PT_WRITE_U, tid, offsetof (struct user, u_debugreg[regnum]), value);
if (errno != 0)
perror_with_name ("Couldn't write debug register");
}
@@ -173,7 +172,7 @@ fetch_regs (int tid)
elf_gregset_t regs;
if (ptrace (PTRACE_GETREGS, tid, 0, (long) &regs) < 0)
- perror_with_name ("Couldn't get registers");
+ perror_with_name ("Couldn't get registers");
supply_gregset (&regs);
}
@@ -441,16 +440,17 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
if (addr != memaddr || len < (int) sizeof (PTRACE_XFER_TYPE))
{
/* Need part of initial word -- fetch it. */
- ptrace (PT_READ_I, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) addr, buffer);
+ buffer[0] = ptrace (PT_READ_I, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) addr, 0);
}
if (count > 1) /* FIXME, avoid if even boundary */
{
- ptrace (PT_READ_I, PIDGET (inferior_ptid),
- ((PTRACE_ARG3_TYPE)
- (addr + (count - 1) * sizeof (PTRACE_XFER_TYPE))),
- buffer + count - 1);
+ buffer[count - 1] = ptrace (PT_READ_I, PIDGET (inferior_ptid),
+ ((PTRACE_ARG3_TYPE)
+ (addr +
+ (count -
+ 1) * sizeof (PTRACE_XFER_TYPE))), 0);
}
/* Copy data to be written over corresponding part of buffer */
@@ -486,8 +486,8 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
{
errno = 0;
- ptrace (PT_READ_I, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) addr, buffer + i);
+ buffer[i] = ptrace (PT_READ_I, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) addr, 0);
if (errno)
return 0;
}
@@ -580,12 +580,12 @@ x86_64_register_u_addr (CORE_ADDR blockend, int regnum)
CORE_ADDR fpstate;
CORE_ADDR ubase;
ubase = blockend;
- if (IS_FP_REGNUM(regnum))
+ 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))
+ else if (IS_SSE_REGNUM (regnum))
{
fpstate = ubase + ((char *) &u.i387.xmm_space - (char *) &u);
return (fpstate + 16 * (regnum - XMM0_REGNUM));