Hi,
Here is a patch from Jakub (with some small tweaks to the output from me). It adds typed DWARF stack support (which is now in gcc trunk) where DW_OP_GNU_entry_value is supported. readelf -w works. For more background on the new ops see http://www.dwarfstd.org/doc/040408.1.html
Here is some example output:
[ f582] GNU_call_site_parameter location (block1) [ 0] reg17 GNU_call_site_value (block1) [ 0] breg15 0 [ 2] const1u 32 [ 4] shl [ 5] const1u 32 [ 7] shr [ 8] GNU_convert [ 38] [ 10] GNU_convert [ 31] [ 12] GNU_const_type [ 31] 8 byte block: 00 00 00 00 00 00 59 40 [ 23] mul [ 24] fbreg -168 [ 27] GNU_deref_type 8 [ 31] [ 30] div
We haven't figured out yet how to adjust dwarf_getlocation to handle these 5 new ops and DW_OP_GNU_entry_value.
I'll push the first patch to master, merge master into the dwarf branch and then apply the second patch on the branch.
Cheers,
Mark
entry_value should use DW_FORM_locexpr in version>=4 CUs, and dwarflint should whine about block used instead there.
For the new ops that have a DIE offset as parameter, we should generalize dwarf_getlocation_implicit_pointer into an interface for yielding a Dwarf_Die from a Dwarf_Op of such a flavor. (dwarf_getlocation_implicit_pointer then just uses that and dwarf_attr.)
For entry_value we could perhaps have something that yields a somehow faked up Dwarf_Attribute so you could pass that to dwarf_getlocation. Or we could have another single-purpose thing dwarf_getlocation_exprloc that takes attr,op,expr,exprlen.
Thanks, Roland
Mark> Here is a patch from Jakub (with some small tweaks to the output Mark> from me). It adds typed DWARF stack support (which is now in gcc trunk) Mark> where DW_OP_GNU_entry_value is supported. readelf -w works. For more Mark> background on the new ops see http://www.dwarfstd.org/doc/040408.1.html
Note that there are also some clarifications to the semantics in the GCC thread(s) about the patch.
Tom
elfutils-devel@lists.fedorahosted.org