[Lldb-commits] x86_32 linux support
Marco Minutoli
mminutoli at gmail.com
Sat Feb 26 06:09:45 PST 2011
Here is the patch with the changes you have requested.
Sorry for the duplicated header here It was late night(or maybe early
in the morning :D) when I sent the patch to the ML. Next time I'll be
more careful.
Best regards,
Marco
On Sat, Feb 26, 2011 at 1:25 AM, Stephen Wilson <wilsons at start.ca> wrote:
> 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;
>
--
Marco Minutoli
"If A is success in life, then A equals x plus y plus z. Work is x;
y is play; and z is keeping your mouth shut." --A. Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lldb-linux-i386.patch
Type: text/x-patch
Size: 23681 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20110226/293f8044/attachment.bin>
More information about the lldb-commits
mailing list