summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Debugger.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-08-11 02:48:45 +0000
committerGreg Clayton <gclayton@apple.com>2011-08-11 02:48:45 +0000
commitaa149cbd863d1722f8e5263cac26b9c9f4461f57 (patch)
tree03b9bb36184a893d7fd5f3c44deb48f4046a28f9 /lldb/source/Core/Debugger.cpp
parent8e4c74bb7c515099d97a330c24a48126c3222a6d (diff)
downloadbcm5719-llvm-aa149cbd863d1722f8e5263cac26b9c9f4461f57.tar.gz
bcm5719-llvm-aa149cbd863d1722f8e5263cac26b9c9f4461f57.zip
Added the ability to remove orphaned module shared pointers from a ModuleList.
This is helping us track down some extra references to ModuleSP objects that are causing things to get kept around for too long. Added a module pointer accessor to target and change a lot of code to use it where it would be more efficient. "taret delete" can now specify "--clean=1" which will cleanup the global module list for any orphaned module in the shared module cache which can save memory and also help track down module reference leaks like we have now. llvm-svn: 137294
Diffstat (limited to 'lldb/source/Core/Debugger.cpp')
-rw-r--r--lldb/source/Core/Debugger.cpp8
1 files changed, 4 insertions, 4 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;
}
}
OpenPOWER on IntegriCloud