[PATCH] D55113: [llvm-dwarfdump] - Stop printing the bogus empty section name on invalid dwarf.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 4 03:19:33 PST 2018


grimar marked an inline comment as done.
grimar added inline comments.


================
Comment at: llvm/trunk/test/tools/llvm-dwarfdump/X86/no_debug_addr.s:4-11
+## When .debug_addr is absent for some reason,
+## check we do not print a bogus section name.
+
+# CHECK:       DW_AT_ranges [DW_FORM_rnglistx]   (indexed (0x0) rangelist = 0x00000004
+# CHECK-NEXT:    [0x0000000000000000, 0x0000000000000001)
+# CHECK-NEXT:    [0x0000000000000000, 0x0000000000000002)
+# CHECK-NEXT:    [0x0000000000000003, 0x0000000000000004))
----------------
dblaikie wrote:
> Could you provide the source (& compilation commands) for this assembly in a comment here so it's easier to eyeball what the input is to this test rather than reading all the assembly?
> 
> Also, does this need 3 ranges, or would two suffice (thus creating shorter assembly that might be a little easier to understand)? Anything else you can do to simplify the test case would be great.
> 
> Actually, why are there 3 ranges here, when it looks like there are only 2 functions? (ah, I see, invalid input/DWARF as you mentioned in the description - but still, could be simpler to have 2 functions rather than 3)
> Could you provide the source (& compilation commands) for this assembly in a comment here so it's easier to eyeball what the input is to this > test rather than reading all the assembly?

I could, but found that would not be useful probably.
The idea of this test is that `.debug_addr` is absent. So I had to drop it manually. At the same time, test should
use both the `DW_RLE_startx_length` and `DW_RLE_base_addressx`. I had to reduce and manually edit the assembly and
particularly edited the `.debug_rnglists` to add the `DW_RLE_base_addressx` + 'DW_RLE_offset_pair' entries too.
(It was much easier than trying to find the matching c++ code for the DWARF I want to emit)

So I think the user needs to read it to understand the test anyways and having c++ code is more confusing than useful here,
because c++ code would have no so much common with the case I am testing here.

> Actually, why are there 3 ranges here, when it looks like there are only 2 functions? (ah, I see, invalid input/DWARF as you mentioned
> in the description - but still, could be simpler to have 2 functions rather than 3)

That is because `DW_RLE_startx_length` were generated from c++ file, but I edited the assembly and added the `DW_RLE_base_addressx` + `DW_RLE_offset_pair` entries manually because wanted to test the change I did for `DW_RLE_base_addressx`

Technically this test case needs 2 ranges in total, not 3.
I added/updated the comment and removed few excessive things from the test and posted D55261.




Repository:
  rL LLVM

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

https://reviews.llvm.org/D55113





More information about the llvm-commits mailing list