[PATCH] D81144: [MC] Generate .debug_line in the 64-bit DWARF format [2/7]

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 23:09:13 PDT 2020


ikudrin added a comment.

In D81144#2079880 <https://reviews.llvm.org/D81144#2079880>, @probinson wrote:

> I want to be VERY CLEAR that this patch series is specifically for the hand-written assembler source case ONLY.  I have not seen changes in this series that will permit generating DWARF64 format for C/C++ source.  As long as everyone understands that, I have no further objections to make.  Specifically, because the test is about hand-written assembler, the name `gen-dwarf64.s` is fine.


This series of patches enables producing `DWARF64` debug info in `llvm-mc` only. While the new switch, `-dwarf64`, is visible in other tools, for now, it has no effect there, because `MCContext::setDwarfFormat(DWARF64)` is called only in `main()` in `llvm-mc.cpp`.

In D81144#2079971 <https://reviews.llvm.org/D81144#2079971>, @probinson wrote:

> (By "hand-written assembler" I mean assembler source without .file/.loc directives.  llvm-mc is perfectly capable of assembling a file with .file/.loc directives but that will take different paths not covered by this patch.  It was not at all clear from the patch description that only the former case was intended.)


If an assembler source contains `.file`/`.loc` directives, and `-dwarf64` is given, `llvm-mc` will still correctly produce a `DWARF64` `.debug_line` section. That is because the only differences between `DWARF32` and `DWARF64` ones are `unit_length` and `header_length` fields, and references to `.debug_line_str`, and all these are covered by this patch.

Do you have any specific example which results in an incorrect output with these patches?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81144/new/

https://reviews.llvm.org/D81144





More information about the llvm-commits mailing list