forked from Imagelibrary/binutils-gdb
* dwarf2-frame.c (struct dwarf2_cie): Add ptr_size member.
Throughout, call read_encoded_value with ptr_size rather than addr_size. (decode_frame_entry_1): Remove redundant setting of addr_size. Call gdbarch_dwarf2_addr_size rather than gdbarch_ptr_bit to determine addr_size in Dwarf versions < 4. Set ptr_size dependent on examined frame section. Add comment to explain why. * gdbarch.sh (dwarf2_addr_size): Define as variable. Add lengthy comment to explain usage. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * xstormy16-tdep.c (xstormy16_gdbarch_init): Set dwarf2_addr_size to 4.
This commit is contained in:
@@ -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 */
|
||||
@@ -867,6 +871,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
|
||||
fprintf_unfiltered (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));
|
||||
@@ -1555,6 +1562,24 @@ set_gdbarch_addr_bit (struct gdbarch *gdbarch,
|
||||
gdbarch->addr_bit = addr_bit;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user