diff options
Diffstat (limited to 'lldb/source/Core')
-rw-r--r-- | lldb/source/Core/IOHandlerCursesGUI.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Core/Module.cpp | 20 | ||||
-rw-r--r-- | lldb/source/Core/SearchFilter.cpp | 9 | ||||
-rw-r--r-- | lldb/source/Core/SourceManager.cpp | 7 |
4 files changed, 12 insertions, 26 deletions
diff --git a/lldb/source/Core/IOHandlerCursesGUI.cpp b/lldb/source/Core/IOHandlerCursesGUI.cpp index 0c9fdd3b0a1..cb6fbaa99ea 100644 --- a/lldb/source/Core/IOHandlerCursesGUI.cpp +++ b/lldb/source/Core/IOHandlerCursesGUI.cpp @@ -3322,7 +3322,7 @@ public: if (context_changed) m_selected_line = m_pc_line; - if (m_file_sp && m_file_sp->FileSpecMatches(m_sc.line_entry.file)) { + if (m_file_sp && m_file_sp->GetFileSpec() == m_sc.line_entry.file) { // Same file, nothing to do, we should either have the lines or not // (source file missing) if (m_selected_line >= static_cast<size_t>(m_first_visible_line)) { diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index a8a92bb5b1f..cc4eea67417 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -613,12 +613,10 @@ void Module::FindCompileUnits(const FileSpec &path, const size_t num_compile_units = GetNumCompileUnits(); SymbolContext sc; sc.module_sp = shared_from_this(); - const bool compare_directory = (bool)path.GetDirectory(); 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->GetPrimaryFile(), path, - compare_directory)) + if (FileSpec::Match(path, sc.comp_unit->GetPrimaryFile())) sc_list.Append(sc); } } @@ -1561,19 +1559,13 @@ bool Module::MatchesModuleSpec(const ModuleSpec &module_ref) { } const FileSpec &file_spec = module_ref.GetFileSpec(); - if (file_spec) { - if (!FileSpec::Equal(file_spec, m_file, (bool)file_spec.GetDirectory()) && - !FileSpec::Equal(file_spec, m_platform_file, - (bool)file_spec.GetDirectory())) - return false; - } + if (!FileSpec::Match(file_spec, m_file) && + !FileSpec::Match(file_spec, m_platform_file)) + return false; const FileSpec &platform_file_spec = module_ref.GetPlatformFileSpec(); - if (platform_file_spec) { - if (!FileSpec::Equal(platform_file_spec, GetPlatformFileSpec(), - (bool)platform_file_spec.GetDirectory())) - return false; - } + if (!FileSpec::Match(platform_file_spec, GetPlatformFileSpec())) + return false; const ArchSpec &arch = module_ref.GetArchitecture(); if (arch.IsValid()) { diff --git a/lldb/source/Core/SearchFilter.cpp b/lldb/source/Core/SearchFilter.cpp index c49b59e601e..077aa896742 100644 --- a/lldb/source/Core/SearchFilter.cpp +++ b/lldb/source/Core/SearchFilter.cpp @@ -403,13 +403,11 @@ SearchFilterByModule::~SearchFilterByModule() = default; bool SearchFilterByModule::ModulePasses(const ModuleSP &module_sp) { return (module_sp && - FileSpec::Equal(module_sp->GetFileSpec(), m_module_spec, false)); + FileSpec::Match(m_module_spec, module_sp->GetFileSpec())); } bool SearchFilterByModule::ModulePasses(const FileSpec &spec) { - // Do a full match only if "spec" has a directory - const bool full_match = (bool)spec.GetDirectory(); - return FileSpec::Equal(spec, m_module_spec, full_match); + return FileSpec::Match(m_module_spec, spec); } bool SearchFilterByModule::AddressPasses(Address &address) { @@ -443,8 +441,7 @@ void SearchFilterByModule::Search(Searcher &searcher) { const size_t num_modules = target_modules.GetSize(); for (size_t i = 0; i < num_modules; i++) { Module *module = target_modules.GetModulePointerAtIndexUnlocked(i); - const bool full_match = (bool)m_module_spec.GetDirectory(); - if (FileSpec::Equal(m_module_spec, module->GetFileSpec(), full_match)) { + if (FileSpec::Match(m_module_spec, module->GetFileSpec())) { SymbolContext matchingContext(m_target_sp, module->shared_from_this()); Searcher::CallbackReturn shouldContinue; diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp index e3780e0b071..8e0cc57f80c 100644 --- a/lldb/source/Core/SourceManager.cpp +++ b/lldb/source/Core/SourceManager.cpp @@ -64,7 +64,8 @@ SourceManager::~SourceManager() {} SourceManager::FileSP SourceManager::GetFile(const FileSpec &file_spec) { bool same_as_previous = - m_last_file_sp && m_last_file_sp->FileSpecMatches(file_spec); + m_last_file_sp && + FileSpec::Match(file_spec, m_last_file_sp->GetFileSpec()); DebuggerSP debugger_sp(m_debugger_wp.lock()); FileSP file_sp; @@ -602,10 +603,6 @@ void SourceManager::File::FindLinesMatchingRegex( } } -bool SourceManager::File::FileSpecMatches(const FileSpec &file_spec) { - return FileSpec::Equal(m_file_spec, file_spec, false); -} - bool lldb_private::operator==(const SourceManager::File &lhs, const SourceManager::File &rhs) { if (lhs.m_file_spec != rhs.m_file_spec) |