[Lldb-commits] [PATCH] D19230: Properly unload modules from target image list when using svr4 packets
Francis Ricci via lldb-commits
lldb-commits at lists.llvm.org
Mon Apr 25 14:08:14 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL267467: Properly unload modules from target image list when using svr4 packets (authored by fjricci).
Changed prior to commit:
http://reviews.llvm.org/D19230?vs=54083&id=54902#toc
Repository:
rL LLVM
http://reviews.llvm.org/D19230
Files:
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4879,7 +4879,31 @@
if (new_modules.GetSize() > 0)
{
+ ModuleList removed_modules;
Target &target = GetTarget();
+ ModuleList &loaded_modules = m_process->GetTarget().GetImages();
+
+ for (size_t i = 0; i < loaded_modules.GetSize(); ++i)
+ {
+ const lldb::ModuleSP loaded_module = loaded_modules.GetModuleAtIndex(i);
+
+ bool found = false;
+ for (size_t j = 0; j < new_modules.GetSize(); ++j)
+ {
+ if (new_modules.GetModuleAtIndex(j).get() == loaded_module.get())
+ found = true;
+ }
+
+ if (!found)
+ {
+ lldb_private::ObjectFile * obj = loaded_module->GetObjectFile ();
+ if (obj && obj->GetType () != ObjectFile::Type::eTypeExecutable)
+ removed_modules.Append (loaded_module);
+ }
+ }
+
+ loaded_modules.Remove (removed_modules);
+ m_process->GetTarget().ModulesDidUnload (removed_modules, false);
new_modules.ForEach ([&target](const lldb::ModuleSP module_sp) -> bool
{
@@ -4895,13 +4919,11 @@
return false;
});
- ModuleList &loaded_modules = m_process->GetTarget().GetImages();
loaded_modules.AppendIfNeeded (new_modules);
m_process->GetTarget().ModulesDidLoad (new_modules);
}
return new_modules.GetSize();
-
}
size_t
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19230.54902.patch
Type: text/x-patch
Size: 1737 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160425/2dbf08fd/attachment.bin>
More information about the lldb-commits
mailing list