1 /* Register groupings for GDB, the GNU debugger.
3 Copyright (C) 2002-2024 Free Software Foundation, Inc.
5 Contributed by Red Hat.
7 This file is part of GDB.
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.
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.
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/>. */
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. */
34 /* Used for a few groups that GDB uses while managing machine state.
35 These groups are mostly hidden from the user. */
39 /* Individual register group. */
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
)
50 /* Return the name for this register group. */
51 const char *name () const
54 /* Return the type of this register group. */
55 enum reggroup_type
type () const
59 /* The name of this register group. */
62 /* The type of this register group. */
63 enum reggroup_type m_type
;
66 /* Pre-defined, user visible, register groups. */
67 extern const reggroup
*const general_reggroup
;
68 extern const reggroup
*const float_reggroup
;
69 extern const reggroup
*const system_reggroup
;
70 extern const reggroup
*const vector_reggroup
;
71 extern const reggroup
*const all_reggroup
;
73 /* Pre-defined, internal, register groups. */
74 extern const reggroup
*const save_reggroup
;
75 extern const reggroup
*const restore_reggroup
;
77 /* Create a new local register group. */
78 extern const reggroup
*reggroup_new (const char *name
,
79 enum reggroup_type type
);
81 /* Create a new register group allocated onto the gdbarch obstack. */
82 extern const reggroup
*reggroup_gdbarch_new (struct gdbarch
*gdbarch
,
84 enum reggroup_type type
);
86 /* Add register group GROUP to the list of register groups for GDBARCH. */
87 extern void reggroup_add (struct gdbarch
*gdbarch
, const reggroup
*group
);
89 /* Return the list of all register groups for GDBARCH. */
90 extern const std::vector
<const reggroup
*> &
91 gdbarch_reggroups (struct gdbarch
*gdbarch
);
93 /* Find a reggroup by name. */
94 extern const reggroup
*reggroup_find (struct gdbarch
*gdbarch
,
97 /* Is REGNUM a member of REGGROUP? */
98 extern int default_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
,
99 const struct reggroup
*reggroup
);