summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ModuleList.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-08-10 02:10:13 +0000
committerGreg Clayton <gclayton@apple.com>2011-08-10 02:10:13 +0000
commit3418c8577110605f5322571867897c1912f32a8e (patch)
treec4a4b99fcb56c7d9a725c95d9238673172b23008 /lldb/source/Core/ModuleList.cpp
parent78b40c3f3aa754fdd0bca361a6a5c589a87665d6 (diff)
downloadbcm5719-llvm-3418c8577110605f5322571867897c1912f32a8e.tar.gz
bcm5719-llvm-3418c8577110605f5322571867897c1912f32a8e.zip
While tracking down memory consumption issue a few things were needed: the
ability to dump more information about modules in "target modules list". We can now dump the shared pointer reference count for modules, the pointer to the module itself (in case performance tools can help track down who has references to said pointer), and the modification time. Added "target delete [target-idx ...]" to be able to delete targets when they are no longer needed. This will help track down memory usage issues and help to resolve when module ref counts keep getting incremented. If the command gets no arguments, the currently selected target will be deleted. If any arguments are given, they must all be valid target indexes (use the "target list" command to get the current target indexes). Took care of a bunch of "no newline at end of file" warnings. TimeValue objects can now dump their time to a lldb_private::Stream object. Modified the "target modules list --global" command to not error out if there are no targets since it doesn't require a target. Fixed an issue in the MacOSX DYLD dynamic loader plug-in where if a shared library was updated on disk, we would keep using the older one, even if it was updated. Don't allow the ModuleList::GetSharedModule(...) to return an empty module. Previously we could specify a valid path on disc to a module, and specify an architecture that wasn't contained in that module and get a shared pointer to a module that wouldn't be able to return an object file or a symbol file. We now make sure an object file can be extracted prior to adding the shared pointer to the module to get added to the shared list. llvm-svn: 137196
Diffstat (limited to 'lldb/source/Core/ModuleList.cpp')
-rw-r--r--lldb/source/Core/ModuleList.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index d27b30eabfa..7a4748338e9 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -756,7 +756,10 @@ ModuleList::GetSharedModule
else
{
module_sp.reset (new Module (in_file_spec, arch, object_name_ptr, object_offset));
- if (module_sp)
+ // Make sure there are a module and an object file since we can specify
+ // a valid file path with an architecture that might not be in that file.
+ // By getting the object file we can guarantee that the architecture matches
+ if (module_sp && module_sp->GetObjectFile())
{
// If we get in here we got the correct arch, now we just need
// to verify the UUID if one was given
@@ -766,7 +769,7 @@ ModuleList::GetSharedModule
{
if (did_create_ptr)
*did_create_ptr = true;
-
+
shared_module_list.Append(module_sp);
return error;
}
@@ -844,7 +847,10 @@ ModuleList::GetSharedModule
if (module_sp.get() == NULL)
{
module_sp.reset (new Module (file_spec, arch, object_name_ptr, object_offset));
- if (module_sp)
+ // Make sure there are a module and an object file since we can specify
+ // a valid file path with an architecture that might not be in that file.
+ // By getting the object file we can guarantee that the architecture matches
+ if (module_sp && module_sp->GetObjectFile())
{
if (did_create_ptr)
*did_create_ptr = true;
OpenPOWER on IntegriCloud