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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 08:40:44 PST 2017


I believe, yes, the possible discriminators could be 0 and 1. But I'm still
OK with treating zero as not-present for the purposes of the
verbose/human-readable dumper. If someone's reading a dump with non-zero
discriminators and the zero discriminator entries show up without a
discriminator it's not ambiguous (ie: the dumper hasn't collapsed two
distinct states (not present and zero) into one, losing information) it
might be slightly confusing to the reader, but I don't think so. Seems
pretty OK to treat zero as the default and not render it here in any case.

On Fri, Jan 27, 2017 at 8:04 AM Simon Que <sque at google.com> wrote:

> 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/4d83b3b6/attachment.html>


More information about the llvm-commits mailing list