[ObjectYAML][ELF] Add support for emitting the .debug_line section.
authorXing GUO <higuoxing@gmail.com>
Tue, 9 Jun 2020 15:40:40 +0000 (23:40 +0800)
committerXing GUO <higuoxing@gmail.com>
Tue, 9 Jun 2020 15:42:40 +0000 (23:42 +0800)
commit972800039566b10dec9c918a9dabc1f6a0619122
treed08048d32d9444fddebbf93865581192f7661b54
parenta3bfd08ebf9fa8282fa70ed779e1e14aed3d1d59
[ObjectYAML][ELF] Add support for emitting the .debug_line section.

This patch enables yaml2elf emit the .debug_line section.

Test cases for emitting the dwarf64 .debug_line section and opcodes will be added later.

Known issues:
- We should replace `InitialLength` with `Format` and `Length`
- Currently implementation of the .debug_line section only fully supports DWARFv2, some header fields in DWARFv4 and DWARFv5 is missing, e.g., `header_length` in DWARFv4, `address_size` and `segment_selector_size` in DWARFv5.
- Some opcodes relies on the .debug_info section, we should warn user about it.

These issues will be addressed in a follow-up patch.

Reviewed By: jhenderson, grimar

Differential Revision: https://reviews.llvm.org/D81450
llvm/lib/ObjectYAML/DWARFYAML.cpp
llvm/lib/ObjectYAML/ELFEmitter.cpp
llvm/test/tools/yaml2obj/ELF/DWARF/debug-line.yaml [new file with mode: 0644]