Closed jeremy-rifkin closed 5 months ago
Yes, working on this.
Made progress yesterday, today is ... really busy with pre-scheduled stuff, so won't be any progress today.
You are the first to present examples and that's great, now I can actually get the code I wrote to work!
The tools to get the rnglists to work are already in the code, but for tied-files the delegation to the tied-file itself are not quite right. And in the process of working on this I noticed A bug in the DWARF5 definition document and proposed an update for DWARF6 to the committee.
Well. I see what I need to add to cu_context setup. Needs a new internal-to-libdwarf interface. Basically to absorb the key data from .debug_rnglists in each object. Won't get done today.
The problem was the compiler was using an implicit value for the rnglists_base in the CU-DIE in the case of a dwp object (which you called cpptrace.cpp.dwo ). That is something not clearly called out in the standard, in particular table F.1 implies it's not necessary when the the .dwp object has .debug_rnglists.
I have worked around that surprise and am currently running regression tests. It will take more than an hour to validate all the improvements in dwarfdump output in existing dwp objects in regressiontests once the run has completed.
There were a few regressions I must investigate. Better, but not entirely correct.
Not ready for prime time. Will take a bit longer (left indefinite).
dwarfdump --print-debug-rnglists produces a pretty report which is none-the-less quite useless for verifying correctness. I have to fix that and then create a proper decision tree to think carefully about the section so I actually fix the code properly. Now.
Running regression tests. We correctly generate an equivalent to DW_AT_rnglists_base when the compiler decided that such was not really needed as was reasonably simple ti generate. I think it's a mistake, but we can work around it just as gdb and others have. Corrects many instances of dwarf-generating ERROR and also changes the format of --print-debug-rnglists to be more useful and easier to read.
Fixes pushed to github. HOWEVER: reading .debug_loclists section has the same bugs as .debug_rnglists did. I need to fix that immediately.
.debug_loclists don't correctly deal with the missing-base situation, but the code from dwarf_rnglists to do that wiill work. Otherwise loclists look ok.
the --print-raw-loclists dwarfdump format needs improvement.
Todays' push to github dealt with this issue.
Thank you so much!
Sorry to open so many issues in quick succession however I've bumped into another issue with debug fission support. Thank you in advance for all the help in tackling these.
I got an error from
dwarf_rnglists_get_rle_head
today:It seems to have originated from here:
https://github.com/davea42/libdwarf-code/blob/113726e89a785b3adc682d9ff2b5f95345fb299a/src/lib/libdwarf/dwarf_rnglists.c#L1341-L1354
This occurred while I was working with a dwo file
path/to/build/test/CMakeFiles/demo.dir/demo.cpp.dwo
with skeletonpath/to/build/demo
.It appears to have happened while reading
00010c92 DW_TAG_subprogram trace
in the dwo:Happy to provide more info as needed.