X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fsparc-nat.c;h=5dc17b3b64507df9b10b5eb1520ca50a18078535;hb=a5b5adf529fa64391bc1ef733b3e78f15d94c4b9;hp=b058ccf1e78434c4c9a4b19d0530344b98739e80;hpb=61baf725eca99af2569262d10aca03dcde2698f6;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c index b058ccf1e7..5dc17b3b64 100644 --- a/gdb/sparc-nat.c +++ b/gdb/sparc-nat.c @@ -1,6 +1,6 @@ /* Native-dependent code for SPARC. - Copyright (C) 2003-2017 Free Software Foundation, Inc. + Copyright (C) 2003-2018 Free Software Foundation, Inc. This file is part of GDB. @@ -137,8 +137,8 @@ void sparc_fetch_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regnum) { - struct gdbarch *gdbarch = get_regcache_arch (regcache); - int pid; + struct gdbarch *gdbarch = regcache->arch (); + pid_t pid; /* NOTE: cagney/2002-12-03: This code assumes that the currently selected light weight processes' registers can be written @@ -153,9 +153,7 @@ sparc_fetch_inferior_registers (struct target_ops *ops, These functions should instead be paramaterized with an explicit object (struct regcache, struct thread_info?) into which the LWPs registers can be written. */ - pid = ptid_get_lwp (inferior_ptid); - if (pid == 0) - pid = ptid_get_pid (inferior_ptid); + pid = get_ptrace_pid (regcache_get_ptid (regcache)); if (regnum == SPARC_G0_REGNUM) { @@ -192,14 +190,12 @@ void sparc_store_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regnum) { - struct gdbarch *gdbarch = get_regcache_arch (regcache); - int pid; + struct gdbarch *gdbarch = regcache->arch (); + pid_t pid; /* NOTE: cagney/2002-12-02: See comment in fetch_inferior_registers about threaded assumptions. */ - pid = ptid_get_lwp (inferior_ptid); - if (pid == 0) - pid = ptid_get_pid (inferior_ptid); + pid = get_ptrace_pid (regcache_get_ptid (regcache)); if (regnum == -1 || sparc_gregset_supplies_p (gdbarch, regnum)) { @@ -342,10 +338,6 @@ sparc_target (void) return t; } - -/* Provide a prototype to silence -Wmissing-prototypes. */ -void _initialize_sparc_nat (void); - void _initialize_sparc_nat (void) {