diff options
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 103abcb..4ff9f54 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -155,6 +155,7 @@ struct gdbarch const struct floatformat ** long_double_format; int ptr_bit; int addr_bit; + int dwarf2_addr_size; int char_signed; gdbarch_read_pc_ftype *read_pc; gdbarch_write_pc_ftype *write_pc; @@ -305,6 +306,7 @@ struct gdbarch startup_gdbarch = 0, /* long_double_format */ 8 * sizeof (void*), /* ptr_bit */ 8 * sizeof (void*), /* addr_bit */ + sizeof (void*), /* dwarf2_addr_size */ 1, /* char_signed */ 0, /* read_pc */ 0, /* write_pc */ @@ -582,6 +584,8 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of ptr_bit, invalid_p == 0 */ if (gdbarch->addr_bit == 0) gdbarch->addr_bit = gdbarch_ptr_bit (gdbarch); + if (gdbarch->dwarf2_addr_size == 0) + gdbarch->dwarf2_addr_size = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT; if (gdbarch->char_signed == -1) gdbarch->char_signed = 1; /* Skip verify of read_pc, has predicate */ @@ -868,6 +872,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: dummy_id = <%s>\n", host_address_to_string (gdbarch->dummy_id)); fprintf_unfiltered (file, + "gdbarch_dump: dwarf2_addr_size = %s\n", + plongest (gdbarch->dwarf2_addr_size)); + fprintf_unfiltered (file, "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n", host_address_to_string (gdbarch->dwarf2_reg_to_regnum)); fprintf_unfiltered (file, @@ -1556,6 +1563,24 @@ set_gdbarch_addr_bit (struct gdbarch *gdbarch, } int +gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + /* Check variable changed from pre-default. */ + gdb_assert (gdbarch->dwarf2_addr_size != 0); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_addr_size called\n"); + return gdbarch->dwarf2_addr_size; +} + +void +set_gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch, + int dwarf2_addr_size) +{ + gdbarch->dwarf2_addr_size = dwarf2_addr_size; +} + +int gdbarch_char_signed (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); |