Enable rthreads support on OpenBSD/hppa

gdb/
2015-03-05  Mark Kettenis  <kettenis@gnu.org>

        * hppabsd-nat.c: Remove file.
        * hppaobsd-nat.c: New file.
        * Makefile.in (ALLDEPFILES): Remove hppabsd-nat.c.  Add
        hppaobsd-nat.c.
        * config/pa/obsd.mh (NATDEPFILES): Replace hppabsd-nat.o with
        hppaobsd-nat.o.
This commit is contained in:
Mark Kettenis 2015-03-05 17:12:42 +01:00
parent beb8418f47
commit 2dcb2b1a45
4 changed files with 39 additions and 29 deletions

View File

@ -1,3 +1,12 @@
2015-03-05 Mark Kettenis <kettenis@gnu.org>
* hppabsd-nat.c: Remove file.
* hppaobsd-nat.c: New file.
* Makefile.in (ALLDEPFILES): Remove hppabsd-nat.c. Add
hppaobsd-nat.c.
* config/pa/obsd.mh (NATDEPFILES): Replace hppabsd-nat.o with
hppaobsd-nat.o.
2015-03-04 Pedro Alves <palves@redhat.com>
* target.h (struct target_ops) <to_decr_pc_after_break>: Delete.

View File

@ -1656,9 +1656,9 @@ ALLDEPFILES = \
go32-nat.c h8300-tdep.c \
hppa-tdep.c hppa-hpux-tdep.c hppa-hpux-nat.c \
hppa-linux-tdep.c hppa-linux-nat.c \
hppabsd-nat.c hppabsd-tdep.c \
hppaobsd-tdep.c \
hppabsd-tdep.c \
hppanbsd-nat.c hppanbsd-tdep.c \
hppaobsd-nat.c hppaobsd-tdep.c \
i386-tdep.c i386-linux-nat.c \
i386v4-nat.c i386-cygwin-tdep.c \
i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c i386fbsd-tdep.c \

View File

@ -1,2 +1,2 @@
# Host: OpenBSD/hppa
NATDEPFILES= fork-child.o inf-ptrace.o hppabsd-nat.o
NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o hppaobsd-nat.o

View File

