From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 776F8385E019; Thu, 7 Apr 2022 15:09:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 776F8385E019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: update comments throughout reggroups.{c,h} files X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: af7ce09b7685050d2ca1a8a746bb8a8c080fff69 X-Git-Newrev: 524ad5e30fb66ee2f03547b2d9f5c67bccdc8534 Message-Id: <20220407150902.776F8385E019@sourceware.org> Date: Thu, 7 Apr 2022 15:09:02 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2022 15:09:02 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D524ad5e30fb6= 6ee2f03547b2d9f5c67bccdc8534 commit 524ad5e30fb66ee2f03547b2d9f5c67bccdc8534 Author: Andrew Burgess Date: Thu Mar 31 18:19:23 2022 +0100 gdb: update comments throughout reggroups.{c,h} files =20 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. =20 No user visible changes after this commit. Diff: --- gdb/reggroups.c | 11 +++++++++-- gdb/reggroups.h | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/gdb/reggroups.c b/gdb/reggroups.c index 42232811087..1a13cb2fba0 100644 --- a/gdb/reggroups.c +++ b/gdb/reggroups.c @@ -28,6 +28,8 @@ #include "gdbcmd.h" /* For maintenanceprintlist. */ #include "gdbsupport/gdb_obstack.h" =20 +/* See reggroups.h. */ + const reggroup * reggroup_new (const char *name, enum reggroup_type type) { @@ -82,9 +84,11 @@ private: std::vector m_groups; }; =20 +/* Key used to lookup register group data from a gdbarch. */ + static struct gdbarch_data *reggroups_data; =20 -/* Add GROUP to the list of register groups for GDBARCH. */ +/* See reggroups.h. */ =20 void reggroup_add (struct gdbarch *gdbarch, const reggroup *group) @@ -128,7 +132,8 @@ gdbarch_reggroups (struct gdbarch *gdbarch) return groups->groups (); } =20 -/* 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) } } =20 +/* Implement 'maintenance print reggroups' command. */ + static void maintenance_print_reggroups (const char *args, int from_tty) { diff --git a/gdb/reggroups.h b/gdb/reggroups.h index 5f8a8a395b3..a2b4cc5713e 100644 --- a/gdb/reggroups.h +++ b/gdb/reggroups.h @@ -24,7 +24,17 @@ =20 struct gdbarch; =20 -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 +}; =20 /* Individual register group. */ =20 @@ -73,7 +83,7 @@ extern const reggroup *reggroup_gdbarch_new (struct gdbar= ch *gdbarch, const char *name, enum reggroup_type type); =20 -/* 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); =20 /* Return the list of all register groups for GDBARCH. */