Debugging some DWARF5 binaries was causing errors to appear when DWARFExpression::Evaluate was called:
error: GetDIE for DIE 0x31 is outside of its CU 0x123450
The issue is in the DWARF expression evaluator. Fixed with this.
Differential D133623
Fix DW_OP_convert to resolve the CU relative offset correctly. clayborg on Sep 9 2022, 4:48 PM. Authored by
Details Debugging some DWARF5 binaries was causing errors to appear when DWARFExpression::Evaluate was called: error: GetDIE for DIE 0x31 is outside of its CU 0x123450 The issue is in the DWARF expression evaluator. Fixed with this.
Diff Detail
Event TimelineComment Actions Adrian: not sure how to test this. This all seems to be unit tested with your unit tests. If you have any ideas of how to modify the tests to verify this let me know. Comment Actions You would need to modify or clone the existing test https://github.com/llvm/llvm-project/blob/38ffa2bb963714cd117b6d4534d328fa6a0fb875/lldb/unittests/Expression/DWARFExpressionTest.cpp#L153 and add a second CU to it. The inlined text is just the output of obj2yaml.
Comment Actions I believe you. The main question is how top get an object file to produce this file in a small and simple test case. Are you saying it would be easy to add another CU by just appending some yaml? Or do I need to come up with a binary first that already has this in two CUs and then try to obj2yaml the binary? If so, please let me know how to make code that does this. Comment Actions Looking at the test, I think for someone familiar with the DWARF format ;-) manually extending yaml should be pretty straightforward. Comment Actions
Comment Actions Adrian: I added an extra compile unit into the YAML and verified it would fail without the fix. I also added the ability to select a different compile unit by index in the YAMLModuleTester so it can select the second compile unit in the test. Should be good to go now! |
Do you need to give up the const or: