Implement the source and line number interleaving with the disassembly.
I'd suggest compiling down a source file to .ll, but keeping it in an Inputs directory for the tool to use in order to match source to object. You may have to modify the debug info in the IR slightly, but maybe not.
I think it would be better to split the hexagon support into a separate (trivial) patch. That would make this change only add the source and line number printing and tests for x86. The hexagon change would then add that target as well.
Got it. I will split this into two patches.
The comment should have been for line 385. The source files need to be opened and displayed when a line info is valid. The files may have to live till end of disassembly since using linker scripts the sections may have been laid out such that source from one file may need to be displayed at any point during disassembly.
Sure a single "; " can be added.
Somehow clang format in one of the intermediate commits I squashed for this change may have triggered this.
Might be nice to clang-format this file before checkin. It hurts my sense of aesthetics :-p.
|5 ↗||(On Diff #67755)|
Is there a reason to prefer ASM over LLVM IR here? If we use LLVM IR, it might be much shorter. Since the DI should reference the LineNumber, I think that the test output should be consistent.