This patch helps add support for emitting the .debug_info section to yaml2elf.
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.
You probably also want Version 4 and testing for different UnitType values.
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).
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.
I'm not sure I follow. What's the point of overriding .debug_abbrev too? It will at least need explaining in a comment.
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?
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.