[lldb-dev] register read on 32-bit Linux

Michael Sartain mikesart at gmail.com
Mon Aug 26 12:05:38 PDT 2013


>
> An eventual goal is to abstract a dynamic register set that can be used
> consistently for native local and remote debugging in a
> platform-independent manner.  Also, for core file support across platforms,
> we’ll want a register set hierarchy that is distinct from platform
> dependencies like ProcessMonitor.


Does it make sense for me to tackle this right now instead of making what I
assume would be temporary fixes to RegisterContext_x86_64? I assume doing
the larger correct fix would take care of Greg's other concerns as well?
Ie, this: “The DWARF and GCC register numbers need to use the i386 register
numbering schemes otherwise all info parsed from EH frame and DWARF will be
incorrect when they don't match up. – Greg Clayton”.

Greg provided a skeleton patch for this purpose on the lists.


Does anyone have a pointer to this? I poked around a bit didn't find it.

For what it's worth, our most common use case is 64-bit build of LLDB
debugging i386 targets with some debugging of 64-bit apps using a 64-bit
LLDB build. (Ie, debugging lldb with lldb).

Thanks.
 -Mike

On Fri, Aug 23, 2013 at 7:59 AM, Thirumurthi, Ashok <
ashok.thirumurthi at intel.com> wrote:

>  Go for it, Michael!****
>
> ** **
>
> FYI, the x86_64 build of LLDB will have limited success with i386
> inferiors, but it’s a pretty good starting point (i.e.
> test/functionalities/registers passes).  In this case, ptrace calls
> populate the 64-bit register set, and the RegisterContext_x86_64 class uses
> offsetof to associate the i386 register set with the LS bytes of the
> associated 64-bit registers.  However, this isn’t correct because “The
> DWARF and GCC register numbers need to use the i386 register numbering
> schemes otherwise all info parsed from EH frame and DWARF will be incorrect
> when they don't match up. – Greg Clayton”.****
>
> ** **
>
> The i386 build of LLDB should use RegisterContext_i386.  Similarly, a
> future remote i386 target should use RegisterContext_i386.  However, this
> class is just stubbed in.  ****
>
> ** **
>
> An eventual goal is to abstract a dynamic register set that can be used
> consistently for native local and remote debugging in a
> platform-independent manner.  Also, for core file support across platforms,
> we’ll want a register set hierarchy that is distinct from platform
> dependencies like ProcessMonitor.  This was implemented for MachO, and Greg
> provided a skeleton patch for this purpose on the lists.  Cheers,****
>
> ** **
>
> **-        **Ashok****
>
> ** **
>
> *From:* lldb-dev-bounces at cs.uiuc.edu [mailto:lldb-dev-bounces at cs.uiuc.edu]
> *On Behalf Of *Michael Sartain
> *Sent:* Friday, August 23, 2013 12:49 AM
> *To:* lldb-dev at cs.uiuc.edu
> *Subject:* [lldb-dev] register read on 32-bit Linux****
>
> ** **
>
> This is currently calling into the POSIX RegisterContext_x86_64 and
> returning all the 64-bit registers.****
>
> ** **
>
> I'm guessing this is known already. Curious if someone is already working
> on this or has a plan for fixing it before I jump in?****
>
> ** **
>
> Thanks!****
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130826/dcd4206f/attachment.html>


More information about the lldb-dev mailing list