* thread-db.c (check_event): Don't report an error if we encounter
[deliverable/binutils-gdb.git] / gdb / m68knbsd-nat.c
CommitLineData
c906108c 1/* Native-dependent code for Motorola m68k's running NetBSD, for GDB.
b6ba6518
KB
2 Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001
3 Free Software Foundation, Inc.
c906108c 4
c5aa993b 5 This file is part of GDB.
c906108c 6
c5aa993b
JM
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
c906108c 11
c5aa993b
JM
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
c906108c 16
c5aa993b
JM
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
c906108c 21
6259c7e2 22#include "defs.h"
c906108c
SS
23#include <sys/types.h>
24#include <sys/ptrace.h>
25#include <machine/reg.h>
26#include <machine/frame.h>
c906108c 27#include "inferior.h"
6259c7e2 28#include "gdbcore.h"
4e052eda 29#include "regcache.h"
c906108c
SS
30
31void
fba45db2 32fetch_inferior_registers (int regno)
c906108c
SS
33{
34 struct reg inferior_registers;
35 struct fpreg inferior_fp_registers;
36
c5aa993b
JM
37 ptrace (PT_GETREGS, inferior_pid,
38 (PTRACE_ARG3_TYPE) & inferior_registers, 0);
39 memcpy (&registers[REGISTER_BYTE (0)], &inferior_registers,
40 sizeof (inferior_registers));
c906108c 41
c5aa993b
JM
42 ptrace (PT_GETFPREGS, inferior_pid,
43 (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
44 memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
45 sizeof (inferior_fp_registers));
c906108c
SS
46
47 registers_fetched ();
48}
49
50void
fba45db2 51store_inferior_registers (int regno)
c906108c
SS
52{
53 struct reg inferior_registers;
54 struct fpreg inferior_fp_registers;
55
56 memcpy (&inferior_registers, &registers[REGISTER_BYTE (0)],
c5aa993b
JM
57 sizeof (inferior_registers));
58 ptrace (PT_SETREGS, inferior_pid,
59 (PTRACE_ARG3_TYPE) & inferior_registers, 0);
c906108c
SS
60
61 memcpy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
c5aa993b
JM
62 sizeof (inferior_fp_registers));
63 ptrace (PT_SETFPREGS, inferior_pid,
64 (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
c906108c
SS
65}
66
c5aa993b
JM
67struct md_core
68{
69 struct reg intreg;
c906108c
SS
70 struct fpreg freg;
71};
72
eafd4536 73static void
fba45db2
KB
74fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
75 CORE_ADDR ignore)
c906108c 76{
c5aa993b
JM
77 struct md_core *core_reg = (struct md_core *) core_reg_sect;
78
c906108c 79 /* Integer registers */
c5aa993b
JM
80 memcpy (&registers[REGISTER_BYTE (0)],
81 &core_reg->intreg, sizeof (struct reg));
c906108c 82 /* Floating point registers */
c5aa993b
JM
83 memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
84 &core_reg->freg, sizeof (struct fpreg));
c906108c 85}
eafd4536
C
86
87/* Register that we are able to handle m68knbsd core file formats.
88 FIXME: is this really bfd_target_unknown_flavour? */
89
90static struct core_fns m68knbsd_core_fns =
91{
92 bfd_target_unknown_flavour, /* core_flavour */
93 default_check_format, /* check_format */
94 default_core_sniffer, /* core_sniffer */
95 fetch_core_registers, /* core_read_registers */
96 NULL /* next */
97};
98
99void
fba45db2 100_initialize_m68knbsd_nat (void)
eafd4536
C
101{
102 add_core_fns (&m68knbsd_core_fns);
103}
This page took 0.095364 seconds and 4 git commands to generate.