1 /* Register names and numbers for x86-64 DWARF.
2 Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
3 This file is part of elfutils.
5 This file is free software; you can redistribute it and/or modify
6 it under the terms of either
8 * the GNU Lesser General Public License as published by the Free
9 Software Foundation; either version 3 of the License, or (at
10 your option) any later version
14 * the GNU General Public License as published by the Free
15 Software Foundation; either version 2 of the License, or (at
16 your option) any later version
18 or both in parallel, as here.
20 elfutils is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
25 You should have received copies of the GNU General Public License and
26 the GNU Lesser General Public License along with this program. If
27 not, see <http://www.gnu.org/licenses/>. */
37 #define BACKEND x86_64_
38 #include "libebl_CPU.h"
41 x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
42 int regno, char *name, size_t namelen,
43 const char **prefix, const char **setname,
49 if (regno < 0 || regno > 66 || namelen < 7)
54 *type = DW_ATE_unsigned;
58 *type = DW_ATE_signed;
73 else if (regno > 49 && regno < 60)
83 static const char baseregs[][2] =
85 "ax", "dx", "cx", "bx", "si", "di", "bp", "sp"
89 *type = DW_ATE_address;
92 name[1] = baseregs[regno][0];
93 name[2] = baseregs[regno][1];
99 name[1] = regno - 8 + '8';
106 name[2] = regno - 10 + '0';
111 *type = DW_ATE_address;
122 name[3] = regno - 17 + '0';
131 name[4] = regno - 27 + '0';
138 name[2] = regno - 33 + '0';
145 name[2] = regno - 41 + '0';
150 name[0] = "ecsdfg"[regno - 50];
156 *type = DW_ATE_address;
158 name[0] = regno - 58 + 'f';
159 return stpcpy (&name[1], "s.base") + 1 - name;
162 *setname = "integer";
163 return stpcpy (name, "rflags") + 1 - name;
165 return stpcpy (name, "tr") + 1 - name;
167 return stpcpy (name, "ldtr") + 1 - name;
169 return stpcpy (name, "mxcsr") + 1 - name;
174 name[1] = "cs"[regno - 65];
183 name[namelen++] = '\0';