[lldb-dev] [PATCH] Incorrect register map for Linux 32-bit - Correction supplied
tfiala at google.com
Fri Feb 14 08:59:19 PST 2014
I'll have a look at it.
This is essentially what I was driving towards last night, which was that
our duplicated version of the truth in sys/user.h was incorrect.
I'll give this a run now on my end. If it works, I will probably also
check it in with some other minor changes I made to logging, and an assert
I put in for ensuring our custom structure size matches the sys/user.h
Later I'd suggest we go back and rewrite that code in terms of the official
structures for a given platform.
On Fri, Feb 14, 2014 at 3:39 AM, Matthew Gardiner <mg11 at csr.com> wrote:
> The register map in RegisterContextLinux_i386.cpp is in disagreement with
> that seen in /usr/include/sys/user.h. The result is that offset
> calculations for the dr0-dr7 are incorrect. I've had a look at the source
> and determined that this can't be fixed portably (i.e. for 32/64-bit) with:
> FXSAVE i387;
> since FXSAVE deploys a union and thus the size of the struct would be the
> same in either architecture, which would be undesirable. I have fixed this
> on my system with:
> Index: source/Plugins/Process/POSIX/RegisterContextLinux_i386.cpp
> --- source/Plugins/Process/POSIX/RegisterContextLinux_i386.cpp (revision
> +++ source/Plugins/Process/POSIX/RegisterContextLinux_i386.cpp (working
> @@ -34,11 +34,23 @@
> uint32_t ss;
> +struct FPR_i386
> + long int cwd;
> + long int swd;
> + long int twd;
> + long int fip;
> + long int fcs;
> + long int foo;
> + long int fos;
> + long int st_space ;
> struct UserArea
> GPR regs; // General purpose registers.
> int32_t fpvalid; // True if FPU is being used.
> - FXSAVE i387; // FPU registers.
> + FPR_i386 i387; // FPU registers.
> uint32_t tsize; // Text segment size.
> uint32_t dsize; // Data segment size.
> uint32_t ssize; // Stack segment size.
> That is, by repetition of the linux FPR area within the lldb codebase. (I
> could not use the more obvious FPR as my struct name, as it collided with a
> previous use of the name).
> Would someone be able to view/consider/submit my patch?
> Member of the CSR plc group of companies. CSR plc registered in England
> and Wales, registered number 4187346, registered office Churchill House,
> Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
> More information can be found at www.csr.com. Keep up to date with CSR on
> our technical blog, www.csr.com/blog, CSR people blog, www.csr.com/people,
> YouTube, www.youtube.com/user/CSRplc, Facebook,
> www.facebook.com/pages/CSR/191038434253534, or follow us on Twitter at
> New for 2014, you can now access the wide range of products powered by
> aptX at www.aptx.com.
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
Todd Fiala | Software Engineer | tfiala at google.com | 650-943-3180
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lldb-dev