diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/DebugInfo/Symbolize/Symbolize.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/Object/COFFObjectFile.cpp | 18 |
2 files changed, 13 insertions, 11 deletions
diff --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp index adbe0cb69ed..31a0086f6fc 100644 --- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp +++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp @@ -391,10 +391,10 @@ LLVMSymbolizer::getOrCreateModuleInfo(const std::string &ModuleName) { // If this is a COFF object containing PDB info, use a PDBContext to // symbolize. Otherwise, use DWARF. if (auto CoffObject = dyn_cast<COFFObjectFile>(Objects.first)) { - const debug_pdb_info *PDBInfo; + const codeview::DebugInfo *DebugInfo; StringRef PDBFileName; - auto EC = CoffObject->getDebugPDBInfo(PDBInfo, PDBFileName); - if (!EC && PDBInfo != nullptr) { + auto EC = CoffObject->getDebugPDBInfo(DebugInfo, PDBFileName); + if (!EC && DebugInfo != nullptr) { using namespace pdb; std::unique_ptr<IPDBSession> Session; if (auto Err = loadDataForEXE(PDB_ReaderType::DIA, diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp index 668f4d04a51..a43eca6f976 100644 --- a/llvm/lib/Object/COFFObjectFile.cpp +++ b/llvm/lib/Object/COFFObjectFile.cpp @@ -487,17 +487,18 @@ std::error_code COFFObjectFile::getHintName(uint32_t Rva, uint16_t &Hint, return std::error_code(); } -std::error_code COFFObjectFile::getDebugPDBInfo(const debug_directory *DebugDir, - const debug_pdb_info *&PDBInfo, - StringRef &PDBFileName) const { +std::error_code +COFFObjectFile::getDebugPDBInfo(const debug_directory *DebugDir, + const codeview::DebugInfo *&PDBInfo, + StringRef &PDBFileName) const { ArrayRef<uint8_t> InfoBytes; if (std::error_code EC = getRvaAndSizeAsBytes( DebugDir->AddressOfRawData, DebugDir->SizeOfData, InfoBytes)) return EC; - if (InfoBytes.size() < sizeof(debug_pdb_info) + 1) + if (InfoBytes.size() < sizeof(*PDBInfo) + 1) return object_error::parse_failed; - PDBInfo = reinterpret_cast<const debug_pdb_info *>(InfoBytes.data()); - InfoBytes = InfoBytes.drop_front(sizeof(debug_pdb_info)); + PDBInfo = reinterpret_cast<const codeview::DebugInfo *>(InfoBytes.data()); + InfoBytes = InfoBytes.drop_front(sizeof(*PDBInfo)); PDBFileName = StringRef(reinterpret_cast<const char *>(InfoBytes.data()), InfoBytes.size()); // Truncate the name at the first null byte. Ignore any padding. @@ -505,8 +506,9 @@ std::error_code COFFObjectFile::getDebugPDBInfo(const debug_directory *DebugDir, return std::error_code(); } -std::error_code COFFObjectFile::getDebugPDBInfo(const debug_pdb_info *&PDBInfo, - StringRef &PDBFileName) const { +std::error_code +COFFObjectFile::getDebugPDBInfo(const codeview::DebugInfo *&PDBInfo, + StringRef &PDBFileName) const { for (const debug_directory &D : debug_directories()) if (D.Type == COFF::IMAGE_DEBUG_TYPE_CODEVIEW) return getDebugPDBInfo(&D, PDBInfo, PDBFileName); |