Page MenuHomePhabricator

[DWARFYAML] Make the debug_ranges section optional.

Authored by Higuoxing on Sep 7 2020, 7:19 PM.



This patch makes the debug_ranges section optional. When we specify an
empty debug_ranges section, yaml2obj only emits the section header.

Diff Detail

Event Timeline

Higuoxing created this revision.Sep 7 2020, 7:19 PM
Higuoxing requested review of this revision.Sep 7 2020, 7:19 PM
jhenderson added inline comments.Sep 8 2020, 12:29 AM

This test case doesn't feel like it really belongs as part of this patch. It should be its own patch, since it isn't to do with writing an empty .debug_ranges section, right?


Similar comment to D87261 - it might be worth adding a check that the DWARF tag doesn't appear in this case.

Higuoxing updated this revision to Diff 290421.Sep 8 2020, 12:55 AM
Higuoxing marked an inline comment as done.

Address review comments.

Thanks for reviewing!


Yes, it doesn't belong to this patch. I added it because I touched the parser in dwarf2yaml.cpp. When the parser fails the content in the DWARF tag should remain empty. I will add it in a follow-up patch.

This revision is now accepted and ready to land.Sep 8 2020, 12:59 AM
This revision was automatically updated to reflect the committed changes.