Revert "MIPS: Use N64 by default for mips*64*-*-linux-gnuabi64"
[binutils-gdb.git] / gdb / reggroups.h
blob1be1f0ad613dc37e189d282f0b45996e0e2707d9
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/>. */
22 #ifndef REGGROUPS_H
23 #define REGGROUPS_H
25 struct gdbarch;
27 /* The different register group types. */
28 enum reggroup_type {
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. */
32 USER_REGGROUP,
34 /* Used for a few groups that GDB uses while managing machine state.
35 These groups are mostly hidden from the user. */
36 INTERNAL_REGGROUP
39 /* Individual register group. */
41 struct reggroup
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. */ }
50 /* Return the name for this register group. */
51 const char *name () const
52 { return m_name; }
54 /* Return the type of this register group. */
55 enum reggroup_type type () const
56 { return m_type; }
58 private:
59 /* The name of this register group. */
60 const char *m_name;
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,
83 const char *name,
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,
95 const char *name);
97 /* Is REGNUM a member of REGGROUP? */
98 extern int default_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
99 const struct reggroup *reggroup);
101 #endif