1 /* Register names and numbers for x86-64 DWARF.
2 Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
3 This file is part of Red Hat elfutils.
5 Red Hat elfutils is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by the
7 Free Software Foundation; version 2 of the License.
9 Red Hat elfutils is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License along
15 with Red Hat elfutils; if not, write to the Free Software Foundation,
16 Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
18 Red Hat elfutils is an included package of the Open Invention Network.
19 An included package of the Open Invention Network is a package for which
20 Open Invention Network licensees cross-license their patents. No patent
21 license is granted, either expressly or impliedly, by designation as an
22 included package. Should you wish to participate in the Open Invention
23 Network licensing program, please visit www.openinventionnetwork.com
24 <http://www.openinventionnetwork.com>. */
34 #define BACKEND x86_64_
35 #include "libebl_CPU.h"
38 x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
39 int regno, char *name, size_t namelen,
40 const char **prefix, const char **setname,
46 if (regno < 0 || regno > 66 || namelen < 7)
51 *type = DW_ATE_unsigned;
55 *type = DW_ATE_signed;
70 else if (regno > 49 && regno < 60)
80 static const char baseregs[][2] =
82 "ax", "dx", "cx", "bx", "si", "di", "bp", "sp"
86 *type = DW_ATE_address;
89 name[1] = baseregs[regno][0];
90 name[2] = baseregs[regno][1];
96 name[1] = regno - 8 + '8';
103 name[2] = regno - 10 + '0';
108 *type = DW_ATE_address;
119 name[3] = regno - 17 + '0';
128 name[4] = regno - 27 + '0';
135 name[2] = regno - 33 + '0';
142 name[2] = regno - 41 + '0';
147 name[0] = "ecsdfg"[regno - 50];
153 *type = DW_ATE_address;
155 name[0] = regno - 58 + 'f';
156 return stpcpy (&name[1], "s.base") + 1 - name;
159 *setname = "integer";
160 return stpcpy (name, "rflags") + 1 - name;
162 return stpcpy (name, "tr") + 1 - name;
164 return stpcpy (name, "ldtr") + 1 - name;
166 return stpcpy (name, "mxcsr") + 1 - name;
171 name[1] = "cs"[regno - 65];
180 name[namelen++] = '\0';