[PATCH] D71008: [DebugInfo] Refactored macro related generation, added a test case for macinfo.dwo emission.

Sourabh Singh Tomar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 11:47:39 PST 2019


SouraVX added a comment.

In D71008#1769278 <https://reviews.llvm.org/D71008#1769278>, @dblaikie wrote:

> Sorry, I'm a bit confused - this sort of thing should be included in the original review.


Ah, that was showing accepted. Even you reopened it[I noticed]. So that's why I created a new one. I think, I mentioned my intentions in previous revision also ??

> But I think this whole direction (supporting macinfo.dwo) should not be done, since macinfo is not in DWARFv5 - so to reach DWARFv5 support, you/we/someone should first fix the existing bug (which is that debug_macro should be emitted in DWARFv5, but currently LLVM produces debug_macinfo instead). and then that correct support can be expanded to support Split DWARFv5.

I'm working on DWARFv5 debug_macro also, holding up till this also gets it.
But Main motivation behind this are -- {Some mentioned in previous revision}

- One of the major factor is GDB and how it handles stuff, if you try using `clang 9.0` or any older version. behavior of macro is like this `-g -gsplit-dwarf -fdebug-macro`{-g defaulting to DWARF version 4}. `debug_macinfo` got populated{even when `split-dwarf` is specified}. Now load that binary in GDB, try expanding macros, it fails. that renders all the heavy lifting compiler did to produce `debug_macinfo` section is finally useless. Please note here that this behavior is contrary to GCC, GCC produces `debug_macinfo.dwo` when `-gsplit-dwarf` is specified. GDB also seems to be happy, macro expansion works fine. Seems like for split-dwarf mode, GDB looks for `macinfo.dwo` in DWO file. Just a side note GCC-9.2, I think trunk also, only generate `macinfo/macinfo.dwo` only when `-gstrict-dwarf` is also specified along with the usual ones, otherwise GCC by defaults generates `macro/macro.dwo`.
- For a C++ project, the macro information, can be huge. moving this to separate file{DWO} can be a huge win. I think saves a bit of linking time also ?
- Nevertheless, considering the present situation{assuming you/someone else don't want macinfo.dwo possibly revert it}. For binaries compiled with `-g -gsplit-dwarf` compiler will still produce `debug_macinfo`, that GDB cannot use.

I think, these seems  points reasonable enough. I also want to here your opinion/motivation as to why should not be doing this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71008





More information about the llvm-commits mailing list