* dwarf_macro_param2.c (dwarf_macro_param2): Change form condition to
switch statement and add DW_FORM_line_strp, DW_FORM_strp_sup,
DW_FORM_strx, and DW_FORM_strx[1-4].
+ * dwarf_getmacros.c (get_macinfo_table): Replace assignment of
+ table->is_64bit with assignments of table->address_size and
+ table->offset_size.
+ (get_table_for_offset): Ditto.
+ (read_macros): Get fake CU offset_size from table->offset_size instead
+ of table->is_64bit.
+ * dwarf_macro_getsrcfiles.c (dwarf_macro_getsrcfiles): Get
+ address_size for __libdw_getsrclines from table->address_size instead
+ of table->is_64bit.
+ * libdwP.h (Dwarf_Macro_Op_Table): Replace is_64bit with address_size
+ and offset_size.
2023-02-22 Mark Wielaard <mark@klomp.org>
table->offset = macoff;
table->sec_index = IDX_debug_macinfo;
table->line_offset = line_offset;
- table->is_64bit = cudie->cu->address_size == 8;
+ table->address_size = cudie->cu->address_size;
+ table->offset_size = cudie->cu->offset_size;
table->comp_dir = __libdw_getcompdir (cudie);
return table;
return NULL;
}
+ uint8_t address_size;
+ if (cudie != NULL)
+ address_size = cudie->cu->address_size;
+ else
+ {
+ char *ident = elf_getident (dbg->elf, NULL);
+ address_size = ident[EI_CLASS] == ELFCLASS32 ? 4 : 8;
+ }
+
/* """The macinfo entry types defined in this standard may, but
might not, be described in the table""".
.line_offset = line_offset,
.header_len = readp - startp,
.version = version,
- .is_64bit = is_64bit,
+ .address_size = address_size,
+ .offset_size = is_64bit ? 8 : 4,
/* NULL if CUDIE is NULL or DW_AT_comp_dir is absent. */
.comp_dir = __libdw_getcompdir (cudie),
.dbg = dbg,
.sec_idx = sec_index,
.version = table->version,
- .offset_size = table->is_64bit ? 8 : 4,
+ .offset_size = table->offset_size,
.str_off_base = str_offsets_base_off (dbg, (cudie != NULL
? cudie->cu: NULL)),
.startp = (void *) startp + offset,
will be broken. */
if (__libdw_getsrclines (dbg, line_offset, table->comp_dir,
- table->is_64bit ? 8 : 4,
- NULL, &table->files) < 0)
+ table->address_size, NULL, &table->files) < 0)
table->files = (void *) -1;
}