Hi,

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 201399) +++ source/Plugins/Process/POSIX/RegisterContextLinux_i386.cpp (working copy)
@@ -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 [20];
+};
+
 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?

thanks
Matt



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 
www.twitter.com/CSR_plc.
New for 2014, you can now access the wide range of products powered by aptX at 
www.aptx.com.
Index: source/Plugins/Process/POSIX/RegisterContextLinux_i386.cpp
===================================================================
--- source/Plugins/Process/POSIX/RegisterContextLinux_i386.cpp	(revision 201399)
+++ source/Plugins/Process/POSIX/RegisterContextLinux_i386.cpp	(working copy)
@@ -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 [20];
+};
+
 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.
_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Reply via email to