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.
+ table->offset_size. Assume default DW_AT_stmt_list of 0 for split
+ DWARF. Set table->dbg.
(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.
+ of table->is_64bit. Get dbg for __libdw_getsrclines from table->dbg
+ instead of dbg parameter, which is now unused.
* libdwP.h (Dwarf_Macro_Op_Table): Replace is_64bit with address_size
- and offset_size.
+ and offset_size. Add dbg.
2023-02-22 Mark Wielaard <mark@klomp.org>
= INTUSE(dwarf_attr) (cudie, DW_AT_stmt_list, &attr_mem);
Dwarf_Off line_offset = (Dwarf_Off) -1;
if (attr != NULL)
- if (unlikely (INTUSE(dwarf_formudata) (attr, &line_offset) != 0))
- return NULL;
+ {
+ if (unlikely (INTUSE(dwarf_formudata) (attr, &line_offset) != 0))
+ return NULL;
+ }
+ else if (cudie->cu->unit_type == DW_UT_split_compile
+ && dbg->sectiondata[IDX_debug_line] != NULL)
+ line_offset = 0;
Dwarf_Macro_Op_Table *table = libdw_alloc (dbg, Dwarf_Macro_Op_Table,
macinfo_data_size, 1);
memcpy (table, macinfo_data, macinfo_data_size);
+ table->dbg = dbg;
table->offset = macoff;
table->sec_index = IDX_debug_macinfo;
table->line_offset = line_offset;
macop_table_size, 1);
*table = (Dwarf_Macro_Op_Table) {
+ .dbg = dbg,
.offset = macoff,
.sec_index = IDX_debug_macro,
.line_offset = line_offset,
dwarf_macro_getsrcfiles (Dwarf *dbg, Dwarf_Macro *macro,
Dwarf_Files **files, size_t *nfiles)
{
+ /* This was needed before Dwarf_Macro_Op_Table stored the Dwarf handle. */
+ (void)dbg;
+
/* macro is declared NN */
Dwarf_Macro_Op_Table *const table = macro->table;
if (table->files == NULL)
the same unit through dwarf_getsrcfiles, and the file names
will be broken. */
- if (__libdw_getsrclines (dbg, line_offset, table->comp_dir,
+ if (__libdw_getsrclines (table->dbg, line_offset, table->comp_dir,
table->address_size, NULL, &table->files) < 0)
table->files = (void *) -1;
}
/* Prototype table. */
typedef struct
{
+ Dwarf *dbg;
+
/* Offset of .debug_macro section. */
Dwarf_Off offset;