This is an archive of the discontinued LLVM Phabricator instance.

[obj2yaml] Stop parsing the debug_str section when it encounters a string without the null terminator.
ClosedPublic

Authored by Higuoxing on Sep 7 2020, 6:29 PM.

Details

Summary

When obj2yaml encounters a string without the null terminator, it should
stop parsing the debug_str section. This patch addresses comments in
D86867.

Diff Detail

Event Timeline

Higuoxing created this revision.Sep 7 2020, 6:29 PM
Herald added a project: Restricted Project. · View Herald Transcript
Higuoxing requested review of this revision.Sep 7 2020, 6:29 PM
Higuoxing updated this revision to Diff 290387.Sep 7 2020, 6:36 PM

Remove a header.

jhenderson added inline comments.Sep 8 2020, 12:24 AM
llvm/test/ObjectYAML/MachO/DWARF-debug_str.yaml
325
327

Might be worth an --implicit-check-not to show that a DWARF tag is not included (or a NO-TERMINATOR-NOT: DWARF before the Sections block).

llvm/test/tools/obj2yaml/ELF/DWARF/debug-str.yaml
103

May be worth extending this comment saying that it uses raw content instead of the DWARF tag in this situation. Also, see comment above re. checking there is no DWARF tag in the YAML output.

Higuoxing updated this revision to Diff 290419.Sep 8 2020, 12:46 AM
Higuoxing marked 3 inline comments as done.

Address review comments.

Thanks!

jhenderson accepted this revision.Sep 8 2020, 12:57 AM

LGTM with comment update.

llvm/test/tools/obj2yaml/ELF/DWARF/debug-str.yaml
104–105

This is what I meant. Your comment suggested it was the input that was important, whereas I'm interested in explaining that it's the output that we're testing here.

This revision is now accepted and ready to land.Sep 8 2020, 12:57 AM
Higuoxing updated this revision to Diff 290422.Sep 8 2020, 1:02 AM
Higuoxing marked an inline comment as done.

Update comment.

llvm/test/tools/obj2yaml/ELF/DWARF/debug-str.yaml
104–105

Thanks!

This revision was landed with ongoing or failed builds.Sep 8 2020, 1:10 AM
This revision was automatically updated to reflect the committed changes.