Author: fjricci
Date: Mon Jun  6 10:00:50 2016
New Revision: 271899

URL: http://llvm.org/viewvc/llvm-project?rev=271899&view=rev
Log:
Don't remove PIE executables when using svr4 packets

Summary:
Because PIE executables have an e_type of llvm::ELF::ET_DYN,
they are not of type eTypeExecutable, and were being removed
when svr4 packets were used.

Reviewers: clayborg, ADodds, tfiala, sas

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D20990

Modified:
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=271899&r1=271898&r2=271899&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Mon Jun  
6 10:00:50 2016
@@ -4875,11 +4875,10 @@ ProcessGDBRemote::LoadModules (LoadedMod
                     found = true;
             }
 
-            if (!found)
+            // The main executable will never be included in libraries-svr4, 
don't remove it
+            if (!found && loaded_module.get() != 
target.GetExecutableModulePointer())
             {
-                lldb_private::ObjectFile * obj = loaded_module->GetObjectFile 
();
-                if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable)
-                    removed_modules.Append (loaded_module);
+                removed_modules.Append (loaded_module);
             }
         }
 


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to