mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-29 18:41:27 +00:00
Address class support.
This commit is contained in:
120
gdb/gdbarch.c
120
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. */
|
||||
|
||||
Reference in New Issue
Block a user