[PATCH] D85018: [WIP][POC][DebugInfo] Support for DW_AT_start_scope for scoped variables

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 5 00:47:06 PDT 2020


djtodoro added a comment.

In D85018#2194109 <https://reviews.llvm.org/D85018#2194109>, @dblaikie wrote:

> In D85018#2193545 <https://reviews.llvm.org/D85018#2193545>, @SouraVX wrote:
>
>> In D85018#2193489 <https://reviews.llvm.org/D85018#2193489>, @djtodoro wrote:
>>
>>> According to the --show-section-sizes output, the .debug_loc has been increased?
>>
>> Thanks for reviewing this! Yea that's one of the drawback(Added FIXME for the same).
>
> When you say "this causes loc list emission even at -O0" could you be more precise? Does the debug_info actually use a location list somewhere? If so, where, if not - does debug_loc contain an unused location list? Does it contain no location lists, but gets emitted (though empty) when it'd otherwise not be emitted at all?

+1 for this question(s).

>> Since I've used `dbg.value` intrinsic for representing this variable(all reduced scope variables), this is resulting in a location list entry. We should avoid this somehow, this is because, In our local `GDB` implementation `DW_AT_start_scope` is the only thing necessary for capturing the scope info correctly.
>> BTW, as per @dblaikie comment, do `llvm-dwarfdump` needs to be aware of `DW_AT_start_scope` ?
>
> My complaint wasn't so much about llvm-dwarfdump --show-section-sizes' output - it's fine for what it is, and it doesn't need to be aware of DW_AT_strat_scope - all it's doing is dumping the size of the sections, without any knowledge of what those sections contain (at least I hope that's how it's implemented - I usually use llvm-objdump -h | grep debug_ for that task, personally). I just meant something like 'bloaty' can do a clearer job of comparing two ELF files for relative sizes - whereas looking at the two dumps of show-section-sizes isn't as easy to visually compare the numbers.

Yes, the `--show-section-sizes` just looks for sections sizes (debug sections: .debug*, _debug*, _zdebug*, _gdb* etc.). There should be an option for comparing two object files, I think there is a TODO for that. :)

The `DW_AT_start_scope` might be interesting when calculating location coverage stats (and I guess that is what @dblaikie has thought) with `llvm-dwarfdump --statistics` or `llvm-locstats` (these create the location coverage buckets).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85018



More information about the llvm-commits mailing list