diff options
Diffstat (limited to 'gdb/reggroups.c')
-rw-r--r-- | gdb/reggroups.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/gdb/reggroups.c b/gdb/reggroups.c index 744e7bd..2944337 100644 --- a/gdb/reggroups.c +++ b/gdb/reggroups.c @@ -25,7 +25,7 @@ #include "gdbtypes.h" #include "regcache.h" #include "command.h" -#include "gdbcmd.h" /* For maintenanceprintlist. */ +#include "gdbcmd.h" /* For maintenanceprintlist. */ #include "gdbsupport/gdb_obstack.h" /* See reggroups.h. */ @@ -43,8 +43,7 @@ reggroup_gdbarch_new (struct gdbarch *gdbarch, const char *name, enum reggroup_type type) { name = gdbarch_obstack_strdup (gdbarch, name); - return obstack_new<struct reggroup> (gdbarch_obstack (gdbarch), - name, type); + return obstack_new<struct reggroup> (gdbarch_obstack (gdbarch), name, type); } /* A container holding all the register groups for a particular @@ -72,10 +71,9 @@ struct reggroups { gdb_assert (group != nullptr); - auto find_by_name = [group] (const reggroup *g) - { - return streq (group->name (), g->name ()); - }; + auto find_by_name = [group] (const reggroup *g) { + return streq (group->name (), g->name ()); + }; gdb_assert (std::find_if (m_groups.begin (), m_groups.end (), find_by_name) == m_groups.end ()); @@ -84,21 +82,20 @@ struct reggroups /* The number of register groups. */ - std::vector<struct reggroup *>::size_type - size () const + std::vector<struct reggroup *>::size_type size () const { return m_groups.size (); } /* Return a reference to the list of all groups. */ - const std::vector<const struct reggroup *> & - groups () const + const std::vector<const struct reggroup *> &groups () const { return m_groups; } private: + /* The register groups. */ std::vector<const struct reggroup *> m_groups; }; @@ -156,9 +153,9 @@ default_register_reggroup_p (struct gdbarch *gdbarch, int regnum, if (group == all_reggroup) return 1; vector_p = register_type (gdbarch, regnum)->is_vector (); - float_p = (register_type (gdbarch, regnum)->code () == TYPE_CODE_FLT - || (register_type (gdbarch, regnum)->code () - == TYPE_CODE_DECFLOAT)); + float_p + = (register_type (gdbarch, regnum)->code () == TYPE_CODE_FLT + || (register_type (gdbarch, regnum)->code () == TYPE_CODE_DECFLOAT)); raw_p = regnum < gdbarch_num_regs (gdbarch); if (group == float_reggroup) return float_p; @@ -210,7 +207,7 @@ reggroups_dump (struct gdbarch *gdbarch, struct ui_file *file) type = "internal"; break; default: - internal_error (_("bad switch")); + internal_error (_ ("bad switch")); } /* Note: If you change this, be sure to also update the @@ -234,7 +231,7 @@ maintenance_print_reggroups (const char *args, int from_tty) stdio_file file; if (!file.open (args, "w")) - perror_with_name (_("maintenance print reggroups")); + perror_with_name (_ ("maintenance print reggroups")); reggroups_dump (gdbarch, &file); } } @@ -257,13 +254,12 @@ const reggroup *const save_reggroup = &save_group; const reggroup *const restore_reggroup = &restore_group; void _initialize_reggroup (); + void _initialize_reggroup () { - add_cmd ("reggroups", class_maintenance, - maintenance_print_reggroups, _("\ + add_cmd ("reggroups", class_maintenance, maintenance_print_reggroups, _ ("\ Print the internal register group names.\n\ Takes an optional file parameter."), &maintenanceprintlist); - } |