summaryrefslogtreecommitdiffstats
path: root/llvm/tools/dsymutil/DebugMap.cpp
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2017-10-06 14:49:20 +0000
committerFrancis Ricci <francisjricci@gmail.com>2017-10-06 14:49:20 +0000
commit8aedfde298a8717c2af7735b93512b50ce97dfcb (patch)
tree9c97d5b1b72a74026318e9384b87fab81f7a18e4 /llvm/tools/dsymutil/DebugMap.cpp
parent3333494132ef761b8a34212e2ab2e2d14e903316 (diff)
downloadbcm5719-llvm-8aedfde298a8717c2af7735b93512b50ce97dfcb.tar.gz
bcm5719-llvm-8aedfde298a8717c2af7735b93512b50ce97dfcb.zip
[llvm-dsymutil] Add support for __swift_ast MachO DWARF section
Summary: Xcode's dsymutil emits a __swift_ast DWARF section, which is required for debugging, and which contains a byte-for-byte dump of the swiftmodule file. Add this feature to llvm-dsymutil. Tested with `gobjdump --dwarf=info -s`, by verifying that the contents of `__DWARF.__swift_ast` match between Xcode's dsymutil and llvm-dsymutil (Xcode's dwarfdump and llvm-dwarfdump don't currently recognize the __swift_ast section). Reviewers: aprantl, friss Subscribers: llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D38504 llvm-svn: 315066
Diffstat (limited to 'llvm/tools/dsymutil/DebugMap.cpp')
-rw-r--r--llvm/tools/dsymutil/DebugMap.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/tools/dsymutil/DebugMap.cpp b/llvm/tools/dsymutil/DebugMap.cpp
index 636d65836c6..7f205767461 100644
--- a/llvm/tools/dsymutil/DebugMap.cpp
+++ b/llvm/tools/dsymutil/DebugMap.cpp
@@ -21,8 +21,9 @@ namespace dsymutil {
using namespace llvm::object;
DebugMapObject::DebugMapObject(StringRef ObjectFilename,
- sys::TimePoint<std::chrono::seconds> Timestamp)
- : Filename(ObjectFilename), Timestamp(Timestamp) {}
+ sys::TimePoint<std::chrono::seconds> Timestamp,
+ uint8_t Type)
+ : Filename(ObjectFilename), Timestamp(Timestamp), Type(Type) {}
bool DebugMapObject::addSymbol(StringRef Name, Optional<uint64_t> ObjectAddress,
uint64_t LinkedAddress, uint32_t Size) {
@@ -64,8 +65,9 @@ void DebugMapObject::dump() const { print(errs()); }
DebugMapObject &
DebugMap::addDebugMapObject(StringRef ObjectFilePath,
- sys::TimePoint<std::chrono::seconds> Timestamp) {
- Objects.emplace_back(new DebugMapObject(ObjectFilePath, Timestamp));
+ sys::TimePoint<std::chrono::seconds> Timestamp,
+ uint8_t Type) {
+ Objects.emplace_back(new DebugMapObject(ObjectFilePath, Timestamp, Type));
return *Objects.back();
}
@@ -241,7 +243,7 @@ MappingTraits<dsymutil::DebugMapObject>::YamlDMO::denormalize(IO &IO) {
}
}
- dsymutil::DebugMapObject Res(Path, sys::toTimePoint(Timestamp));
+ dsymutil::DebugMapObject Res(Path, sys::toTimePoint(Timestamp), MachO::N_OSO);
for (auto &Entry : Entries) {
auto &Mapping = Entry.second;
Optional<uint64_t> ObjAddress;
OpenPOWER on IntegriCloud