]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
backends/
authorRoland McGrath <roland@redhat.com>
Sun, 1 Apr 2007 23:11:40 +0000 (23:11 +0000)
committerRoland McGrath <roland@redhat.com>
Sun, 1 Apr 2007 23:11:40 +0000 (23:11 +0000)
2007-04-01  Roland McGrath  <roland@redhat.com>

* x86_64_regs.c (x86_64_register_info): Add more registers from newer
ABI spec.

tests/
2007-04-01  Roland McGrath  <roland@redhat.com>

* run-allregs.sh: Updated expected output for x86_64.

backends/ChangeLog
backends/x86_64_regs.c
tests/ChangeLog
tests/run-allregs.sh

index 57f33608b4efb005f7f01e20a28244ffbc3400ca..e9f34158291ba6bbb7cf5d7970ae584910536173 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-01  Roland McGrath  <roland@redhat.com>
+
+       * x86_64_regs.c (x86_64_register_info): Add more registers from newer
+       ABI spec.
+
 2007-01-11  Roland McGrath  <roland@redhat.com>
 
        * ia64_symbol.c (ia64_machine_section_flag_check): New function.
index 1128a352130c77cc36095daebec23d175ba85b94..c17af85ed56695de83a7c38b54c17a5b04daa920 100644 (file)
@@ -1,5 +1,5 @@
 /* Register names and numbers for x86-64 DWARF.
-   Copyright (C) 2005, 2006 Red Hat, Inc.
+   Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -29,6 +29,7 @@
 
 #include <assert.h>
 #include <dwarf.h>
+#include <string.h>
 
 #define BACKEND x86_64_
 #include "libebl_CPU.h"
@@ -40,9 +41,9 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
                      int *bits, int *type)
 {
   if (name == NULL)
-    return 49;
+    return 67;
 
-  if (regno < 0 || regno > 48 || namelen < 6)
+  if (regno < 0 || regno > 66 || namelen < 7)
     return -1;
 
   *prefix = "%";
@@ -51,10 +52,7 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
   if (regno < 17)
     {
       *setname = "integer";
-      if (regno == 16 || regno == 6 || regno == 7)
-       *type = DW_ATE_address;
-      else
-       *type = DW_ATE_signed;
+      *type = DW_ATE_signed;
     }
   else if (regno < 33)
     {
@@ -67,11 +65,15 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
       *type = DW_ATE_float;
       *bits = 80;
     }
-  else
+  else if (regno < 49)
+    *setname = "MMX";
+  else if (regno > 49 && regno < 60)
     {
-      *setname = "MMX";
-      *bits = 64;
+      *setname = "segment";
+      *bits = 16;
     }
+  else
+    *setname = "control";
 
   switch (regno)
     {
@@ -80,7 +82,9 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
          "ax", "dx", "cx", "bx", "si", "di", "bp", "sp"
        };
 
-    case 0 ... 7:
+    case 6 ... 7:
+      *type = DW_ATE_address;
+    case 0 ... 5:
       name[0] = 'r';
       name[1] = baseregs[regno][0];
       name[2] = baseregs[regno][1];
@@ -101,6 +105,7 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
       break;
 
     case 16:
+      *type = DW_ATE_address;
       name[0] = 'r';
       name[1] = 'i';
       name[2] = 'p';
@@ -137,6 +142,37 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
       name[2] = regno - 41 + '0';
       namelen = 3;
       break;
+
+    case 50 ... 55:
+      name[0] = "ecsdfg"[regno - 50];
+      name[1] = 's';
+      namelen = 2;
+      break;
+
+    case 58 ... 59:
+      *type = DW_ATE_address;
+      *bits = 64;
+      name[0] = regno - 58 + 'f';
+      return stpcpy (&name[1], "s.base") + 1 - name;
+
+    case 49:
+      return stpcpy (name, "rflags") + 1 - name;
+    case 62:
+      return stpcpy (name, "tr") + 1 - name;
+    case 63:
+      return stpcpy (name, "ldtr") + 1 - name;
+    case 64:
+      return stpcpy (name, "mxcsr") + 1 - name;
+
+    case 65 ... 66:
+      name[0] = 'f';
+      name[1] = "cs"[regno - 65];
+      name[2] = 'w';
+      namelen = 3;
+      break;
+
+    default:
+      return 0;
     }
 
   name[namelen++] = '\0';
index 770f33751b38015e915465079f331d3121c4e0a4..f57c6e10f4f4c52a6f187d6ab6b8250dbae21728 100644 (file)
@@ -1,3 +1,7 @@
+2007-04-01  Roland McGrath  <roland@redhat.com>
+
+       * run-allregs.sh: Updated expected output for x86_64.
+
 2007-03-04  Roland McGrath  <roland@redhat.com>
 
        * dwfl-bug-fd-leak.c: New file.
index 46503f20a2aa052ebdf526c87d4263522eca9572..bf2be9ebc74731ec2267733eae0f4d22776d8b75 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2005, 2006 Red Hat, Inc.
+# Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
 # This file is part of Red Hat elfutils.
 #
 # Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -132,6 +132,22 @@ SSE registers:
         30: %xmm13 (xmm13), unsigned 128 bits
         31: %xmm14 (xmm14), unsigned 128 bits
         32: %xmm15 (xmm15), unsigned 128 bits
+control registers:
+        49: %rflags (rflags), unsigned 64 bits
+        62: %tr (tr), unsigned 64 bits
+        63: %ldtr (ldtr), unsigned 64 bits
+        64: %mxcsr (mxcsr), unsigned 64 bits
+        65: %fcw (fcw), unsigned 64 bits
+        66: %fsw (fsw), unsigned 64 bits
+segment registers:
+        50: %es (es), unsigned 16 bits
+        51: %cs (cs), unsigned 16 bits
+        52: %ss (ss), unsigned 16 bits
+        53: %ds (ds), unsigned 16 bits
+        54: %fs (fs), unsigned 16 bits
+        55: %gs (gs), unsigned 16 bits
+        58: %fs.base (fs.base), address 64 bits
+        59: %gs.base (gs.base), address 64 bits
 x87 registers:
         33: %st0 (st0), float 80 bits
         34: %st1 (st1), float 80 bits