From 80dbd154fac43908c3501ab847cb2d4ff69a1359 Mon Sep 17 00:00:00 2001 From: Francis Ricci Date: Mon, 6 Jun 2016 15:00:50 +0000 Subject: 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 --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 53bf9f6..60dbcb29 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -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); } } -- cgit v1.1