This patch adds a new kind of dump into the llvm-dwarfdump utility.
This new kind of dump can be used to compare semantically the same but
binary different DWARF files produced by dsymutil. f.e. these two should match:
dsymutil intput-file -o - | llvm-dwarfdump --dsymutil-compat-dump - -o - | md5 dsymutil --no-odr intput-file -o - | llvm-dwarfdump --dsymutil-compat-dump - -o - | md5
The idea of the dump is that it skips type dies. Instead, it prints type names.
Additionally, it skips dies offsets, strings offsets, etc...
"llvm-dwarfdump -a":
0x0000002a: DW_TAG_class_type DW_AT_name ("class1") 0x00000071: DW_TAG_subprogram DW_AT_name ("foo1") DW_AT_low_pc (0x0000000000001000) DW_AT_high_pc (0x0000000000001010) DW_AT_type (0x0000002a "class1")
"llvm-dwarfdump --dsymutil-compat-dump":
== DW_TAG_subprogram [1] DW_AT_name "foo1" DW_AT_low_pc 0x0000000000001000 DW_AT_high_pc 0x0000000000001010 DW_AT_type "class1"
use cases for this dump:
- to compare result produced by "dsymutil" and "dsymutil --no-odr".
- to compare result produced by current upstream dsymutil and another one from https://reviews.llvm.org/D86539.
- to compare result produced by current upstream dsymutil and another one from https://reviews.llvm.org/D96035.