gdb: update comments throughout reggroups.{c,h} files

This commit updates the comments in the gdb/reggroups.{c,h} files.
Fill in some missing comments, correct a few comments that were not
clear, and where we had comments duplicated between .c and .h files,
update the .c to reference the .h.

No user visible changes after this commit.
This commit is contained in:
Andrew Burgess 2022-03-31 18:19:23 +01:00
parent af7ce09b76
commit 524ad5e30f
2 changed files with 21 additions and 4 deletions

View File

@ -28,6 +28,8 @@
#include "gdbcmd.h" /* For maintenanceprintlist. */
#include "gdbsupport/gdb_obstack.h"
/* See reggroups.h. */
const reggroup *
reggroup_new (const char *name, enum reggroup_type type)
{
@ -82,9 +84,11 @@ private:
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)
@ -128,7 +132,8 @@ gdbarch_reggroups (struct gdbarch *gdbarch)
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)
@ -207,6 +212,8 @@ reggroups_dump (struct gdbarch *gdbarch, struct ui_file *file)
}
}
/* Implement 'maintenance print reggroups' command. */
static void
maintenance_print_reggroups (const char *args, int from_tty)
{

View File

@ -24,7 +24,17 @@
struct gdbarch;
enum reggroup_type { USER_REGGROUP, INTERNAL_REGGROUP };
/* The different register group types. */
enum reggroup_type {
/* Used for any register group that should be visible to the user.
Architecture specific register groups, as well as most of the default
groups will have this type. */
USER_REGGROUP,
/* Used for a few groups that GDB uses while managing machine state.
These groups are mostly hidden from the user. */
INTERNAL_REGGROUP
};
/* Individual register group. */
@ -73,7 +83,7 @@ extern const reggroup *reggroup_gdbarch_new (struct gdbarch *gdbarch,
const char *name,
enum reggroup_type type);
/* Add a register group (with attribute values) to the pre-defined list. */
/* Add register group GROUP to the list of register groups for GDBARCH. */
extern void reggroup_add (struct gdbarch *gdbarch, const reggroup *group);
/* Return the list of all register groups for GDBARCH. */