[obj2yaml] Refactor the .debug_pub* sections dumper.
authorXing GUO <higuoxing@gmail.com>
Wed, 19 Aug 2020 13:13:46 +0000 (21:13 +0800)
committerXing GUO <higuoxing@gmail.com>
Wed, 19 Aug 2020 13:13:52 +0000 (21:13 +0800)
commit419326a4452650089e5e36c2200c349d5a63bda5
treeb6bc279742edae55ab5f9d5327d3937f0f178a91
parent9cc2f13deeb30de3a2ce1854c36f6c0a8de86d6c
[obj2yaml] Refactor the .debug_pub* sections dumper.

It's good to reuse the DWARF parser in lib/DebugInfo so that we don't
need to maintain a separate parser in client side (obj2yaml). Besides,
A test case is added whose length field is a very huge value which makes
obj2yaml stuck when parsing the section.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D86192
llvm/test/ObjectYAML/MachO/DWARF-pubsections.yaml
llvm/tools/obj2yaml/dwarf2yaml.cpp