[PATCH] D53365: [Codegen] - Implement basic .debug_loclists section emission (DWARF5).

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 25 05:47:18 PDT 2018


grimar added inline comments.


================
Comment at: test/CodeGen/X86/debug-loclists.ll:7
+; CHECK-NEXT: 0x00000000:
+; CHECK-NEXT:             [0x0000000000000000, 0x000000000000001e): DW_OP_breg3 RBX+0
+
----------------
grimar wrote:
> dblaikie wrote:
> > grimar wrote:
> > > dblaikie wrote:
> > > > Probably use a -v dump to test the specific LLE opcodes, etc?
> > > But I am already using `llvm-dwarfdump -v`. It shows `DW_OP_breg3 RBX+0` already.
> > > 
> > > I added a piece from the `.debug_info` to the test to show how location is used here.
> > > 
> > > If you mean to test all possible LLE opcodes, that is probably should be in the patch for llvm-dwarfdump :)
> > I think in this case it's interesting/worth testing the particular choice of LLE encoding that LLVM used to emit this list. (see similar tests for RLE, I think?)
> > 
> > Other tests that are interested in testing the high level "this range has this location, this range has this location" would use the sort of checking you have here.
> Ah, I see what you mean now. Did not realize you're talking about LLE* entry kinds (that is how they are called in the standard it seems) and not about dumping the DW_OP* opcodes. That makes sense.
> 
> At a very quick look, I see tests dumping DW_RLE_* with -v option, but seems nothing dumps DW_LLE_*.
> So seems it needs adding this functionality to the llvm-dwarfdump perhaps.
> I'll take a look closer tomorrow and do that then. Thanks!
So. Currently, we dump range lists in `dumpRnglistsSection` here:
https://github.com/llvm-mirror/llvm/blob/master/lib/DebugInfo/DWARF/DWARFContext.cpp#L273

and locations list int `dumpLoclistsSection` here:
https://github.com/llvm-mirror/llvm/blob/master/lib/DebugInfo/DWARF/DWARFContext.cpp#L295
The latter does not implements dumping the LLE_* kinds.

Ranges list and locations list are very similar and can be dumped in a common way and share the code
probably. I believe that is what D51081 starts to generalize and its code can be used for implementing
locations list dumping (LLE*).

But it was not yet re-landed, though I assume it should happen soon
(https://reviews.llvm.org/D53364#1271569).
And I would prefer waiting for it before starting to implement LLE* dumping with llvm-dwarfdump.

For now, I suggest checking the asm code produced to verify the RLE entries. What do you think?


https://reviews.llvm.org/D53365





More information about the llvm-commits mailing list