Re: [Lldb-commits] [PATCH] D20990: Don't remove PIE executables when using svr4 packets

2016-06-06 Thread Francis Ricci via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL271899: Don't remove PIE executables when using svr4 packets 
(authored by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D20990?vs=59637=59723#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20990

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
@@ -4875,11 +4875,10 @@
 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);
 }
 }
 


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
@@ -4875,11 +4875,10 @@
 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


Re: [Lldb-commits] [PATCH] D20990: Don't remove PIE executables when using svr4 packets

2016-06-04 Thread Stephane Sezer via lldb-commits
sas added a comment.

Nit: Adding a comment explaining why we special-case the main executable (i.e.: 
because it is never included in `libraries-svr4` packets) might be useful here.


http://reviews.llvm.org/D20990



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


Re: [Lldb-commits] [PATCH] D20990: Don't remove PIE executables when using svr4 packets

2016-06-04 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.
This revision is now accepted and ready to land.

LGTM.


http://reviews.llvm.org/D20990



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


Re: [Lldb-commits] [PATCH] D20990: Don't remove PIE executables when using svr4 packets

2016-06-03 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 59637.
fjricci added a comment.

Refactor to remove unnecessary object file type checking


http://reviews.llvm.org/D20990

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4875,11 +4875,9 @@
 found = true;
 }
 
-if (!found)
+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);
 }
 }
 


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4875,11 +4875,9 @@
 found = true;
 }
 
-if (!found)
+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


Re: [Lldb-commits] [PATCH] D20990: Don't remove PIE executables when using svr4 packets

2016-06-03 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 59633.
fjricci added a comment.

Fix curly-brace style


http://reviews.llvm.org/D20990

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4878,8 +4878,11 @@
 if (!found)
 {
 lldb_private::ObjectFile * obj = loaded_module->GetObjectFile 
();
-if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable)
+if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable &&
+loaded_module.get() != target.GetExecutableModulePointer())
+{
 removed_modules.Append (loaded_module);
+}
 }
 }
 


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4878,8 +4878,11 @@
 if (!found)
 {
 lldb_private::ObjectFile * obj = loaded_module->GetObjectFile ();
-if (obj && obj->GetType () != ObjectFile::Type::eTypeExecutable)
+if (obj && obj->GetType () != ObjectFile::Type::eTypeExecutable &&
+loaded_module.get() != target.GetExecutableModulePointer())
+{
 removed_modules.Append (loaded_module);
+}
 }
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D20990: Don't remove PIE executables when using svr4 packets

2016-06-03 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: clayborg, ADodds, tfiala.
fjricci added a subscriber: lldb-commits.

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.

http://reviews.llvm.org/D20990

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4878,8 +4878,10 @@
 if (!found)
 {
 lldb_private::ObjectFile * obj = loaded_module->GetObjectFile 
();
-if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable)
+if (obj && obj->GetType () != 
ObjectFile::Type::eTypeExecutable &&
+loaded_module.get() != 
target.GetExecutableModulePointer()) {
 removed_modules.Append (loaded_module);
+}
 }
 }
 


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4878,8 +4878,10 @@
 if (!found)
 {
 lldb_private::ObjectFile * obj = loaded_module->GetObjectFile ();
-if (obj && obj->GetType () != ObjectFile::Type::eTypeExecutable)
+if (obj && obj->GetType () != ObjectFile::Type::eTypeExecutable &&
+loaded_module.get() != target.GetExecutableModulePointer()) {
 removed_modules.Append (loaded_module);
+}
 }
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits