/* Native-dependent code for modern VAX BSD's.
- Copyright (C) 2004-2019 Free Software Foundation, Inc.
+ Copyright (C) 2004-2020 Free Software Foundation, Inc.
This file is part of GDB.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* We define this to get types like register_t. */
+#define _KERNTYPES
#include "defs.h"
#include "inferior.h"
#include "regcache.h"
#include "vax-tdep.h"
#include "inf-ptrace.h"
+#include "nbsd-nat.h"
-struct vax_bsd_nat_target final : public inf_ptrace_target
+struct vax_bsd_nat_target final : public nbsd_nat_target
{
void fetch_registers (struct regcache *, int) override;
void store_registers (struct regcache *, int) override;
static void
vaxbsd_supply_gregset (struct regcache *regcache, const void *gregs)
{
- const gdb_byte *regs = gregs;
+ const gdb_byte *regs = (const gdb_byte *)gregs;
int regnum;
for (regnum = 0; regnum < VAX_NUM_REGS; regnum++)
vaxbsd_collect_gregset (const struct regcache *regcache,
void *gregs, int regnum)
{
- gdb_byte *regs = gregs;
+ gdb_byte *regs = (void *)gregs;
int i;
for (i = 0; i <= VAX_NUM_REGS; i++)
{
struct reg regs;
pid_t pid = regcache->ptid ().pid ();
+ int lwp = regcache->ptid ().lwp ();
- if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, lwp) == -1)
perror_with_name (_("Couldn't get registers"));
vaxbsd_supply_gregset (regcache, ®s);
{
struct reg regs;
pid_t pid = regcache->ptid ().pid ();
+ int lwp = regcache->ptid ().lwp ();
- if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, lwp) == -1)
perror_with_name (_("Couldn't get registers"));
vaxbsd_collect_gregset (regcache, ®s, regnum);
- if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, lwp) == -1)
perror_with_name (_("Couldn't write registers"));
}
\f
return 1;
}
+void _initialize_vaxbsd_nat ();
void
-_initialize_vaxbsd_nat (void)
+_initialize_vaxbsd_nat ()
{
add_inf_child_target (&the_vax_bsd_nat_target);