GDB (xrefs)
Loading...
Searching...
No Matches
reggroups.h
Go to the documentation of this file.
1/* Register groupings for GDB, the GNU debugger.
2
3 Copyright (C) 2002-2023 Free Software Foundation, Inc.
4
5 Contributed by Red Hat.
6
7 This file is part of GDB.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21
22#ifndef REGGROUPS_H
23#define REGGROUPS_H
24
25struct gdbarch;
26
27/* The different register group types. */
29 /* Used for any register group that should be visible to the user.
30 Architecture specific register groups, as well as most of the default
31 groups will have this type. */
33
34 /* Used for a few groups that GDB uses while managing machine state.
35 These groups are mostly hidden from the user. */
37};
38
39/* Individual register group. */
40
42{
43 /* Create a new register group object. The NAME is not owned by the new
44 reggroup object, so must outlive the object. */
45 reggroup (const char *name, enum reggroup_type type)
46 : m_name (name),
47 m_type (type)
48 { /* Nothing. */ }
49
50 /* Return the name for this register group. */
51 const char *name () const
52 { return m_name; }
53
54 /* Return the type of this register group. */
55 enum reggroup_type type () const
56 { return m_type; }
57
58private:
59 /* The name of this register group. */
60 const char *m_name;
61
62 /* The type of this register group. */
64};
65
66/* Pre-defined, user visible, register groups. */
67extern const reggroup *const general_reggroup;
68extern const reggroup *const float_reggroup;
69extern const reggroup *const system_reggroup;
70extern const reggroup *const vector_reggroup;
71extern const reggroup *const all_reggroup;
72
73/* Pre-defined, internal, register groups. */
74extern const reggroup *const save_reggroup;
75extern const reggroup *const restore_reggroup;
76
77/* Create a new local register group. */
78extern const reggroup *reggroup_new (const char *name,
79 enum reggroup_type type);
80
81/* Create a new register group allocated onto the gdbarch obstack. */
82extern const reggroup *reggroup_gdbarch_new (struct gdbarch *gdbarch,
83 const char *name,
84 enum reggroup_type type);
85
86/* Add register group GROUP to the list of register groups for GDBARCH. */
87extern void reggroup_add (struct gdbarch *gdbarch, const reggroup *group);
88
89/* Return the list of all register groups for GDBARCH. */
90extern const std::vector<const reggroup *> &
92
93/* Find a reggroup by name. */
94extern const reggroup *reggroup_find (struct gdbarch *gdbarch,
95 const char *name);
96
97/* Is REGNUM a member of REGGROUP? */
98extern int default_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
99 const struct reggroup *reggroup);
100
101#endif
int regnum
const char *const name
const reggroup *const general_reggroup
Definition reggroups.c:251
const reggroup * reggroup_new(const char *name, enum reggroup_type type)
Definition reggroups.c:34
const reggroup *const system_reggroup
Definition reggroups.c:253
const reggroup * reggroup_find(struct gdbarch *gdbarch, const char *name)
Definition reggroups.c:177
int default_register_reggroup_p(struct gdbarch *gdbarch, int regnum, const struct reggroup *reggroup)
Definition reggroups.c:147
const reggroup *const float_reggroup
Definition reggroups.c:252
const reggroup *const save_reggroup
Definition reggroups.c:256
const reggroup *const all_reggroup
Definition reggroups.c:255
reggroup_type
Definition reggroups.h:28
@ INTERNAL_REGGROUP
Definition reggroups.h:36
@ USER_REGGROUP
Definition reggroups.h:32
void reggroup_add(struct gdbarch *gdbarch, const reggroup *group)
Definition reggroups.c:124
const std::vector< const reggroup * > & gdbarch_reggroups(struct gdbarch *gdbarch)
Definition reggroups.c:136
const reggroup *const restore_reggroup
Definition reggroups.c:257
const reggroup * reggroup_gdbarch_new(struct gdbarch *gdbarch, const char *name, enum reggroup_type type)
Definition reggroups.c:42
const reggroup *const vector_reggroup
Definition reggroups.c:254
enum reggroup_type m_type
Definition reggroups.h:63
const char * m_name
Definition reggroups.h:60
reggroup(const char *name, enum reggroup_type type)
Definition reggroups.h:45
const char * name() const
Definition reggroups.h:51
enum reggroup_type type() const
Definition reggroups.h:55