diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2015-11-04 00:30:24 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-11-04 00:30:24 +0000 |
commit | 884adda0fb83dc15ec4baefcc85decbff26ca3fd (patch) | |
tree | c54d4f1e59a1720967b7b1a73d92b1b528c029fe /llvm/include | |
parent | b0742319fcc153c5922e7b4eeb45fa5b2c45b1b5 (diff) | |
download | bcm5719-llvm-884adda0fb83dc15ec4baefcc85decbff26ca3fd.tar.gz bcm5719-llvm-884adda0fb83dc15ec4baefcc85decbff26ca3fd.zip |
[LLVMSymbolize] Properly propagate object parsing errors from the library.
llvm-svn: 252021
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h index 281d4cd3949..7871a2653a5 100644 --- a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h +++ b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h @@ -18,6 +18,7 @@ #include "llvm/DebugInfo/Symbolize/SymbolizableModule.h" #include "llvm/Object/MachOUniversal.h" #include "llvm/Object/ObjectFile.h" +#include "llvm/Support/ErrorOr.h" #include "llvm/Support/MemoryBuffer.h" #include <map> #include <memory> @@ -51,11 +52,12 @@ public: flush(); } - DILineInfo symbolizeCode(const std::string &ModuleName, - uint64_t ModuleOffset); - DIInliningInfo symbolizeInlinedCode(const std::string &ModuleName, - uint64_t ModuleOffset); - DIGlobal symbolizeData(const std::string &ModuleName, uint64_t ModuleOffset); + ErrorOr<DILineInfo> symbolizeCode(const std::string &ModuleName, + uint64_t ModuleOffset); + ErrorOr<DIInliningInfo> symbolizeInlinedCode(const std::string &ModuleName, + uint64_t ModuleOffset); + ErrorOr<DIGlobal> symbolizeData(const std::string &ModuleName, + uint64_t ModuleOffset); void flush(); static std::string DemangleName(const std::string &Name, const SymbolizableModule *ModInfo); @@ -63,17 +65,19 @@ public: private: typedef std::pair<ObjectFile*, ObjectFile*> ObjectPair; - SymbolizableModule *getOrCreateModuleInfo(const std::string &ModuleName); + ErrorOr<SymbolizableModule *> + getOrCreateModuleInfo(const std::string &ModuleName); ObjectFile *lookUpDsymFile(const std::string &Path, const MachOObjectFile *ExeObj, const std::string &ArchName); /// \brief Returns pair of pointers to object and debug object. - ObjectPair getOrCreateObjects(const std::string &Path, - const std::string &ArchName); + ErrorOr<ObjectPair> getOrCreateObjects(const std::string &Path, + const std::string &ArchName); /// \brief Returns a parsed object file for a given architecture in a /// universal binary (or the binary itself if it is an object file). - ObjectFile *getObjectFileFromBinary(Binary *Bin, const std::string &ArchName); + ErrorOr<ObjectFile *> getObjectFileFromBinary(Binary *Bin, + const std::string &ArchName); // Owns all the parsed binaries and object files. SmallVector<std::unique_ptr<Binary>, 4> ParsedBinariesAndObjects; @@ -86,10 +90,10 @@ private: MemoryBuffers.push_back(std::move(MemBuf)); } - std::map<std::string, std::unique_ptr<SymbolizableModule>> Modules; - std::map<std::pair<MachOUniversalBinary *, std::string>, ObjectFile *> - ObjectFileForArch; - std::map<std::pair<std::string, std::string>, ObjectPair> + std::map<std::string, ErrorOr<std::unique_ptr<SymbolizableModule>>> Modules; + std::map<std::pair<MachOUniversalBinary *, std::string>, + ErrorOr<ObjectFile *>> ObjectFileForArch; + std::map<std::pair<std::string, std::string>, ErrorOr<ObjectPair>> ObjectPairForPathArch; Options Opts; |