aclements / libelfin

C++11 ELF/DWARF parser
MIT License
314 stars 99 forks source link

resolve_indirect() does not resolve indirect encodings #61

Open holinux opened 3 years ago

holinux commented 3 years ago

https://github.com/aclements/libelfin/blob/946dde57e5caef8297b9339f3a7971401d540840/dwarf/value.cc#L278

In function value::resolve_indirect(DW_AT name) a local variable DW_FORM form is defined, so the resolve is performed on this local variable. The attribute DW_FORM form in class Value is not changed at all.

Due to this, I see an issue that when the form is indirect, it throws exception in function value::as_reference(): throw value_type_mismatch("cannot read " + to_string(typ) + " as reference");