aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-11-02 15:13:34 +0000
committerAndrew Cagney <cagney@redhat.com>2002-11-02 15:13:34 +0000
commitb59ff9d5ff023638dba11477c822313178d14e4d (patch)
treebc1422c9058681ce2e70b5f9d8777c45332c21ea /gdb/gdbarch.c
parent4caf0990c1ff56195c12538598d1a2c2623328c4 (diff)
downloadgdb-b59ff9d5ff023638dba11477c822313178d14e4d.zip
gdb-b59ff9d5ff023638dba11477c822313178d14e4d.tar.gz
gdb-b59ff9d5ff023638dba11477c822313178d14e4d.tar.bz2
2002-11-02 Andrew Cagney <cagney@redhat.com>
* reggroups.h, reggroups.c: New files. * regcache.c: Include "reggroups.h". (enum regcache_dump_what): Add `regcache_dump_groups'. (regcache_dump): Contract size of the "Type" column. When specified, dump the register's groups. (maintenance_print_register_groups): New function. (_initialize_regcache): Add command `maint print register-groups'. * Makefile.in (COMMON_OBS): Add reggroups.o (SFILES): Add reggroups.c. (reggroups_h): Define. (regcache.o, gdbarch.o): Update dependencies. (reggroups.o): Specify dependencies. * gdbarch.sh (register_reggroup_p): Add pure multi-arch method. Add opaque declaration for `struct reggroup' in generated .h file. Include "reggroups.h" in generated .c file. gdbarch.h, gdbarch.c: Re-generate.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index b34e565..0e438f3 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -64,6 +64,7 @@
#include "gdb_assert.h"
#include "gdb_string.h"
#include "gdb-events.h"
+#include "reggroups.h"
/* Static function declarations */
@@ -274,6 +275,7 @@ struct gdbarch
gdbarch_address_class_type_flags_ftype *address_class_type_flags;
gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
+ gdbarch_register_reggroup_p_ftype *register_reggroup_p;
};
@@ -437,6 +439,7 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
+ default_register_reggroup_p,
/* startup_gdbarch() */
};
@@ -568,6 +571,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
current_gdbarch->name_of_malloc = "malloc";
+ current_gdbarch->register_reggroup_p = default_register_reggroup_p;
/* gdbarch_alloc() */
return current_gdbarch;
@@ -819,6 +823,9 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of address_class_type_flags, has predicate */
/* Skip verify of address_class_type_flags_to_name, has predicate */
/* Skip verify of address_class_name_to_type_flags, has predicate */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->register_reggroup_p == default_register_reggroup_p))
+ fprintf_unfiltered (log, "\n\tregister_reggroup_p");
buf = ui_file_xstrdup (log, &dummy);
make_cleanup (xfree, buf);
if (strlen (buf) > 0)
@@ -853,6 +860,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->in_function_epilogue_p);
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
+ "gdbarch_dump: register_reggroup_p = 0x%08lx\n",
+ (long) current_gdbarch->register_reggroup_p);
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
"gdbarch_dump: pseudo_register_read = 0x%08lx\n",
(long) current_gdbarch->pseudo_register_read);
if (GDB_MULTI_ARCH)
@@ -5186,6 +5197,25 @@ set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
}
+int
+gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->register_reggroup_p == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_reggroup_p invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
+ return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
+}
+
+void
+set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
+ gdbarch_register_reggroup_p_ftype register_reggroup_p)
+{
+ gdbarch->register_reggroup_p = register_reggroup_p;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */