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

llvm-svn: 271899
This commit is contained in:
Francis Ricci 2016-06-06 15:00:50 +00:00
parent 8448071d3e
commit 80dbd154fa
1 changed files with 3 additions and 4 deletions

View File

@ -4875,11 +4875,10 @@ ProcessGDBRemote::LoadModules (LoadedModuleInfoList &module_list)
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);
}
}