[Lldb-commits] x86_32 linux support

Stephen Wilson wilsons at start.ca
Fri Feb 25 16:25:55 PST 2011


On Fri, Feb 25, 2011 at 02:52:51AM +0100, Marco Minutoli wrote:
> Hi everybody,
> 
> as suggested by Stephen I had a look at the user_32.h Linux header and
> I fixed the UserArea structure.
> 
> In the attachment the revised patch. As ever comments and suggestions
> are welcome :).

This looks good.  Only two small issues:  the patch for
RegisterContextLinux_i386.h contains the old and new versions of your
patch (the latter is protected behind an #ifndef).   Also, I think we
need the following patch for LinuxThread.cpp:  Use a register context
according to the host instead of the process target so we can debug and
test lldb using 32-bit binaries on 64-bit systems.

I have not been able to test your patch much yet -- another issue has
crept into the linux builds that I need to track down first... but with
those changes I think the patches can go in.   



Thanks again!


diff --git a/source/Plugins/Process/Linux/LinuxThread.cpp b/source/Plugins/Process/Linux/LinuxThread.cpp
index 397d31b..15bc9e3 100644
--- a/source/Plugins/Process/Linux/LinuxThread.cpp
+++ b/source/Plugins/Process/Linux/LinuxThread.cpp
@@ -12,6 +12,7 @@
 
 // C++ Includes
 // Other libraries and framework includes
+#include "lldb/Host/Host.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/StopInfo.h"
 #include "lldb/Target/Target.h"
@@ -19,6 +20,7 @@
 #include "LinuxThread.h"
 #include "ProcessLinux.h"
 #include "ProcessMonitor.h"
+#include "RegisterContextLinux_i386.h"
 #include "RegisterContextLinux_x86_64.h"
 #include "UnwindLLDB.h"
 
@@ -59,11 +61,9 @@ LinuxThread::GetInfo()
 lldb::RegisterContextSP
 LinuxThread::GetRegisterContext()
 {
-    ProcessLinux &process = static_cast<ProcessLinux&>(GetProcess());
-
     if (!m_reg_context_sp)
     {
-        ArchSpec arch = process.GetTarget().GetArchitecture();
+        ArchSpec arch = Host::GetArchitecture();
 
         switch (arch.GetCore())
         {
@@ -71,6 +71,12 @@ LinuxThread::GetRegisterContext()
             assert(false && "CPU type not supported!");
             break;
 
+        case ArchSpec::eCore_x86_32_i386:
+        case ArchSpec::eCore_x86_32_i486:
+        case ArchSpec::eCore_x86_32_i486sx:
+            m_reg_context_sp.reset(new RegisterContextLinux_i386(*this, 0));
+            break;
+
         case ArchSpec::eCore_x86_64_x86_64:
             m_reg_context_sp.reset(new RegisterContextLinux_x86_64(*this, 0));
             break;



More information about the lldb-commits mailing list