On Tue, May 24, 2011 at 9:08 AM, Ariel Burton
<ariel.bur...@roguewave.com> wrote:
> Thanks for the prompt reply.
>
> Yes, that's what the compiler is doing.  Here's the
> assembler for the prologue of f_ms_abi:

Can you try the attached?

Lassi/Paul: could you comment if you experience any slowdown on real
world programs? Lperf-trace seems to be happy.

 -Arun
From 3567c6474e9c655267dbadac4b1ae3d4b5ddf1fe Mon Sep 17 00:00:00 2001
From: Arun Sharma <asha...@fb.com>
Date: Thu, 26 May 2011 09:15:19 -0700
Subject: [PATCH] Handle register nums > 16 on x86_64

gcc generates them when using ms-abi for example and readelf knows
about them.
---
 include/libunwind-x86_64.h         |   18 +++++++++++++++++-
 include/tdep-x86_64/dwarf-config.h |    4 ++--
 src/x86_64/Gglobal.c               |   20 ++++++++++++++++++--
 3 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/include/libunwind-x86_64.h b/include/libunwind-x86_64.h
index 50b4de2..78678ea 100644
--- a/include/libunwind-x86_64.h
+++ b/include/libunwind-x86_64.h
@@ -72,13 +72,29 @@ typedef enum
     UNW_X86_64_R14,
     UNW_X86_64_R15,
     UNW_X86_64_RIP,
+    UNW_X86_64_XMM0,
+    UNW_X86_64_XMM1,
+    UNW_X86_64_XMM2,
+    UNW_X86_64_XMM3,
+    UNW_X86_64_XMM4,
+    UNW_X86_64_XMM5,
+    UNW_X86_64_XMM6,
+    UNW_X86_64_XMM7,
+    UNW_X86_64_XMM8,
+    UNW_X86_64_XMM9,
+    UNW_X86_64_XMM10,
+    UNW_X86_64_XMM11,
+    UNW_X86_64_XMM12,
+    UNW_X86_64_XMM13,
+    UNW_X86_64_XMM14,
+    UNW_X86_64_XMM15,
 
     /* XXX Add other regs here */
 
     /* frame info (read-only) */
     UNW_X86_64_CFA,
 
-    UNW_TDEP_LAST_REG = UNW_X86_64_RIP,
+    UNW_TDEP_LAST_REG = UNW_X86_64_XMM15,
 
     UNW_TDEP_IP = UNW_X86_64_RIP,
     UNW_TDEP_SP = UNW_X86_64_RSP,
diff --git a/include/tdep-x86_64/dwarf-config.h b/include/tdep-x86_64/dwarf-config.h
index 8023f36..22a0312 100644
--- a/include/tdep-x86_64/dwarf-config.h
+++ b/include/tdep-x86_64/dwarf-config.h
@@ -32,9 +32,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
 #define dwarf_config_h
 
 /* XXX need to verify if this value is correct */
-#define DWARF_NUM_PRESERVED_REGS	17
+#define DWARF_NUM_PRESERVED_REGS	33
 
-#define DWARF_REGNUM_MAP_LENGTH		17
+#define DWARF_REGNUM_MAP_LENGTH		33
 
 /* Return TRUE if the ADDR_SPACE uses big-endian byte-order.  */
 #define dwarf_is_big_endian(addr_space)	0
diff --git a/src/x86_64/Gglobal.c b/src/x86_64/Gglobal.c
index 8decf32..ae08df3 100644
--- a/src/x86_64/Gglobal.c
+++ b/src/x86_64/Gglobal.c
@@ -33,7 +33,7 @@ HIDDEN int tdep_needs_initialization = 1;
 
 /* See comments for svr4_dbx_register_map[] in gcc/config/i386/i386.c.  */
 
-HIDDEN uint8_t dwarf_to_unw_regnum_map[17] =
+HIDDEN uint8_t dwarf_to_unw_regnum_map[DWARF_NUM_PRESERVED_REGS] =
   {
     UNW_X86_64_RAX,
     UNW_X86_64_RDX,
@@ -51,7 +51,23 @@ HIDDEN uint8_t dwarf_to_unw_regnum_map[17] =
     UNW_X86_64_R13,
     UNW_X86_64_R14,
     UNW_X86_64_R15,
-    UNW_X86_64_RIP
+    UNW_X86_64_RIP,
+    UNW_X86_64_XMM0,
+    UNW_X86_64_XMM1,
+    UNW_X86_64_XMM2,
+    UNW_X86_64_XMM3,
+    UNW_X86_64_XMM4,
+    UNW_X86_64_XMM5,
+    UNW_X86_64_XMM6,
+    UNW_X86_64_XMM7,
+    UNW_X86_64_XMM8,
+    UNW_X86_64_XMM9,
+    UNW_X86_64_XMM10,
+    UNW_X86_64_XMM11,
+    UNW_X86_64_XMM12,
+    UNW_X86_64_XMM13,
+    UNW_X86_64_XMM14,
+    UNW_X86_64_XMM15
   };
 
 HIDDEN void
-- 
1.7.4.1

_______________________________________________
Libunwind-devel mailing list
Libunwind-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to