Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
include
arch_x86_64.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2014 The University of Utah
3
*
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; either version 2 of
7
* the License, or (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
17
*/
18
19
#ifndef __ARCH_X86_64_H__
20
#define __ARCH_X86_64_H__
21
22
extern
struct
arch
arch_x86_64
;
23
24
/*
25
* NB: we specifically don't support
26
*/
27
28
/*
29
* The register mapping between x86_64 registers is defined by AMD in
30
* http://www.x86-64.org/documentation/abi-0.99.pdf :
31
*/
32
33
#define ARCH_X86_64_REG_COUNT 89
34
35
/* 64-bit GP regs. */
36
#define REG_X86_64_RAX 0
37
#define REG_X86_64_RDX 1
38
#define REG_X86_64_RCX 2
39
#define REG_X86_64_RBX 3
40
#define REG_X86_64_RSI 4
41
#define REG_X86_64_RDI 5
42
#define REG_X86_64_RBP 6
43
#define REG_X86_64_RSP 7
44
#define REG_X86_64_R8 8
45
#define REG_X86_64_R9 9
46
#define REG_X86_64_R10 10
47
#define REG_X86_64_R11 11
48
#define REG_X86_64_R12 12
49
#define REG_X86_64_R13 13
50
#define REG_X86_64_R14 14
51
#define REG_X86_64_R15 15
52
53
/* Special DWARF reg for getting the RA; we overload it for RIP */
54
#define REG_X86_64_RIP 16
55
56
/*
57
* The SIMD instructions. They were 128-bit SSE regs (xmm); 256-bit AVX
58
* regs (ymm); and finally now 512-bit AVX-512 regs (zmm).
59
*
60
* XXX: I don't have DWARF numbers for zmm16-31. Technically I don't
61
* think DWARF does either :). Whatever, we're not supporting vector
62
* nor FP regs.
63
*/
64
#define REG_X86_64_XMM0 17
65
#define REG_X86_64_XMM1 18
66
#define REG_X86_64_XMM2 19
67
#define REG_X86_64_XMM3 20
68
#define REG_X86_64_XMM4 21
69
#define REG_X86_64_XMM5 22
70
#define REG_X86_64_XMM6 23
71
#define REG_X86_64_XMM7 24
72
#define REG_X86_64_XMM8 25
73
#define REG_X86_64_XMM9 26
74
#define REG_X86_64_XMM10 27
75
#define REG_X86_64_XMM11 28
76
#define REG_X86_64_XMM12 29
77
#define REG_X86_64_XMM13 30
78
#define REG_X86_64_XMM14 31
79
#define REG_X86_64_XMM15 32
80
81
/* 80-bit FP regs. */
82
#define REG_X86_64_ST0 33
83
#define REG_X86_64_ST1 34
84
#define REG_X86_64_ST2 35
85
#define REG_X86_64_ST3 36
86
#define REG_X86_64_ST4 37
87
#define REG_X86_64_ST5 38
88
#define REG_X86_64_ST6 39
89
#define REG_X86_64_ST7 40
90
91
#define REG_X86_64_MM0 41
92
#define REG_X86_64_MM1 42
93
#define REG_X86_64_MM2 43
94
#define REG_X86_64_MM3 44
95
#define REG_X86_64_MM4 45
96
#define REG_X86_64_MM5 46
97
#define REG_X86_64_MM6 47
98
#define REG_X86_64_MM7 48
99
100
/* These are technically 32-bit, but who cares. */
101
#define REG_X86_64_RFLAGS 49
102
#define REG_X86_64_ES 50
103
#define REG_X86_64_CS 51
104
#define REG_X86_64_SS 52
105
#define REG_X86_64_DS 53
106
#define REG_X86_64_FS 54
107
#define REG_X86_64_GS 55
108
109
#define REG_X86_64_FS_BASE 58
110
#define REG_X86_64_GS_BASE 59
111
/*
112
* Maybe special for Xen? At least 60 is not a DWARF reg... but might
113
* be useful for VMs.
114
*/
115
#define REG_X86_64_GS_BASE_KERNEL 60
116
#define REG_X86_64_GS_BASE_USER 61
117
118
#define REG_X86_64_TR 62
119
#define REG_X86_64_LDT 63
120
#define REG_X86_64_MXCSR 64
/* 128-bit */
121
#define REG_X86_64_X87CW 65
122
#define REG_X86_64_X87SW 66
123
124
/* This is not a DWARF register, but we want it to be somewhere! */
125
#define REG_X86_64_GDT 67
126
127
/*
128
* DWARF cannot address the rest of these.
129
*/
130
131
/*
132
* These registers are not "official" registers DWARF debuggers should
133
* ask for, but we want to map them somewhere!
134
*/
135
136
#define REG_X86_64_CR0 70
137
#define REG_X86_64_CR1 71
138
#define REG_X86_64_CR2 72
139
#define REG_X86_64_CR3 73
140
#define REG_X86_64_CR4 74
141
142
#define REG_X86_64_CR8 78
143
144
/* XXX: some chips have an XCR0 register; ignore it for now. */
145
146
#define REG_X86_64_DR0 80
147
#define REG_X86_64_DR1 81
148
#define REG_X86_64_DR2 82
149
#define REG_X86_64_DR3 83
150
151
#define REG_X86_64_DR6 86
152
#define REG_X86_64_DR7 87
153
154
#define REG_X86_64_MSR_EFER 88
155
156
#endif
/* __ARCH_X86_64_H__ */
arch_x86_64
struct arch arch_x86_64
Definition:
arch_x86_64.c:92
arch
Definition:
arch.h:116
Generated on Thu Jul 27 2017 20:47:30 for Stackdb by
1.8.8