xref: /dragonfly/contrib/gdb-7/gdb/gregset.h (revision ef5ccd6c)
1*ef5ccd6cSJohn Marino /* Interface for functions using gregset and fpregset types.
2*ef5ccd6cSJohn Marino    Copyright (C) 2000-2013 Free Software Foundation, Inc.
3*ef5ccd6cSJohn Marino 
4*ef5ccd6cSJohn Marino    This file is part of GDB.
5*ef5ccd6cSJohn Marino 
6*ef5ccd6cSJohn Marino    This program is free software; you can redistribute it and/or modify
7*ef5ccd6cSJohn Marino    it under the terms of the GNU General Public License as published by
8*ef5ccd6cSJohn Marino    the Free Software Foundation; either version 3 of the License, or
9*ef5ccd6cSJohn Marino    (at your option) any later version.
10*ef5ccd6cSJohn Marino 
11*ef5ccd6cSJohn Marino    This program is distributed in the hope that it will be useful,
12*ef5ccd6cSJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*ef5ccd6cSJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*ef5ccd6cSJohn Marino    GNU General Public License for more details.
15*ef5ccd6cSJohn Marino 
16*ef5ccd6cSJohn Marino    You should have received a copy of the GNU General Public License
17*ef5ccd6cSJohn Marino    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
18*ef5ccd6cSJohn Marino 
19*ef5ccd6cSJohn Marino #ifndef GREGSET_H
20*ef5ccd6cSJohn Marino #define GREGSET_H
21*ef5ccd6cSJohn Marino 
22*ef5ccd6cSJohn Marino #ifdef HAVE_SYS_PROCFS_H
23*ef5ccd6cSJohn Marino #include <sys/procfs.h>
24*ef5ccd6cSJohn Marino #endif
25*ef5ccd6cSJohn Marino 
26*ef5ccd6cSJohn Marino #ifndef GDB_GREGSET_T
27*ef5ccd6cSJohn Marino #define GDB_GREGSET_T gregset_t
28*ef5ccd6cSJohn Marino #endif
29*ef5ccd6cSJohn Marino 
30*ef5ccd6cSJohn Marino #ifndef GDB_FPREGSET_T
31*ef5ccd6cSJohn Marino #define GDB_FPREGSET_T fpregset_t
32*ef5ccd6cSJohn Marino #endif
33*ef5ccd6cSJohn Marino 
34*ef5ccd6cSJohn Marino typedef GDB_GREGSET_T gdb_gregset_t;
35*ef5ccd6cSJohn Marino typedef GDB_FPREGSET_T gdb_fpregset_t;
36*ef5ccd6cSJohn Marino 
37*ef5ccd6cSJohn Marino struct regcache;
38*ef5ccd6cSJohn Marino 
39*ef5ccd6cSJohn Marino /* A gregset is a data structure supplied by the native OS containing
40*ef5ccd6cSJohn Marino    the general register values of the debugged process.  Usually this
41*ef5ccd6cSJohn Marino    includes integer registers and control registers.  An fpregset is a
42*ef5ccd6cSJohn Marino    data structure containing the floating point registers.  These data
43*ef5ccd6cSJohn Marino    structures were originally a part of the /proc interface, but have
44*ef5ccd6cSJohn Marino    been borrowed or copied by other GDB targets, eg. GNU/Linux.  */
45*ef5ccd6cSJohn Marino 
46*ef5ccd6cSJohn Marino /* Copy register values from the native target gregset/fpregset
47*ef5ccd6cSJohn Marino    into GDB's internal register cache.  */
48*ef5ccd6cSJohn Marino 
49*ef5ccd6cSJohn Marino extern void supply_gregset (struct regcache *regcache,
50*ef5ccd6cSJohn Marino 			    const gdb_gregset_t *gregs);
51*ef5ccd6cSJohn Marino extern void supply_fpregset (struct regcache *regcache,
52*ef5ccd6cSJohn Marino 			     const gdb_fpregset_t *fpregs);
53*ef5ccd6cSJohn Marino 
54*ef5ccd6cSJohn Marino /* Copy register values from GDB's register cache into
55*ef5ccd6cSJohn Marino    the native target gregset/fpregset.  If regno is -1,
56*ef5ccd6cSJohn Marino    copy all the registers.  */
57*ef5ccd6cSJohn Marino 
58*ef5ccd6cSJohn Marino extern void fill_gregset (const struct regcache *regcache,
59*ef5ccd6cSJohn Marino 			  gdb_gregset_t *gregs, int regno);
60*ef5ccd6cSJohn Marino extern void fill_fpregset (const struct regcache *regcache,
61*ef5ccd6cSJohn Marino 			   gdb_fpregset_t *fpregs, int regno);
62*ef5ccd6cSJohn Marino 
63*ef5ccd6cSJohn Marino #endif
64