[dsymutil] Implement the BinaryHolder object and gain archive support.
authorFrederic Riss <friss@apple.com>
Mon, 5 Jan 2015 21:29:28 +0000 (21:29 +0000)
committerFrederic Riss <friss@apple.com>
Mon, 5 Jan 2015 21:29:28 +0000 (21:29 +0000)
commit5a0743e1e8362cc11d5ac12399034f8a884c0cb8
tree21bd8320d9f611e796839953cf2e2181c25e09a5
parent27c27a0b61fc817bf905cffd013ba5cbd064ab37
[dsymutil] Implement the BinaryHolder object and gain archive support.

This object is meant to own the ObjectFiles and their underlying
MemoryBuffer. It is basically the equivalent of an OwningBinary
except that it efficiently handles Archives. It is optimized for
efficiently providing mappings of members of the same archive when
they are opened successively (which is standard in Darwin debug
maps, objects from the same archive will be contiguous).

Of course, the BinaryHolder will also be used by the DWARF linker
once it is commited, but for now only the debug map parser uses it.

With this change, you can run llvm-dsymutil on your Darwin debug build
of clang and get a complete debug map for it.

Differential Revision: http://reviews.llvm.org/D6690

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225207 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/dsymutil/Inputs/basic-archive.macho.x86_64 [new file with mode: 0755]
test/tools/dsymutil/Inputs/basic1.c
test/tools/dsymutil/Inputs/libbasic.a [new file with mode: 0644]
test/tools/dsymutil/debug-map-parsing.test
tools/dsymutil/BinaryHolder.cpp [new file with mode: 0644]
tools/dsymutil/BinaryHolder.h [new file with mode: 0644]
tools/dsymutil/CMakeLists.txt
tools/dsymutil/MachODebugMapParser.cpp