Context: https://lists.llvm.org/pipermail/llvm-dev/2021-February/148521.html
A fix for symbolizer, and other tools like BOLT, that allows retrieving address when build with -gsplit-dwarf=single mode.
Differential D96827
[DWARF] Check for AddrOffsetSectionBase to work with DWO Units. ayermolo on Feb 16 2021, 6:22 PM. Authored by
Details Context: https://lists.llvm.org/pipermail/llvm-dev/2021-February/148521.html A fix for symbolizer, and other tools like BOLT, that allows retrieving address when build with -gsplit-dwarf=single mode.
Diff Detail
Event TimelineComment Actions Per discussion with @dblaikie going to go with this approach. Need to add test + see if we can avoid redundant checks. Looking at what various tools produce here are few cases. CASE 2 CASE 3 CASE 4 CASE 5 So TLDR. Comment Actions If possible, we tend to use assembly for tests these days, compiling the assembly with llvm-mc to an object file then running the test. Could this use that technique? (& please include a comment in the test file (which can contain the assembly - so it's all in one file) with the specific source code used to compile to the assembly, the commands used to get there, etc. Does this have to use a linked binary? or does it reproduce on a straight .o file? If it needs to be linked... yeah, we don't have much for that short of checking in the linked binary I think. Comment Actions Looks good - just a couple of minor fixes to make before committing. (I assume by your patch that this is only reproducible with a linked binary? please confirm that (in a comment here) before committing)
Comment Actions Sorry for not replying. I was trying to see if I could fix the build failure. It works on my CentOS machine. Comment Actions Oh, you could still have two separate files, though, without it being a linked binary? IF you took the assembly from LLVM for split DWARF (which does have all the assembly for both .o and .dwo in one assembly file) and then manually split that into two .s files and assembled each - could you then reproduce the problem? If you can do it that way, please change the test to contain the two .s files (or one .s file with conditional directives so the .o/.dwo can be compiled to different files) Comment Actions Trying through ARC, removed modified file that snuck in. Comment Actions @dblaikie You were right, it's possible. Just need to use non-relocated address and remove some sections. If all good, will commit. Comment Actions Looks good, but please rename the .s files to match the test file name (like Inputs/symbolize-debug-fission-single-{1,2}.s or the like). It'll make them easier to find. Comment Actions Hi @ayermolo , looks like llvm/test/DebugInfo/X86/symbolize-debug-fission-single.test Is causing some windows buildbots to fail. Mind taking a look? Comment Actions Oh right. Windows...
Comment Actions Hopefully fixed in 350633bab94f8ba70d9427715bbcbf9e3c6abf20 (essentially the same as your fix @ayermolo - I just felt like the {{.*}} made it clear it was intentional that some extra characters on the line are being skipped over) |
Drop the {} around single line block. ( https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements )