Hello,

Patch 1 squashes these fixes into a single diff
- r124942 removed a sys/wait.h inclusion. This is incorrect for Linux.

- SetArch was removed which breaks the build on Linux.

- Linux doesn't support RTLD_FIRST so apply that mode conditionally.

Patch 2 fixes a missing include.

On an unrelated note, is there a git mirror of lldb? Would patches
created with git be okay?

-- 
Jai Menon
Index: include/lldb/Core/ArchSpec.h
===================================================================
--- include/lldb/Core/ArchSpec.h	(revision 124972)
+++ include/lldb/Core/ArchSpec.h	(working copy)
@@ -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.
     ///
Index: source/Host/common/Host.cpp
===================================================================
--- source/Host/common/Host.cpp	(revision 124972)
+++ source/Host/common/Host.cpp	(working copy)
@@ -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();
Index: source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp
===================================================================
--- source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp	(revision 124972)
+++ source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp	(working copy)
@@ -14,6 +14,7 @@
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Host/Endian.h"
 
 #include "ProcessLinux.h"
 #include "ProcessMonitor.h"
@@ -500,7 +501,7 @@
     }
 
     if (status)
-        data.SetData(buf + GetRegOffset(reg), GetRegSize(reg), endian::InlHostByteOrder());
+        data.SetData(buf + GetRegOffset(reg), GetRegSize(reg), lldb::endian::InlHostByteOrder());
 
     return status;
 }
_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Reply via email to