Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/nathanw_sa]: src/gnu/dist/toolchain/gdb In fetch_inferior_registers() an...
details: https://anonhg.NetBSD.org/src/rev/41a67331104b
branches: nathanw_sa
changeset: 506347:41a67331104b
user: nathanw <nathanw%NetBSD.org@localhost>
date: Wed Oct 16 19:41:26 2002 +0000
description:
In fetch_inferior_registers() and store_inferior_registers(), deconstruct
inferior_pid into the PID and LWP id, and pass both to ptrace.
diffstat:
gnu/dist/toolchain/gdb/i386nbsd-nat.c | 28 ++++++++++++++--------------
gnu/dist/toolchain/gdb/ppcnbsd-nat.c | 12 ++++++++----
2 files changed, 22 insertions(+), 18 deletions(-)
diffs (95 lines):
diff -r 263a7380360f -r 41a67331104b gnu/dist/toolchain/gdb/i386nbsd-nat.c
--- a/gnu/dist/toolchain/gdb/i386nbsd-nat.c Wed Oct 16 19:38:48 2002 +0000
+++ b/gnu/dist/toolchain/gdb/i386nbsd-nat.c Wed Oct 16 19:41:26 2002 +0000
@@ -330,25 +330,25 @@
struct xmmctx inferior_xmmregisters;
#endif
- ptrace (PT_GETREGS, inferior_pid,
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+ ptrace (PT_GETREGS, GET_PROCESS(inferior_pid),
+ (PTRACE_ARG3_TYPE) &inferior_registers, GET_LWP(inferior_pid));
#ifdef PT_GETXMMREGS
if (have_ptrace_xmmregs != 0 &&
- ptrace(PT_GETXMMREGS, inferior_pid,
- (PTRACE_ARG3_TYPE) &inferior_xmmregisters, 0) == 0)
+ ptrace(PT_GETXMMREGS, GET_PROCESS(inferior_pid),
+ (PTRACE_ARG3_TYPE) &inferior_xmmregisters, GET_LWP(inferior_pid)) == 0)
{
have_ptrace_xmmregs = 1;
}
else
{
- ptrace (PT_GETFPREGS, inferior_pid,
- (PTRACE_ARG3_TYPE) &inferior_fpregisters, 0);
+ ptrace (PT_GETFPREGS, GET_PROCESS(inferior_pid),
+ (PTRACE_ARG3_TYPE) &inferior_fpregisters, GET_LWP(inferior_pid));
have_ptrace_xmmregs = 0;
}
#else
- ptrace (PT_GETFPREGS, inferior_pid,
- (PTRACE_ARG3_TYPE) &inferior_fpregisters, 0);
+ ptrace (PT_GETFPREGS, GET_PROCESS(inferior_pid),
+ (PTRACE_ARG3_TYPE) &inferior_fpregisters, GET_LWP(inferior_pid));
#endif
supply_regs (&inferior_registers);
@@ -386,16 +386,16 @@
#endif
unsupply_387regs(&inferior_fpregisters);
- ptrace (PT_SETREGS, inferior_pid,
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+ ptrace (PT_SETREGS, GET_PROCESS(inferior_pid),
+ (PTRACE_ARG3_TYPE) &inferior_registers, GET_LWP(inferior_pid));
#ifdef PT_GETXMMREGS
if (have_ptrace_xmmregs != 0)
- ptrace (PT_SETXMMREGS, inferior_pid,
- (PTRACE_ARG3_TYPE) &inferior_xmmregisters, 0);
+ ptrace (PT_SETXMMREGS, GET_PROCESS(inferior_pid),
+ (PTRACE_ARG3_TYPE) &inferior_xmmregisters, GET_LWP(inferior_pid));
else
#endif
- ptrace (PT_SETFPREGS, inferior_pid,
- (PTRACE_ARG3_TYPE) &inferior_fpregisters, 0);
+ ptrace (PT_SETFPREGS, GET_PROCESS(inferior_pid),
+ (PTRACE_ARG3_TYPE) &inferior_fpregisters, GET_LWP(inferior_pid));
}
struct md_core
diff -r 263a7380360f -r 41a67331104b gnu/dist/toolchain/gdb/ppcnbsd-nat.c
--- a/gnu/dist/toolchain/gdb/ppcnbsd-nat.c Wed Oct 16 19:38:48 2002 +0000
+++ b/gnu/dist/toolchain/gdb/ppcnbsd-nat.c Wed Oct 16 19:41:26 2002 +0000
@@ -121,11 +121,13 @@
struct fpreg inffpreg;
/* Integer registers */
- ptrace(PT_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &infreg, 0);
+ ptrace(PT_GETREGS, GET_PROCESS(inferior_pid), (PTRACE_ARG3_TYPE) &infreg,
+ GET_LWP(inferior_pid));
supply_regs ((char *) &infreg);
/* Floating point registers */
- ptrace(PT_GETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inffpreg, 0);
+ ptrace(PT_GETFPREGS, GET_PROCESS(inferior_pid), (PTRACE_ARG3_TYPE) &inffpreg,
+ GET_LWP(inferior_pid));
supply_fpregs ((char *) &inffpreg);
}
@@ -137,11 +139,13 @@
struct fpreg inffpreg;
unsupply_regs((char *)&infreg);
- ptrace(PT_SETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &infreg, 0);
+ ptrace(PT_SETREGS, GET_PROCESS(inferior_pid), (PTRACE_ARG3_TYPE) &infreg,
+ GET_LWP(inferior_pid));
/* Floating point registers */
unsupply_fpregs(&inffpreg);
- ptrace(PT_SETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inffpreg, 0);
+ ptrace(PT_SETFPREGS, GET_PROCESS(inferior_pid), (PTRACE_ARG3_TYPE) &inffpreg,
+ GET_LWP(inferior_pid));
}
static void
Home |
Main Index |
Thread Index |
Old Index