[PATCH] D29094: Add verbose printing of line info in LLVM Symbolizer

Simon Que via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 08:04:03 PST 2017


The spec is saying "if only one block, then discriminator=0" but it's not
the same logical meaning as "if discriminator==0, then there is only one
block." If there are two blocks, could the possible discriminator values be
0 and 1?

On Thu, Jan 26, 2017 at 5:30 PM, David Blaikie <dblaikie at gmail.com> wrote:

>
>
> On Thu, Jan 26, 2017 at 2:09 PM Simon Que via Phabricator <
> reviews at reviews.llvm.org> wrote:
>
>> sque added inline comments.
>>
>>
>> ================
>> Comment at: lib/DebugInfo/Symbolize/DIPrinter.cpp:85
>> +    OS << "  Column: " << Info.Column << "\n";
>> +    OS << "  Discriminator: " << Info.Discriminator << "\n";
>> +  } else {
>> ----------------
>> dblaikie wrote:
>> > sque wrote:
>> > > Should this be marked as DWARF-only, or placed in a DWARF-only
>> section?
>> > I'm /guessing/ (though you can probably reproduce this by running
>> -verbose on a checked in COFF/CodeView file - I assume/imagine we have some
>> of those in the dumper testing) that the Discriminator is 0 when not
>> provided?
>> >
>> > Perhaps it'd be easy enough to not print it when it's zero? If that
>> works/you can confirm CodeView is doing what I assume it is - add a test?
>> (for either CV, or a case a zero or not present discriminator in ELF).
>> I am not familiar with possible values of the discriminator. Does
>> discriminator == 0 mean it's invalid? Could it have a valid value of 0?
>>
>
> I'm not 100% sure either - just looked it up in the DWARF4 spec and it
> says "Where only one block exists for a given source position, the
> discriminator value should be zero. " - so, yes, seems it's default value
> of zero is the same as not-present, basically.
>
> So, yes, happy to not print it if it's zero to make it more terse in
> general and avoid confusion when dumping on platforms that don't have a
> discriminator at all.
>
>
>>
>>
>> https://reviews.llvm.org/D29094
>>
>>
>>
>>


-- 
Simon Que
Software Engineer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170127/3da7bec5/attachment.html>


More information about the llvm-commits mailing list