Page MenuHomePhabricator

[ObjectYAML][ELF] Add support for emitting the .debug_info section.
ClosedPublic

Authored by Higuoxing on Jun 18 2020, 1:15 AM.

Details

Summary

This patch helps add support for emitting the .debug_info section to yaml2elf.

Diff Detail

Unit TestsFailed

TimeTest
640 mswindows > LLVM.tools/yaml2obj/ELF/DWARF::Unknown Unit Message ("")
Script: -- : 'RUN: at line 7'; c:\ws\w3\llvm-project\premerge-checks\build\bin\yaml2obj.exe --docnum=1 -DENDIAN=ELFDATA2LSB C:\ws\w3\llvm-project\premerge-checks\llvm\test\tools\yaml2obj\ELF\DWARF\debug-info.yaml -o C:\ws\w3\llvm-project\premerge-checks\build\test\tools\yaml2obj\ELF\DWARF\Output\debug-info.yaml.tmp1.le.o

Event Timeline

Higuoxing created this revision.Jun 18 2020, 1:15 AM
Herald added a project: Restricted Project. · View Herald Transcript
Higuoxing marked an inline comment as done.Jun 18 2020, 1:25 AM
Higuoxing added inline comments.
llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml
456

In order not to bring too much difficulty. The common tests are very similar to the tests in other DWARF sections, except this one. The property of the .debug_abbrev section is overridden as well in this test.

jhenderson added inline comments.Jun 18 2020, 2:28 AM
llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml
190–191

You probably also want Version 4 and testing for different UnitType values.

197

To ensure there are no truncation issues, all these values probably should be the same width as their permissable data could be (e.g. 8 bytes for DW_FORM_data8, 4 for DW_FORM_data4 etc, so 0x1234567890abcdef, 0x12345678 etc).

231

FWIW, DW_FORM_flag_present doesn't have a corresponding value in .debug_info, so maybe you can omit it from here. It probably needs leaving in the .debug_abbrev table though.

456

I'm not sure I follow. What's the point of overriding .debug_abbrev too? It will at least need explaining in a comment.

Higuoxing marked an inline comment as done.Jun 18 2020, 3:23 AM
Higuoxing added inline comments.
llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml
456

I want to test that yaml2obj is still able to overwrite the section header fields of the .debug_abbrev section when the .debug_info section exists. Does it make sense here?

jhenderson added inline comments.Jun 18 2020, 3:54 AM
llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml
456

Is there actually any interaction in the code between the .debug_abbrev and .debug_info header writing? If not, I don't think you need to test the combination.

Higuoxing updated this revision to Diff 271653.Jun 18 2020, 4:07 AM
Higuoxing marked 4 inline comments as done.

Address comments.

Thanks for reviewing!

llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml
456

There is not interaction between the .debug_abbrev and .debug_info except for reading forms from debug_abbrev when generating values. Thanks :-)

jhenderson accepted this revision.Jun 18 2020, 4:23 AM

Thanks, LGTM, but please give a chance for someone else to look.

This revision is now accepted and ready to land.Jun 18 2020, 4:23 AM
grimar accepted this revision.Jun 18 2020, 5:02 AM

I have nothing to add. LGTM.

MaskRay accepted this revision.Jun 18 2020, 3:08 PM
Higuoxing updated this revision to Diff 271896.Jun 18 2020, 7:52 PM

Trying to make pre-merge check bots happy (Seems that there is an index-out-of-range error).

Harbormaster completed remote builds in B60929: Diff 271901.
Higuoxing updated this revision to Diff 272008.Jun 19 2020, 4:27 AM

Add one empty entry to fallible compilation units.
Let's see if pre-merge bots are happy with this change.

This revision was automatically updated to reflect the committed changes.