/* Native-dependent code for SPARC.
- Copyright (C) 2003-2014 Free Software Foundation, Inc.
+ Copyright (C) 2003-2017 Free Software Foundation, Inc.
This file is part of GDB.
#include "regcache.h"
#include "target.h"
-#include "gdb_assert.h"
#include <signal.h>
-#include <string.h>
#include <sys/ptrace.h>
#include "gdb_wait.h"
#ifdef HAVE_MACHINE_REG_H
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
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)
{
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))
{
return t;
}
-\f
-/* Provide a prototype to silence -Wmissing-prototypes. */
-void _initialize_sparc_nat (void);
-
void
_initialize_sparc_nat (void)
{