This is an archive of the discontinued LLVM Phabricator instance.

[DWARFYAML] Add support for emitting multiple abbrev tables.
ClosedPublic

Authored by Higuoxing on Aug 18 2020, 11:00 PM.

Details

Summary

This patch adds support for emitting multiple abbrev tables. Currently,
compilation units will always reference the first abbrev table.

Diff Detail

Event Timeline

Higuoxing created this revision.Aug 18 2020, 11:00 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
Higuoxing requested review of this revision.Aug 18 2020, 11:00 PM

Modified tests:

test/tools/yaml2obj/ELF/debug-abbrev.yaml: Add one more abbrev table in test case (a).
test/tools/yaml2obj/ELF/debug-info.yaml: Add test case (n). Test that yaml2obj emits an error message when a compilation unit has values but there is no associated abbrev tables.

The generated abbrev tables are verified using llvm-dwarfdump.

Higuoxing added inline comments.Aug 18 2020, 11:56 PM
llvm/lib/ObjectYAML/DWARFEmitter.cpp
259–265
Comments from D83116

@jhenderson : It might make more sense to do this work in the caller of this function, and to maintain this function's interface.

Some DIEs only have abbrev codes and do not have values. If we do this work in the caller of this function, yaml2obj will reject empty DIEs.

jhenderson added inline comments.Aug 19 2020, 1:08 AM
llvm/lib/ObjectYAML/DWARFEmitter.cpp
100

Don't use auto here. It's not obvious what the type is.

llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml
885
llvm/tools/obj2yaml/dwarf2yaml.cpp
27–44

Does this work?

Higuoxing updated this revision to Diff 286507.Aug 19 2020, 1:51 AM
Higuoxing marked 3 inline comments as done.
  • Address review comments.
  • Modify test: llvm/test/ObjectYAML/MachO/DWARF-debug_abbrev.yaml
llvm/tools/obj2yaml/dwarf2yaml.cpp
27–44

Yes, I think it works.

jhenderson accepted this revision.Aug 19 2020, 2:04 AM

LGTM, except for the new test change - I think that should be in a different patch.

llvm/test/ObjectYAML/MachO/DWARF-debug_abbrev.yaml
2

Let's move this test change into a different patch, to avoid doing too much at once.

This revision is now accepted and ready to land.Aug 19 2020, 2:04 AM
Higuoxing updated this revision to Diff 286511.Aug 19 2020, 2:23 AM
Higuoxing marked an inline comment as done.

Revert "llvm/test/ObjectYAML/MachO/DWARF-debug_abbrev.yaml"

jhenderson accepted this revision.Aug 19 2020, 2:27 AM
labath accepted this revision.Aug 19 2020, 4:42 AM
Higuoxing updated this revision to Diff 286708.Aug 19 2020, 9:29 PM

Rebase.

Thanks for reviewing!

This revision was landed with ongoing or failed builds.Aug 20 2020, 7:31 PM
This revision was automatically updated to reflect the committed changes.