diff options
Diffstat (limited to 'lldb/source/Core')
-rw-r--r-- | lldb/source/Core/Debugger.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Core/ModuleList.cpp | 28 | ||||
-rw-r--r-- | lldb/source/Core/ValueObjectRegister.cpp | 4 |
3 files changed, 34 insertions, 6 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index 309afd4e87c..8d13293640e 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -1256,17 +1256,17 @@ Debugger::FormatPrompt (::strncmp (var_name_begin, "file.basename}", strlen("file.basename}")) == 0) || (::strncmp (var_name_begin, "file.fullpath}", strlen("file.fullpath}")) == 0)) { - ModuleSP exe_module_sp (exe_ctx->process->GetTarget().GetExecutableModule()); - if (exe_module_sp) + Module *exe_module = exe_ctx->process->GetTarget().GetExecutableModulePointer(); + if (exe_module) { if (var_name_begin[0] == 'n' || var_name_begin[5] == 'f') { - format_file_spec.GetFilename() = exe_module_sp->GetFileSpec().GetFilename(); + format_file_spec.GetFilename() = exe_module->GetFileSpec().GetFilename(); var_success = format_file_spec; } else { - format_file_spec = exe_module_sp->GetFileSpec(); + format_file_spec = exe_module->GetFileSpec(); var_success = format_file_spec; } } diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index 7a4748338e9..cf83d4b4476 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -108,6 +108,28 @@ ModuleList::Remove (ModuleSP &module_sp) return false; } + +size_t +ModuleList::RemoveOrphans () +{ + Mutex::Locker locker(m_modules_mutex); + collection::reverse_iterator pos = m_modules.rbegin(); + size_t remove_count = 0; + while (pos != m_modules.rend()) + { + if (pos->unique()) + { + pos = m_modules.erase (pos); + ++remove_count; + } + else + { + ++pos; + } + } + return remove_count; +} + size_t ModuleList::Remove (ModuleList &module_list) { @@ -680,6 +702,12 @@ ModuleList::FindSharedModules return shared_module_list.FindModules (&in_file_spec, &arch, uuid_ptr, object_name_ptr, matching_module_list); } +uint32_t +ModuleList::RemoveOrphanSharedModules () +{ + return GetSharedModuleList ().RemoveOrphans(); +} + Error ModuleList::GetSharedModule ( diff --git a/lldb/source/Core/ValueObjectRegister.cpp b/lldb/source/Core/ValueObjectRegister.cpp index db3d559efa3..beada802557 100644 --- a/lldb/source/Core/ValueObjectRegister.cpp +++ b/lldb/source/Core/ValueObjectRegister.cpp @@ -307,7 +307,7 @@ ValueObjectRegister::GetClangType () Process *process = m_reg_ctx_sp->CalculateProcess (); if (process) { - Module *exe_module = process->GetTarget().GetExecutableModule ().get(); + Module *exe_module = process->GetTarget().GetExecutableModulePointer(); if (exe_module) { m_clang_type = exe_module->GetClangASTContext().GetBuiltinTypeForEncodingAndBitSize (m_reg_info.encoding, @@ -338,7 +338,7 @@ ValueObjectRegister::GetClangAST () Process *process = m_reg_ctx_sp->CalculateProcess (); if (process) { - Module *exe_module = process->GetTarget().GetExecutableModule ().get(); + Module *exe_module = process->GetTarget().GetExecutableModulePointer(); if (exe_module) return exe_module->GetClangASTContext().getASTContext(); } |