Hi Omar, On Wed, Sep 27, 2023 at 11:20:54AM -0700, Omar Sandoval wrote: > Dwarf_Macro_Op_Table::is_64bit conflates the address size and the offset > size: for .debug_macinfo, it is initialized based on the compilation > unit's address size, but for .debug_macro, it is initialized based on > the macro unit's offset size. is_64bit is used to determine the address > size to pass to __libdw_getsrclines. For a 64-bit architecture using > DWARF 5 with 32-bit offsets (the common case), this fails because > read_srclines checks that the given address size matches the address > size from the line number program header. > > Fix it by splitting is_64bit into separate address_size and offset_size > members.
Very nice catch. You are right that for DWARF5 the line table header already gives the address_size. It is slightly embarassing our sanity check here failed. Thanks for fixing. I had to think a bit on why we didn't need to set the address_size for the fake_cu. But that is only needed to read address class forms. Which aren't valid forms in macro data. Applied, Mark