From d8c33dc2f60becafd0460d4e24d211316f64e521 Mon Sep 17 00:00:00 2001 From: Frederic Riss Date: Sun, 31 Jan 2016 04:29:22 +0000 Subject: [dsymutil] Allow debug map mappings with no object file address. NFC This change just changes the data structure that ties symbol names, object file address and linked binary addresses to accept mappings with no object file address. Such symbol mappings are not fed into the debug map yet, so this patch is NFC. A subsequent patch will make use of this functionality for common symbols. llvm-svn: 259317 --- llvm/tools/dsymutil/DebugMap.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'llvm/tools/dsymutil/DebugMap.h') diff --git a/llvm/tools/dsymutil/DebugMap.h b/llvm/tools/dsymutil/DebugMap.h index 4907b8f1a72..1a3d62b67b7 100644 --- a/llvm/tools/dsymutil/DebugMap.h +++ b/llvm/tools/dsymutil/DebugMap.h @@ -117,12 +117,15 @@ public: class DebugMapObject { public: struct SymbolMapping { - yaml::Hex64 ObjectAddress; + Optional ObjectAddress; yaml::Hex64 BinaryAddress; yaml::Hex32 Size; - SymbolMapping(uint64_t ObjectAddress, uint64_t BinaryAddress, uint32_t Size) - : ObjectAddress(ObjectAddress), BinaryAddress(BinaryAddress), - Size(Size) {} + SymbolMapping(Optional ObjectAddr, uint64_t BinaryAddress, + uint32_t Size) + : BinaryAddress(BinaryAddress), Size(Size) { + if (ObjectAddr) + ObjectAddress = *ObjectAddr; + } /// For YAML IO support SymbolMapping() = default; }; @@ -132,7 +135,7 @@ public: /// \brief Adds a symbol mapping to this DebugMapObject. /// \returns false if the symbol was already registered. The request /// is discarded in this case. - bool addSymbol(llvm::StringRef SymName, uint64_t ObjectAddress, + bool addSymbol(llvm::StringRef SymName, Optional ObjectAddress, uint64_t LinkedAddress, uint32_t Size); /// \brief Lookup a symbol mapping. -- cgit v1.2.3