@ -1,4 +1,4 @@
/* Native-dependent code for HP PA-RISC BSD's.
/* Native-dependent code for OpenBSD/hppa.
Copyright (C) 2004-2015 Free Software Foundation, Inc.
@ -29,14 +29,16 @@
#include "hppa-tdep.h"
#include "inf-ptrace.h"
#include "obsd-nat.h"
static int
hppabsd_gregset_supplies_p (int regnum)
hppaobsd_gregset_supplies_p (int regnum)
{
return (regnum >= HPPA_R0_REGNUM && regnum <= HPPA_CR27_REGNUM);
}
static int
hppabsd_fpregset_supplies_p (int regnum)
hppaobsd_fpregset_supplies_p (int regnum)
{
return (regnum >= HPPA_FP0_REGNUM && regnum <= HPPA_FP31R_REGNUM);
}
@ -44,7 +46,7 @@ hppabsd_fpregset_supplies_p (int regnum)
/* Supply the general-purpose registers stored in GREGS to REGCACHE. */
static void
hppabsd_supply_gregset (struct regcache *regcache, const void *gregs)
hppaobsd_supply_gregset (struct regcache *regcache, const void *gregs)
{
gdb_byte zero[4] = { 0 };
const char *regs = gregs;
@ -84,7 +86,7 @@ hppabsd_supply_gregset (struct regcache *regcache, const void *gregs)
/* Supply the floating-point registers stored in FPREGS to REGCACHE. */
static void
hppabsd_supply_fpregset (struct regcache *regcache, const void *fpregs)
hppaobsd_supply_fpregset (struct regcache *regcache, const void *fpregs)
{
const char *regs = fpregs;
int regnum;
@ -101,7 +103,7 @@ hppabsd_supply_fpregset (struct regcache *regcache, const void *fpregs)
in GREGS. */
static void
hppabsd_collect_gregset (const struct regcache *regcache,
hppaobsd_collect_gregset (const struct regcache *regcache,
void *gregs, int regnum)
{
char *regs = gregs;
@ -163,8 +165,8 @@ hppabsd_collect_gregset (const struct regcache *regcache,
in FPREGS. */
static void
hppabsd_collect_fpregset (struct regcache *regcache,
void *fpregs, int regnum)
hppaobsd_collect_fpregset (struct regcache *regcache,
void *fpregs, int regnum)
{
char *regs = fpregs;
int i;
@ -184,10 +186,10 @@ hppabsd_collect_fpregset (struct regcache *regcache,
for all registers (including the floating-point registers). */
static void
hppabsd_fetch_registers (struct target_ops *ops,
struct regcache *regcache, int regnum)
hppaobsd_fetch_registers (struct target_ops *ops,
struct regcache *regcache, int regnum)
{
if (regnum == -1 || hppabsd_gregset_supplies_p (regnum))
if (regnum == -1 || hppaobsd_gregset_supplies_p (regnum))
{
struct reg regs;
@ -195,10 +197,10 @@ hppabsd_fetch_registers (struct target_ops *ops,
(PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
hppabsd_supply_gregset (regcache, &regs);
hppaobsd_supply_gregset (regcache, &regs);
}
if (regnum == -1 || hppabsd_fpregset_supplies_p (regnum))
if (regnum == -1 || hppaobsd_fpregset_supplies_p (regnum))
{
struct fpreg fpregs;
@ -206,7 +208,7 @@ hppabsd_fetch_registers (struct target_ops *ops,
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't get floating point status"));
hppabsd_supply_fpregset (regcache, &fpregs);
hppaobsd_supply_fpregset (regcache, &fpregs);
}
}
@ -214,10 +216,10 @@ hppabsd_fetch_registers (struct target_ops *ops,
this for all registers (including the floating-point registers). */
static void
hppabsd_store_registers (struct target_ops *ops,
struct regcache *regcache, int regnum)
hppaobsd_store_registers (struct target_ops *ops,
struct regcache *regcache, int regnum)
{
if (regnum == -1 || hppabsd_gregset_supplies_p (regnum))
if (regnum == -1 || hppaobsd_gregset_supplies_p (regnum))
{
struct reg regs;
@ -225,14 +227,14 @@ hppabsd_store_registers (struct target_ops *ops,
(PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
hppabsd_collect_gregset (regcache, &regs, regnum);
hppaobsd_collect_gregset (regcache, &regs, regnum);
if (ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid),
(PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't write registers"));
}
if (regnum == -1 || hppabsd_fpregset_supplies_p (regnum))
if (regnum == -1 || hppaobsd_fpregset_supplies_p (regnum))
{
struct fpreg fpregs;
@ -240,7 +242,7 @@ hppabsd_store_registers (struct target_ops *ops,
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't get floating point status"));
hppabsd_collect_fpregset (regcache, &fpregs, regnum);
hppaobsd_collect_fpregset (regcache, &fpregs, regnum);
if (ptrace (PT_SETFPREGS, ptid_get_pid (inferior_ptid),
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
@ -249,16 +251,15 @@ hppabsd_store_registers (struct target_ops *ops,
}
/* Provide a prototype to silence -Wmissing-prototypes. */
void _initialize_hppabsd_nat (void);
void _initialize_hppaobsd_nat (void);
void
_initialize_hppabsd_nat (void)
_initialize_hppaobsd_nat (void)
{
struct target_ops *t;
/* Add in local overrides. */
t = inf_ptrace_target ();
t->to_fetch_registers = hppabsd_fetch_registers;
t->to_store_registers = hppabsd_store_registers;
add_target (t);
t->to_fetch_registers = hppaobsd_fetch_registers;
t->to_store_registers = hppaobsd_store_registers;
obsd_add_target (t);
}