1 /* Register names and numbers for i386 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 #include "libebl_CPU.h"
40 i386_register_info (Ebl *ebl __attribute__ ((unused)),
41 int regno, char *name, size_t namelen,
42 const char **prefix, const char **setname,
48 if (regno < 0 || regno > 45 || namelen < 6)
53 *type = DW_ATE_unsigned;
58 *type = DW_ATE_signed;
77 *setname = "FPU-control";
86 static const char baseregs[][2] =
88 "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "ip"
94 *type = DW_ATE_address;
98 name[1] = baseregs[regno][0];
99 name[2] = baseregs[regno][1];
104 return stpcpy (name, "eflags") + 1 - name;
106 return stpcpy (name, "trapno") + 1 - name;
111 name[2] = regno - 11 + '0';
119 name[3] = regno - 21 + '0';
126 name[2] = regno - 29 + '0';
132 return stpcpy (name, "fctrl") + 1 - name;
135 return stpcpy (name, "fstat") + 1 - name;
137 return stpcpy (name, "mxcsr") + 1 - name;
140 name[0] = "ecsdfg"[regno - 40];
150 name[namelen++] = '\0';