summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/FileLineResolver.cpp4
-rw-r--r--lldb/source/Core/FormatEntity.cpp3
-rw-r--r--lldb/source/Core/Module.cpp3
-rw-r--r--lldb/source/Core/SearchFilter.cpp16
-rw-r--r--lldb/source/Core/SourceManager.cpp11
5 files changed, 21 insertions, 16 deletions
diff --git a/lldb/source/Core/FileLineResolver.cpp b/lldb/source/Core/FileLineResolver.cpp
index 01df295398a..7d91d1a3e47 100644
--- a/lldb/source/Core/FileLineResolver.cpp
+++ b/lldb/source/Core/FileLineResolver.cpp
@@ -36,8 +36,8 @@ FileLineResolver::SearchCallback(SearchFilter &filter, SymbolContext &context,
Address *addr) {
CompileUnit *cu = context.comp_unit;
- if (m_inlines ||
- m_file_spec.Compare(*cu, m_file_spec, (bool)m_file_spec.GetDirectory())) {
+ if (m_inlines || m_file_spec.Compare(cu->GetPrimaryFile(), m_file_spec,
+ (bool)m_file_spec.GetDirectory())) {
uint32_t start_file_idx = 0;
uint32_t file_idx =
cu->GetSupportFiles().FindFileIndex(start_file_idx, m_file_spec, false);
diff --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp
index c90828f4098..07ca0a68a10 100644
--- a/lldb/source/Core/FormatEntity.cpp
+++ b/lldb/source/Core/FormatEntity.cpp
@@ -1376,8 +1376,7 @@ bool FormatEntity::Format(const Entry &entry, Stream &s,
if (sc) {
CompileUnit *cu = sc->comp_unit;
if (cu) {
- // CompileUnit is a FileSpec
- if (DumpFile(s, *cu, (FileKind)entry.number))
+ if (DumpFile(s, cu->GetPrimaryFile(), (FileKind)entry.number))
return true;
}
}
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index a14bd3d370a..360c8c13454 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -617,7 +617,8 @@ void Module::FindCompileUnits(const FileSpec &path,
for (size_t i = 0; i < num_compile_units; ++i) {
sc.comp_unit = GetCompileUnitAtIndex(i).get();
if (sc.comp_unit) {
- if (FileSpec::Equal(*sc.comp_unit, path, compare_directory))
+ if (FileSpec::Equal(sc.comp_unit->GetPrimaryFile(), path,
+ compare_directory))
sc_list.Append(sc);
}
}
diff --git a/lldb/source/Core/SearchFilter.cpp b/lldb/source/Core/SearchFilter.cpp
index 8f80caa3eb4..c49b59e601e 100644
--- a/lldb/source/Core/SearchFilter.cpp
+++ b/lldb/source/Core/SearchFilter.cpp
@@ -726,8 +726,11 @@ bool SearchFilterByModuleListAndCU::AddressPasses(Address &address) {
if (m_cu_spec_list.GetSize() != 0)
return false; // Has no comp_unit so can't pass the file check.
}
- if (m_cu_spec_list.FindFileIndex(0, sym_ctx.comp_unit, false) == UINT32_MAX)
- return false; // Fails the file check
+ FileSpec cu_spec;
+ if (sym_ctx.comp_unit)
+ cu_spec = sym_ctx.comp_unit->GetPrimaryFile();
+ if (m_cu_spec_list.FindFileIndex(0, cu_spec, false) == UINT32_MAX)
+ return false; // Fails the file check
return SearchFilterByModuleList::ModulePasses(sym_ctx.module_sp);
}
@@ -736,8 +739,8 @@ bool SearchFilterByModuleListAndCU::CompUnitPasses(FileSpec &fileSpec) {
}
bool SearchFilterByModuleListAndCU::CompUnitPasses(CompileUnit &compUnit) {
- bool in_cu_list =
- m_cu_spec_list.FindFileIndex(0, compUnit, false) != UINT32_MAX;
+ bool in_cu_list = m_cu_spec_list.FindFileIndex(0, compUnit.GetPrimaryFile(),
+ false) != UINT32_MAX;
if (in_cu_list) {
ModuleSP module_sp(compUnit.GetModule());
if (module_sp) {
@@ -787,8 +790,9 @@ void SearchFilterByModuleListAndCU::Search(Searcher &searcher) {
CompUnitSP cu_sp = module_sp->GetCompileUnitAtIndex(cu_idx);
matchingContext.comp_unit = cu_sp.get();
if (matchingContext.comp_unit) {
- if (m_cu_spec_list.FindFileIndex(0, *matchingContext.comp_unit,
- false) != UINT32_MAX) {
+ if (m_cu_spec_list.FindFileIndex(
+ 0, matchingContext.comp_unit->GetPrimaryFile(), false) !=
+ UINT32_MAX) {
shouldContinue =
DoCUIteration(module_sp, matchingContext, searcher);
if (shouldContinue == Searcher::eCallbackReturnStop)
diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp
index 42741e4ba4f..e3780e0b071 100644
--- a/lldb/source/Core/SourceManager.cpp
+++ b/lldb/source/Core/SourceManager.cpp
@@ -399,24 +399,25 @@ void SourceManager::File::CommonInitializer(const FileSpec &file_spec,
if (num_matches != 0) {
if (num_matches > 1) {
SymbolContext sc;
- FileSpec *test_cu_spec = nullptr;
+ CompileUnit *test_cu = nullptr;
for (unsigned i = 0; i < num_matches; i++) {
sc_list.GetContextAtIndex(i, sc);
if (sc.comp_unit) {
- if (test_cu_spec) {
- if (test_cu_spec != static_cast<FileSpec *>(sc.comp_unit))
+ if (test_cu) {
+ if (test_cu != sc.comp_unit)
got_multiple = true;
break;
} else
- test_cu_spec = sc.comp_unit;
+ test_cu = sc.comp_unit;
}
}
}
if (!got_multiple) {
SymbolContext sc;
sc_list.GetContextAtIndex(0, sc);
- m_file_spec = sc.comp_unit;
+ if (sc.comp_unit)
+ m_file_spec = sc.comp_unit->GetPrimaryFile();
m_mod_time = FileSystem::Instance().GetModificationTime(m_file_spec);
}
}
OpenPOWER on IntegriCloud