aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-07-26 19:03:47 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-07-26 19:04:23 +0000
commit7fa27ce4a07f19b07799a767fc29416f3b625afb (patch)
tree27825c83636c4de341eb09a74f49f5d38a15d165 /lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
parente3b557809604d036af6e00c60f012c2025b59a5e (diff)
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
index 82d3707acfa4..f14fb32621b3 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
@@ -57,6 +57,7 @@
#include "PdbUtil.h"
#include "UdtRecordCompleter.h"
#include <optional>
+#include <string_view>
using namespace lldb;
using namespace lldb_private;
@@ -76,6 +77,10 @@ static lldb::LanguageType TranslateLanguage(PDB_Lang lang) {
return lldb::LanguageType::eLanguageTypeSwift;
case PDB_Lang::Rust:
return lldb::LanguageType::eLanguageTypeRust;
+ case PDB_Lang::ObjC:
+ return lldb::LanguageType::eLanguageTypeObjC;
+ case PDB_Lang::ObjCpp:
+ return lldb::LanguageType::eLanguageTypeObjC_plus_plus;
default:
return lldb::LanguageType::eLanguageTypeUnknown;
}
@@ -353,7 +358,7 @@ void SymbolFileNativePDB::InitializeObject() {
lldb::eLanguageTypeC_plus_plus);
if (auto err = ts_or_err.takeError()) {
LLDB_LOG_ERROR(GetLog(LLDBLog::Symbols), std::move(err),
- "Failed to initialize");
+ "Failed to initialize: {0}");
} else {
if (auto ts = *ts_or_err)
ts->SetSymbolFile(this);
@@ -627,7 +632,7 @@ static std::string GetUnqualifiedTypeName(const TagRecord &record) {
}
llvm::ms_demangle::Demangler demangler;
- StringView sv(record.UniqueName.begin(), record.UniqueName.size());
+ std::string_view sv(record.UniqueName.begin(), record.UniqueName.size());
llvm::ms_demangle::TagTypeNode *ttn = demangler.parseTagUniqueName(sv);
if (demangler.Error)
return std::string(record.Name);
@@ -1341,6 +1346,9 @@ bool SymbolFileNativePDB::ParseDebugMacros(CompileUnit &comp_unit) {
llvm::Expected<uint32_t>
SymbolFileNativePDB::GetFileIndex(const CompilandIndexItem &cii,
uint32_t file_id) {
+ if (!cii.m_strings.hasChecksums() || !cii.m_strings.hasStrings())
+ return llvm::make_error<RawError>(raw_error_code::no_entry);
+
const auto &checksums = cii.m_strings.checksums().getArray();
const auto &strings = cii.m_strings.strings();
// Indices in this structure are actually offsets of records in the
@@ -1389,7 +1397,7 @@ bool SymbolFileNativePDB::ParseImportedModules(
void SymbolFileNativePDB::ParseInlineSite(PdbCompilandSymId id,
Address func_addr) {
lldb::user_id_t opaque_uid = toOpaqueUid(id);
- if (m_inline_sites.find(opaque_uid) != m_inline_sites.end())
+ if (m_inline_sites.contains(opaque_uid))
return;
addr_t func_base = func_addr.GetFileAddress();
@@ -2126,9 +2134,8 @@ void SymbolFileNativePDB::GetTypes(lldb_private::SymbolContextScope *sc_scope,
TypeClass type_mask,
lldb_private::TypeList &type_list) {}
-CompilerDeclContext
-SymbolFileNativePDB::FindNamespace(ConstString name,
- const CompilerDeclContext &parent_decl_ctx) {
+CompilerDeclContext SymbolFileNativePDB::FindNamespace(
+ ConstString name, const CompilerDeclContext &parent_decl_ctx, bool) {
return {};
}