diff options
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 1359c2f..dd7c89d 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -353,6 +353,7 @@ struct gdbarch gdbarch_addressable_memory_unit_size_ftype *addressable_memory_unit_size; char ** disassembler_options; const disasm_options_t * valid_disassembler_options; + gdbarch_type_align_ftype *type_align; }; /* Create a new ``struct gdbarch'' based on information provided by @@ -465,6 +466,7 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->gcc_target_options = default_gcc_target_options; gdbarch->gnu_triplet_regexp = default_gnu_triplet_regexp; gdbarch->addressable_memory_unit_size = default_addressable_memory_unit_size; + gdbarch->type_align = default_type_align; /* gdbarch_alloc() */ return gdbarch; @@ -716,6 +718,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of addressable_memory_unit_size, invalid_p == 0 */ /* Skip verify of disassembler_options, invalid_p == 0 */ /* Skip verify of valid_disassembler_options, invalid_p == 0 */ + /* Skip verify of type_align, invalid_p == 0 */ if (!log.empty ()) internal_error (__FILE__, __LINE__, _("verify_gdbarch: the following are invalid ...%s"), @@ -1442,6 +1445,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: target_desc = %s\n", host_address_to_string (gdbarch->target_desc)); fprintf_unfiltered (file, + "gdbarch_dump: type_align = <%s>\n", + host_address_to_string (gdbarch->type_align)); + fprintf_unfiltered (file, "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n", gdbarch_unwind_pc_p (gdbarch)); fprintf_unfiltered (file, @@ -5100,6 +5106,23 @@ set_gdbarch_valid_disassembler_options (struct gdbarch *gdbarch, gdbarch->valid_disassembler_options = valid_disassembler_options; } +ULONGEST +gdbarch_type_align (struct gdbarch *gdbarch, struct type *type) +{ + gdb_assert (gdbarch != NULL); + gdb_assert (gdbarch->type_align != NULL); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_type_align called\n"); + return gdbarch->type_align (gdbarch, type); +} + +void +set_gdbarch_type_align (struct gdbarch *gdbarch, + gdbarch_type_align_ftype type_align) +{ + gdbarch->type_align = type_align; +} + /* Keep a registry of per-architecture data-pointers required by GDB modules. */ |