summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
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/Plugins/Process
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/Plugins/Process')
-rw-r--r--lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp6
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
index 5d4f465e2f4..401fd9a48f9 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
@@ -59,14 +59,14 @@ bool
ProcessKDP::CanDebug(Target &target, bool plugin_specified_by_name)
{
// For now we are just making sure the file exists for a given module
- ModuleSP exe_module_sp(target.GetExecutableModule());
- if (exe_module_sp.get())
+ Module *exe_module = target.GetExecutableModulePointer();
+ if (exe_module)
{
const llvm::Triple &triple_ref = target.GetArchitecture().GetTriple();
if (triple_ref.getOS() == llvm::Triple::Darwin &&
triple_ref.getVendor() == llvm::Triple::Apple)
{
- ObjectFile *exe_objfile = exe_module_sp->GetObjectFile();
+ ObjectFile *exe_objfile = exe_module->GetObjectFile();
if (exe_objfile->GetType() == ObjectFile::eTypeExecutable &&
exe_objfile->GetStrata() == ObjectFile::eStrataKernel)
return true;
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 63967148cb5..558a02aeaae 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -104,9 +104,9 @@ bool
ProcessGDBRemote::CanDebug (Target &target, bool plugin_specified_by_name)
{
// For now we are just making sure the file exists for a given module
- ModuleSP exe_module_sp(target.GetExecutableModule());
- if (exe_module_sp.get())
- return exe_module_sp->GetFileSpec().Exists();
+ Module *exe_module = target.GetExecutableModulePointer();
+ if (exe_module)
+ return exe_module->GetFileSpec().Exists();
// However, if there is no executable module, we return true since we might be preparing to attach.
return true;
}
OpenPOWER on IntegriCloud