1 //===-- lldb-x86-register-enums.h -------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_X86_REGISTER_ENUMS_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_X86_REGISTER_ENUMS_H
12 namespace lldb_private {
13 // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB)
15 // Internal codes for all i386 registers.
18 lldb_eax_i386 = k_first_gpr_i386,
36 lldb_ax_i386 = k_first_alias_i386,
52 k_last_alias_i386 = lldb_dl_i386,
54 k_last_gpr_i386 = k_last_alias_i386,
57 lldb_fctrl_i386 = k_first_fpr_i386,
91 k_last_fpr_i386 = lldb_xmm7_i386,
94 lldb_ymm0_i386 = k_first_avx_i386,
102 k_last_avx_i386 = lldb_ymm7_i386,
105 lldb_bnd0_i386 = k_first_mpxr_i386,
109 k_last_mpxr_i386 = lldb_bnd3_i386,
112 lldb_bndcfgu_i386 = k_first_mpxc_i386,
114 k_last_mpxc_i386 = lldb_bndstatus_i386,
117 lldb_dr0_i386 = k_first_dbr_i386,
125 k_last_dbr_i386 = lldb_dr7_i386,
127 k_num_registers_i386,
128 k_num_gpr_registers_i386 = k_last_gpr_i386 - k_first_gpr_i386 + 1,
129 k_num_fpr_registers_i386 = k_last_fpr_i386 - k_first_fpr_i386 + 1,
130 k_num_avx_registers_i386 = k_last_avx_i386 - k_first_avx_i386 + 1,
131 k_num_mpx_registers_i386 = k_last_mpxc_i386 - k_first_mpxr_i386 + 1,
132 k_num_user_registers_i386 = k_num_gpr_registers_i386 +
133 k_num_fpr_registers_i386 +
134 k_num_avx_registers_i386 +
135 k_num_mpx_registers_i386,
136 k_num_dbr_registers_i386 = k_last_dbr_i386 - k_first_dbr_i386 + 1,
139 // Internal codes for all x86_64 registers.
142 lldb_rax_x86_64 = k_first_gpr_x86_64,
167 k_first_alias_x86_64,
168 lldb_eax_x86_64 = k_first_alias_x86_64,
176 lldb_r8d_x86_64, // Low 32 bits of r8
177 lldb_r9d_x86_64, // Low 32 bits of r9
178 lldb_r10d_x86_64, // Low 32 bits of r10
179 lldb_r11d_x86_64, // Low 32 bits of r11
180 lldb_r12d_x86_64, // Low 32 bits of r12
181 lldb_r13d_x86_64, // Low 32 bits of r13
182 lldb_r14d_x86_64, // Low 32 bits of r14
183 lldb_r15d_x86_64, // Low 32 bits of r15
192 lldb_r8w_x86_64, // Low 16 bits of r8
193 lldb_r9w_x86_64, // Low 16 bits of r9
194 lldb_r10w_x86_64, // Low 16 bits of r10
195 lldb_r11w_x86_64, // Low 16 bits of r11
196 lldb_r12w_x86_64, // Low 16 bits of r12
197 lldb_r13w_x86_64, // Low 16 bits of r13
198 lldb_r14w_x86_64, // Low 16 bits of r14
199 lldb_r15w_x86_64, // Low 16 bits of r15
212 lldb_r8l_x86_64, // Low 8 bits of r8
213 lldb_r9l_x86_64, // Low 8 bits of r9
214 lldb_r10l_x86_64, // Low 8 bits of r10
215 lldb_r11l_x86_64, // Low 8 bits of r11
216 lldb_r12l_x86_64, // Low 8 bits of r12
217 lldb_r13l_x86_64, // Low 8 bits of r13
218 lldb_r14l_x86_64, // Low 8 bits of r14
219 lldb_r15l_x86_64, // Low 8 bits of r15
220 k_last_alias_x86_64 = lldb_r15l_x86_64,
222 k_last_gpr_x86_64 = k_last_alias_x86_64,
225 lldb_fctrl_x86_64 = k_first_fpr_x86_64,
236 lldb_mxcsrmask_x86_64,
269 k_last_fpr_x86_64 = lldb_xmm15_x86_64,
272 lldb_ymm0_x86_64 = k_first_avx_x86_64,
288 k_last_avx_x86_64 = lldb_ymm15_x86_64,
291 lldb_bnd0_x86_64 = k_first_mpxr_x86_64,
295 k_last_mpxr_x86_64 = lldb_bnd3_x86_64,
298 lldb_bndcfgu_x86_64 = k_first_mpxc_x86_64,
299 lldb_bndstatus_x86_64,
300 k_last_mpxc_x86_64 = lldb_bndstatus_x86_64,
303 lldb_dr0_x86_64 = k_first_dbr_x86_64,
311 k_last_dbr_x86_64 = lldb_dr7_x86_64,
313 k_num_registers_x86_64,
314 k_num_gpr_registers_x86_64 = k_last_gpr_x86_64 - k_first_gpr_x86_64 + 1,
315 k_num_fpr_registers_x86_64 = k_last_fpr_x86_64 - k_first_fpr_x86_64 + 1,
316 k_num_avx_registers_x86_64 = k_last_avx_x86_64 - k_first_avx_x86_64 + 1,
317 k_num_mpx_registers_x86_64 = k_last_mpxc_x86_64 - k_first_mpxr_x86_64 + 1,
318 k_num_user_registers_x86_64 = k_num_gpr_registers_x86_64 +
319 k_num_fpr_registers_x86_64 +
320 k_num_avx_registers_x86_64 +
321 k_num_mpx_registers_x86_64,
322 k_num_dbr_registers_x86_64 = k_last_dbr_x86_64 - k_first_dbr_x86_64 + 1,
325 // For platform that supports fs_base/gs_base registers.
326 namespace x86_64_with_base {
329 lldb_rax = k_first_gpr,
357 lldb_eax = k_first_alias,
365 lldb_r8d, // Low 32 bits of r8
366 lldb_r9d, // Low 32 bits of r9
367 lldb_r10d, // Low 32 bits of r10
368 lldb_r11d, // Low 32 bits of r11
369 lldb_r12d, // Low 32 bits of r12
370 lldb_r13d, // Low 32 bits of r13
371 lldb_r14d, // Low 32 bits of r14
372 lldb_r15d, // Low 32 bits of r15
381 lldb_r8w, // Low 16 bits of r8
382 lldb_r9w, // Low 16 bits of r9
383 lldb_r10w, // Low 16 bits of r10
384 lldb_r11w, // Low 16 bits of r11
385 lldb_r12w, // Low 16 bits of r12
386 lldb_r13w, // Low 16 bits of r13
387 lldb_r14w, // Low 16 bits of r14
388 lldb_r15w, // Low 16 bits of r15
401 lldb_r8l, // Low 8 bits of r8
402 lldb_r9l, // Low 8 bits of r9
403 lldb_r10l, // Low 8 bits of r10
404 lldb_r11l, // Low 8 bits of r11
405 lldb_r12l, // Low 8 bits of r12
406 lldb_r13l, // Low 8 bits of r13
407 lldb_r14l, // Low 8 bits of r14
408 lldb_r15l, // Low 8 bits of r15
409 k_last_alias = lldb_r15l,
411 k_last_gpr = k_last_alias,
414 lldb_fctrl = k_first_fpr,
458 k_last_fpr = lldb_xmm15,
461 lldb_ymm0 = k_first_avx,
477 k_last_avx = lldb_ymm15,
480 lldb_bnd0 = k_first_mpxr,
484 k_last_mpxr = lldb_bnd3,
487 lldb_bndcfgu = k_first_mpxc,
489 k_last_mpxc = lldb_bndstatus,
492 lldb_dr0 = k_first_dbr,
500 k_last_dbr = lldb_dr7,
503 k_num_gpr_registers = k_last_gpr - k_first_gpr + 1,
504 k_num_fpr_registers = k_last_fpr - k_first_fpr + 1,
505 k_num_avx_registers = k_last_avx - k_first_avx + 1,
506 k_num_mpx_registers = k_last_mpxc - k_first_mpxr + 1,
507 k_num_user_registers = k_num_gpr_registers +
508 k_num_fpr_registers +
509 k_num_avx_registers +
511 k_num_dbr_registers = k_last_dbr - k_first_dbr + 1,
513 } // namespace x86_64_with_base
517 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_X86_REGISTER_ENUMS_H