GDB (API)
|
00001 /* Target-dependent code for GNU/Linux x86. 00002 00003 Copyright (C) 2002-2013 Free Software Foundation, Inc. 00004 00005 This file is part of GDB. 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00019 00020 #ifndef I386_LINUX_TDEP_H 00021 #define I386_LINUX_TDEP_H 00022 00023 /* The Linux kernel pretends there is an additional "orig_eax" 00024 register. Since GDB needs access to that register to be able to 00025 properly restart system calls when necessary (see 00026 i386-linux-tdep.c) we need our own versions of a number of 00027 functions that deal with GDB's register cache. */ 00028 00029 /* Register number for the "orig_eax" pseudo-register. If this 00030 pseudo-register contains a value >= 0 it is interpreted as the 00031 system call number that the kernel is supposed to restart. */ 00032 #define I386_LINUX_ORIG_EAX_REGNUM I386_AVX_NUM_REGS 00033 00034 /* Total number of registers for GNU/Linux. */ 00035 #define I386_LINUX_NUM_REGS (I386_LINUX_ORIG_EAX_REGNUM + 1) 00036 00037 /* Get XSAVE extended state xcr0 from core dump. */ 00038 extern uint64_t i386_linux_core_read_xcr0 (bfd *abfd); 00039 00040 /* Linux target description. */ 00041 extern struct target_desc *tdesc_i386_linux; 00042 extern struct target_desc *tdesc_i386_mmx_linux; 00043 extern struct target_desc *tdesc_i386_avx_linux; 00044 00045 /* Format of XSAVE extended state is: 00046 struct 00047 { 00048 fxsave_bytes[0..463] 00049 sw_usable_bytes[464..511] 00050 xstate_hdr_bytes[512..575] 00051 avx_bytes[576..831] 00052 future_state etc 00053 }; 00054 00055 Same memory layout will be used for the coredump NT_X86_XSTATE 00056 representing the XSAVE extended state registers. 00057 00058 The first 8 bytes of the sw_usable_bytes[464..467] is the OS enabled 00059 extended state mask, which is the same as the extended control register 00060 0 (the XFEATURE_ENABLED_MASK register), XCR0. We can use this mask 00061 together with the mask saved in the xstate_hdr_bytes to determine what 00062 states the processor/OS supports and what state, used or initialized, 00063 the process/thread is in. */ 00064 #define I386_LINUX_XSAVE_XCR0_OFFSET 464 00065 00066 extern int i386_linux_gregset_reg_offset[]; 00067 00068 #endif /* i386-linux-tdep.h */