#include "gdbcmd.h" /* For maintenanceprintlist. */
#include "gdbsupport/gdb_obstack.h"
-/* Individual register groups. */
-
-struct reggroup
-{
- /* Create a new register group object. The NAME is not owned by the new
- reggroup object, so must outlive the object. */
- reggroup (const char *name, enum reggroup_type type)
- : m_name (name),
- m_type (type)
- { /* Nothing. */ }
-
- /* Return the name for this register group. */
- const char *name () const
- { return m_name; }
-
- /* Return the type of this register group. */
- enum reggroup_type type () const
- { return m_type; }
-
-private:
- /* The name of this register group. */
- const char *m_name;
-
- /* The type of this register group. */
- enum reggroup_type m_type;
-};
+/* See reggroups.h. */
const reggroup *
reggroup_new (const char *name, enum reggroup_type type)
name, type);
}
-/* Register group attributes. */
-
-const char *
-reggroup_name (const struct reggroup *group)
-{
- return group->name ();
-}
-
-enum reggroup_type
-reggroup_type (const struct reggroup *group)
-{
- return group->type ();
-}
-
/* A container holding all the register groups for a particular
architecture. */
std::vector<const struct reggroup *> m_groups;
};
+/* Key used to lookup register group data from a gdbarch. */
+
static struct gdbarch_data *reggroups_data;
-/* Add GROUP to the list of register groups for GDBARCH. */
+/* See reggroups.h. */
void
reggroup_add (struct gdbarch *gdbarch, const reggroup *group)
return groups->groups ();
}
-/* Is REGNUM a member of REGGROUP? */
+/* See reggroups.h. */
+
int
default_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
const struct reggroup *group)
}
}
+/* Implement 'maintenance print reggroups' command. */
+
static void
maintenance_print_reggroups (const char *args, int from_tty)
{