From: Richard Earnshaw <rearnsha@arm.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: Richard.Earnshaw@arm.com, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] fix inferior_pid argument for arm-netbsd
Date: Wed, 09 Jan 2002 07:54:00 -0000 [thread overview]
Message-ID: <200201091553.PAA04585@cam-mail2.cambridge.arm.com> (raw)
In-Reply-To: Your message of "Wed, 09 Jan 2002 08:39:50 MST." <1020109153950.ZM31326@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 480 bytes --]
> On Jan 9, 1:38pm, Richard Earnshaw wrote:
>
> > * armnbsd-nat.c (fetch_inferior_registers): Change inferior_pid ->
> > inferior_ptid.pid.
>
> Please don't do it this way. Use the accessor functions instead. I've
> looked over your patch, and in each case, you can simply use
>
> ptid_get_pid (inferior_ptid)
>
Ah! I wasn't aware of the accessor functions. In fact, most targets are
using the macro GETPID (from defs.h). I've fixed the code to use that.
R.
[-- Attachment #2: pid.patch --]
[-- Type: text/x-patch , Size: 2214 bytes --]
Index: armnbsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/armnbsd-nat.c,v
retrieving revision 1.1
diff -p -r1.1 armnbsd-nat.c
*** armnbsd-nat.c 2001/12/17 21:14:10 1.1
--- armnbsd-nat.c 2002/01/09 15:51:15
*************** fetch_inferior_registers (regno)
*** 34,46 ****
struct reg inferior_registers;
struct fpreg inferior_fpregisters;
! ptrace (PT_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_registers, 0);
memcpy (®isters[REGISTER_BYTE (0)], &inferior_registers,
16 * sizeof (unsigned int));
memcpy (®isters[REGISTER_BYTE (PS_REGNUM)], &inferior_registers.r_cpsr,
sizeof (unsigned int));
! ptrace (PT_GETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_fpregisters,
! 0);
memcpy (®isters[REGISTER_BYTE (F0_REGNUM)], &inferior_fpregisters.fpr[0],
8 * sizeof (fp_reg_t));
memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)],
--- 34,47 ----
struct reg inferior_registers;
struct fpreg inferior_fpregisters;
! ptrace (PT_GETREGS, PIDGET (inferior_ptid),
! (PTRACE_ARG3_TYPE) &inferior_registers, 0);
memcpy (®isters[REGISTER_BYTE (0)], &inferior_registers,
16 * sizeof (unsigned int));
memcpy (®isters[REGISTER_BYTE (PS_REGNUM)], &inferior_registers.r_cpsr,
sizeof (unsigned int));
! ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
! (PTRACE_ARG3_TYPE) &inferior_fpregisters, 0);
memcpy (®isters[REGISTER_BYTE (F0_REGNUM)], &inferior_fpregisters.fpr[0],
8 * sizeof (fp_reg_t));
memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)],
*************** store_inferior_registers (regno)
*** 58,64 ****
16 * sizeof (unsigned int));
memcpy (&inferior_registers.r_cpsr, ®isters[REGISTER_BYTE (PS_REGNUM)],
sizeof (unsigned int));
! ptrace (PT_SETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_registers, 0);
/* XXX Set FP regs. */
}
--- 59,66 ----
16 * sizeof (unsigned int));
memcpy (&inferior_registers.r_cpsr, ®isters[REGISTER_BYTE (PS_REGNUM)],
sizeof (unsigned int));
! ptrace (PT_SETREGS, PIDGET (inferior_ptid),
! (PTRACE_ARG3_TYPE) &inferior_registers, 0);
/* XXX Set FP regs. */
}
next prev parent reply other threads:[~2002-01-09 15:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-09 5:39 Richard Earnshaw
[not found] ` <rearnsha@arm.com>
2002-01-09 7:40 ` Kevin Buettner
2002-01-09 7:54 ` Richard Earnshaw [this message]
2002-01-10 9:59 ` Richard Earnshaw
2002-01-10 10:38 ` Kevin Buettner
2002-01-12 9:47 ` [PATCH] ARM: Eliminate EXTRA_FRAME_INFO & FRAME_FIND_SAVED_REGS Kevin Buettner
2002-01-13 7:28 ` Richard Earnshaw
2002-01-13 9:32 ` Kevin Buettner
2002-01-13 10:40 ` Andrew Cagney
2002-01-13 11:08 ` Andrew Cagney
2002-01-13 11:48 ` Kevin Buettner
2002-01-13 11:54 ` Andrew Cagney
2002-01-14 2:18 ` Richard Earnshaw
2002-01-12 3:51 Richard Earnshaw
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200201091553.PAA04585@cam-mail2.cambridge.arm.com \
--to=rearnsha@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=gdb-patches@sources.redhat.com \
--cc=kevinb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox