diff options
author | Kevin Buettner <kevinb@redhat.com> | 2002-10-16 20:50:22 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2002-10-16 20:50:22 +0000 |
commit | 8b2dbe47f314187de7089f4ffeb26c100b7d4c3e (patch) | |
tree | 4ae93bb796e2490ab65c78f9e832910c822334cd /gdb/gdbarch.c | |
parent | f52d1d64053435bf10413c8722f8c547fcdd08ef (diff) | |
download | gdb-8b2dbe47f314187de7089f4ffeb26c100b7d4c3e.zip gdb-8b2dbe47f314187de7089f4ffeb26c100b7d4c3e.tar.gz gdb-8b2dbe47f314187de7089f4ffeb26c100b7d4c3e.tar.bz2 |
Address class support.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index fe40062..ce837e9 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -271,6 +271,9 @@ struct gdbarch const char * name_of_malloc; int cannot_step_breakpoint; int have_nonsteppable_watchpoint; + 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; }; @@ -431,6 +434,9 @@ struct gdbarch startup_gdbarch = "malloc", 0, 0, + 0, + 0, + 0, /* startup_gdbarch() */ }; @@ -810,6 +816,9 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of name_of_malloc, invalid_p == 0 */ /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */ /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */ + /* 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 */ buf = ui_file_xstrdup (log, &dummy); make_cleanup (xfree, buf); if (strlen (buf) > 0) @@ -850,6 +859,39 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: pseudo_register_write = 0x%08lx\n", (long) current_gdbarch->pseudo_register_write); +#ifdef ADDRESS_CLASS_NAME_TO_TYPE_FLAGS + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "ADDRESS_CLASS_NAME_TO_TYPE_FLAGS(name, type_flags_ptr)", + XSTRING (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS (name, type_flags_ptr))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: ADDRESS_CLASS_NAME_TO_TYPE_FLAGS = 0x%08lx\n", + (long) current_gdbarch->address_class_name_to_type_flags + /*ADDRESS_CLASS_NAME_TO_TYPE_FLAGS ()*/); +#endif +#ifdef ADDRESS_CLASS_TYPE_FLAGS + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)", + XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS = 0x%08lx\n", + (long) current_gdbarch->address_class_type_flags + /*ADDRESS_CLASS_TYPE_FLAGS ()*/); +#endif +#ifdef ADDRESS_CLASS_TYPE_FLAGS_TO_NAME + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "ADDRESS_CLASS_TYPE_FLAGS_TO_NAME(type_flags)", + XSTRING (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME (type_flags))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS_TO_NAME = 0x%08lx\n", + (long) current_gdbarch->address_class_type_flags_to_name + /*ADDRESS_CLASS_TYPE_FLAGS_TO_NAME ()*/); +#endif #ifdef ADDRESS_TO_POINTER #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -5080,6 +5122,84 @@ set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint; } +int +gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->address_class_type_flags != 0; +} + +int +gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->address_class_type_flags == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_address_class_type_flags invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n"); + return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class); +} + +void +set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, + gdbarch_address_class_type_flags_ftype address_class_type_flags) +{ + gdbarch->address_class_type_flags = address_class_type_flags; +} + +int +gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->address_class_type_flags_to_name != 0; +} + +char * +gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->address_class_type_flags_to_name == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_address_class_type_flags_to_name invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n"); + return gdbarch->address_class_type_flags_to_name (type_flags); +} + +void +set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, + gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name) +{ + gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name; +} + +int +gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->address_class_name_to_type_flags != 0; +} + +int +gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, char *name, int *type_flags_ptr) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->address_class_name_to_type_flags == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_address_class_name_to_type_flags invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n"); + return gdbarch->address_class_name_to_type_flags (name, type_flags_ptr); +} + +void +set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, + gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags) +{ + gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags; +} + /* Keep a registry of per-architecture data-pointers required by GDB modules. */ |