[Lldb-commits] [lldb] r203205 - Only enable ProcessElfCore if this is an ELF file. Right now this plugin is winning over

Jason Molenda jmolenda at apple.com
Thu Mar 6 22:15:24 PST 2014


Author: jmolenda
Date: Fri Mar  7 00:15:24 2014
New Revision: 203205

URL: http://llvm.org/viewvc/llvm-project?rev=203205&view=rev
Log:
Only enable ProcessElfCore if this is an ELF file.  Right now this plugin is winning over
ProcessMachCore because it doesn't check the format of the file up front.  (this is only now
happening because of Greg's change in r203178 to build ProcessElfCore for non-Linux/FreeBSD
hosts).
<rdar://problem/16257533> 

Modified:
    lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp

Modified: lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp?rev=203205&r1=203204&r2=203205&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp Fri Mar  7 00:15:24 2014
@@ -70,9 +70,13 @@ ProcessElfCore::CanDebug(Target &target,
                                                   NULL, NULL, NULL));
         if (m_core_module_sp)
         {
-            ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
-            if (core_objfile && core_objfile->GetType() == ObjectFile::eTypeCoreFile)
-                return true;
+            const llvm::Triple &triple_ref = m_core_module_sp->GetArchitecture().GetTriple();
+            if (triple_ref.getEnvironment() == llvm::Triple::ELF)
+            {
+                ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
+                if (core_objfile && core_objfile->GetType() == ObjectFile::eTypeCoreFile)
+                    return true;
+            }
         }
     }
     return false;





More information about the lldb-commits mailing list