This is an archive of the discontinued LLVM Phabricator instance.

[LLD] Report errors occurred while parsing debug info as warnings.
ClosedPublic

Authored by avl on Feb 27 2020, 2:28 AM.

Details

Summary

Extracted from D74773. Currently, errors happened while parsing
debug info are reported as errors. DebugInfoDWARF library treats such
errors as "Recoverable errors". This patch makes debug info errors
to be reported as warnings, to support DebugInfoDWARF approach.

Diff Detail

Event Timeline

avl created this revision.Feb 27 2020, 2:28 AM
avl added a project: lld.Feb 27 2020, 4:48 AM
MaskRay added inline comments.Feb 27 2020, 10:26 AM
lld/ELF/SyntheticSections.cpp
2671

Downgrading an error to a warning is fine.

lld/test/ELF/gdb-index-parse-fail.s
5

Why the ? metacharacter?

avl marked an inline comment as done.Feb 27 2020, 10:43 AM
avl added inline comments.
lld/test/ELF/gdb-index-parse-fail.s
5

To have one or zero "(.debug_info):". Please check that description https://reviews.llvm.org/D74773#inline-683778

jhenderson added inline comments.Feb 28 2020, 1:28 AM
lld/test/ELF/gdb-index-invalid-ranges.s
8–10

Same comments as in the other test - why has the text changed in this patch when all you've done is change the severity of this error?

lld/test/ELF/gdb-index-parse-fail.s
5

But isn't in this patch this output unchanged from before? The only change in the text should be error -> warning.

avl marked an inline comment as done.Feb 28 2020, 1:52 AM
avl added inline comments.
lld/test/ELF/gdb-index-invalid-ranges.s
8–10

right. this change should be done in D74773

avl updated this revision to Diff 247196.Feb 28 2020, 2:38 AM

addressed comments: removed change related to D74773.

This revision is now accepted and ready to land.Feb 28 2020, 3:35 AM
MaskRay accepted this revision.Feb 28 2020, 12:54 PM

Some DWARF producer bugs (e.g. D75375) will change from an error to a warning. I think it is fine.

// clang -c -gdwarf-5 a.s -o a.o
.section .init; ret
.text; ret

ld.lld --gdb-index a.o

This revision was automatically updated to reflect the committed changes.

You can strip some Phabricator metadata tags, BTW:

% which arcfilter
arcfilter () {
        git log -1 --pretty=%B | awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:/' | git commit --amend -F -
}