gdb/
[deliverable/binutils-gdb.git] / gdb / regset.h
CommitLineData
54c84734
MK
1/* Manage register sets.
2
4c38e0a4
JB
3 Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010
4 Free Software Foundation, Inc.
54c84734
MK
5
6 This file is part of GDB.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
a9762ec7 10 the Free Software Foundation; either version 3 of the License, or
54c84734
MK
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
a9762ec7 19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
54c84734
MK
20
21#ifndef REGSET_H
22#define REGSET_H 1
23
24struct gdbarch;
25struct regcache;
26
17ea7499
CES
27/* Data structure for the supported register notes in a core file. */
28struct core_regset_section
29{
30 const char *sect_name;
31 int size;
1b1818e4 32 const char *human_name;
17ea7499
CES
33};
34
54c84734 35/* Data structure describing a register set. */
9ea75c57 36
be07a590
JB
37typedef void (supply_regset_ftype) (const struct regset *, struct regcache *,
38 int, const void *, size_t);
39typedef void (collect_regset_ftype) (const struct regset *,
40 const struct regcache *,
2c34abbe 41 int, void *, size_t);
54c84734
MK
42
43struct regset
44{
45 /* Data pointer for private use by the methods below, presumably
46 providing some sort of description of the register set. */
368702b1 47 const void *descr;
54c84734 48
be07a590
JB
49 /* Function supplying values in a register set to a register cache. */
50 supply_regset_ftype *supply_regset;
51
52 /* Function collecting values in a register set from a register cache. */
53 collect_regset_ftype *collect_regset;
368702b1
MK
54
55 /* Architecture associated with the register set. */
56 struct gdbarch *arch;
54c84734
MK
57};
58
9ea75c57
MK
59/* Allocate a fresh 'struct regset' whose supply_regset function is
60 SUPPLY_REGSET, and whose collect_regset function is COLLECT_REGSET.
61 If the regset has no collect_regset function, pass NULL for
62 COLLECT_REGSET.
be07a590 63
617a4cba 64 The object returned is allocated on ARCH's obstack. */
9ea75c57 65
617a4cba 66extern struct regset *regset_alloc (struct gdbarch *arch,
617a4cba
JB
67 supply_regset_ftype *supply_regset,
68 collect_regset_ftype *collect_regset);
be07a590 69
54c84734 70#endif /* regset.h */
This page took 0.672599 seconds and 4 git commands to generate.