[Lldb-commits] [lldb] r125015 - in /lldb/trunk: include/lldb/Core/ArchSpec.h source/Host/common/Host.cpp

Greg Clayton gclayton at apple.com
Mon Feb 7 09:43:47 PST 2011


Author: gclayton
Date: Mon Feb  7 11:43:47 2011
New Revision: 125015

URL: http://llvm.org/viewvc/llvm-project?rev=125015&view=rev
Log:
Added a "ArchSpec::SetElfArch()" that was removed by a previous patch and
avoid using RTLD_FIRST with dlopen to keep things compatible with other *NIX
variants. Patch from Jai Menon.


Modified:
    lldb/trunk/include/lldb/Core/ArchSpec.h
    lldb/trunk/source/Host/common/Host.cpp

Modified: lldb/trunk/include/lldb/Core/ArchSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ArchSpec.h?rev=125015&r1=125014&r2=125015&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ArchSpec.h (original)
+++ lldb/trunk/include/lldb/Core/ArchSpec.h Mon Feb  7 11:43:47 2011
@@ -269,6 +269,14 @@
         m_sub = sub;
     }
 
+    void
+    SetElfArch (uint32_t cpu, uint32_t sub)
+    {
+        m_type = lldb::eArchTypeELF;
+        m_cpu = cpu;
+        m_sub = sub;
+    }
+
     //------------------------------------------------------------------
     /// Returns the default endianness of the architecture.
     ///

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=125015&r1=125014&r2=125015&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Mon Feb  7 11:43:47 2011
@@ -25,6 +25,8 @@
 #include <libproc.h>
 #include <mach-o/dyld.h>
 #include <sys/sysctl.h>
+#elif defined (__linux__)
+#include <sys/wait.h>
 #endif
 
 using namespace lldb;
@@ -243,7 +245,7 @@
             }
         }
 #elif defined (__linux__)
-        g_host_arch.SetArch(7u, 144u);
+        g_host_arch.SetElfArch(7u, 144u);
 #endif
     }
     return g_host_arch;
@@ -648,7 +650,11 @@
     char path[PATH_MAX];
     if (file_spec.GetPath(path, sizeof(path)))
     {
+#if defined (__linux__)
+        dynamic_library_handle = ::dlopen (path, RTLD_LAZY | RTLD_GLOBAL);
+#else
         dynamic_library_handle = ::dlopen (path, RTLD_LAZY | RTLD_GLOBAL | RTLD_FIRST);
+#endif
         if (dynamic_library_handle)
         {
             error.Clear();





More information about the lldb-commits mailing list