[PATCH] D88715: [llvm-objdump] --source: drop the warning when there is no debug info

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 02:05:56 PDT 2020


jhenderson added a comment.

In D88715#2322240 <https://reviews.llvm.org/D88715#2322240>, @MaskRay wrote:

> In D88715#2313976 <https://reviews.llvm.org/D88715#2313976>, @jhenderson wrote:
>
>>> If sources are not available, it should be obvious as the output will have no interleaved source lines.
>>
>> I'm not entirely convinced that this is a fair statement. I've had a number of occasions in the past where I've tried to dump the source for an object and then got confused why there was no source displayed. Often, it was because I'd forgotten to build with -g, but that wasn't always immediately obvious.
>
> Seems like we may have disagreement. Let me rephrase things:
>
> (1) When -g is not used, do you expect a warning "failed to parse debug info"?
>
> This looks very confusing to me (D62462 <https://reviews.llvm.org/D62462>). I want to get rid of it despite some value losing for (2), and hence this patch.
>
> (2) When -g is not used for the object, do you expect a warning?
>
> I am a bit on the fence. If for places where you *could* have had source if only the right command line options (-g) were used, a warning might be useful.
>
> There are also situations where a binary has some hand-written assembly components which normally do not attached debug info. If the noise ratio is low, I think I will be fine if there is a warning for each such component.
> I will be on board if @mmpozulp	or @jhenderson can enhance this in a non-confusing way.
> The warning requires a more sophisticated approach, like checking whether there are bytes not covered by address ranges and/or line tables, not something as simple as what D62462 <https://reviews.llvm.org/D62462> did: "if DILineInfo is invalid (invalid can mean either invalid or empty), emit a warning".

My personal thoughts are that if there is any debug data in the binary, then I don't think we should warn, even if it means there's bits of the binary that aren't covered by any debug data - this should keep the logic nice and simple and helps avoid spurious warnings where e.g. the linker has added padding between functions. Thus, a linked object with at least one object with debug data will report no warning, whilst a linked object with no debug data at all, or an unlinked object without debug data would report "unable to find debug data" (or something like that). Does this make sense? I don't feel that strongly about it, so if this sounds controversial, I'm happy to hear other suggestions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88715



More information about the llvm-commits mailing list