GDB (API)
/home/stan/gdb/src/gdb/ia64-tdep.h
Go to the documentation of this file.
00001 /* Target-dependent code for the ia64.
00002 
00003    Copyright (C) 2004-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 IA64_TDEP_H
00021 #define IA64_TDEP_H
00022 
00023 #ifdef HAVE_LIBUNWIND_IA64_H
00024 #include "libunwind-ia64.h"
00025 #include "ia64-libunwind-tdep.h"
00026 #endif
00027 
00028 /* Register numbers of various important registers.  */
00029 
00030 /* General registers; there are 128 of these 64 bit wide registers.
00031    The first 32 are static and the last 96 are stacked.  */
00032 #define IA64_GR0_REGNUM         0
00033 #define IA64_GR1_REGNUM         (IA64_GR0_REGNUM + 1)
00034 #define IA64_GR2_REGNUM         (IA64_GR0_REGNUM + 2)
00035 #define IA64_GR3_REGNUM         (IA64_GR0_REGNUM + 3)
00036 #define IA64_GR4_REGNUM         (IA64_GR0_REGNUM + 4)
00037 #define IA64_GR5_REGNUM         (IA64_GR0_REGNUM + 5)
00038 #define IA64_GR6_REGNUM         (IA64_GR0_REGNUM + 6)
00039 #define IA64_GR7_REGNUM         (IA64_GR0_REGNUM + 7)
00040 #define IA64_GR8_REGNUM         (IA64_GR0_REGNUM + 8)
00041 #define IA64_GR9_REGNUM         (IA64_GR0_REGNUM + 9)
00042 #define IA64_GR10_REGNUM        (IA64_GR0_REGNUM + 10)
00043 #define IA64_GR11_REGNUM        (IA64_GR0_REGNUM + 11)
00044 #define IA64_GR12_REGNUM        (IA64_GR0_REGNUM + 12)
00045 #define IA64_GR31_REGNUM        (IA64_GR0_REGNUM + 31)
00046 #define IA64_GR32_REGNUM        (IA64_GR0_REGNUM + 32)
00047 #define IA64_GR127_REGNUM       (IA64_GR0_REGNUM + 127)
00048 
00049 /* Floating point registers; 128 82-bit wide registers.  */
00050 #define IA64_FR0_REGNUM         128
00051 #define IA64_FR1_REGNUM         (IA64_FR0_REGNUM + 1)
00052 #define IA64_FR2_REGNUM         (IA64_FR0_REGNUM + 2)
00053 #define IA64_FR8_REGNUM         (IA64_FR0_REGNUM + 8)
00054 #define IA64_FR9_REGNUM         (IA64_FR0_REGNUM + 9)
00055 #define IA64_FR10_REGNUM        (IA64_FR0_REGNUM + 10)
00056 #define IA64_FR11_REGNUM        (IA64_FR0_REGNUM + 11)
00057 #define IA64_FR12_REGNUM        (IA64_FR0_REGNUM + 12)
00058 #define IA64_FR13_REGNUM        (IA64_FR0_REGNUM + 13)
00059 #define IA64_FR14_REGNUM        (IA64_FR0_REGNUM + 14)
00060 #define IA64_FR15_REGNUM        (IA64_FR0_REGNUM + 15)
00061 #define IA64_FR16_REGNUM        (IA64_FR0_REGNUM + 16)
00062 #define IA64_FR31_REGNUM        (IA64_FR0_REGNUM + 31)
00063 #define IA64_FR32_REGNUM        (IA64_FR0_REGNUM + 32)
00064 #define IA64_FR127_REGNUM       (IA64_FR0_REGNUM + 127)
00065 
00066 /* Predicate registers; There are 64 of these one bit registers.  It'd
00067    be more convenient (implementation-wise) to use a single 64 bit
00068    word with all of these register in them.  Note that there's also a
00069    IA64_PR_REGNUM below which contains all the bits and is used for
00070    communicating the actual values to the target.  */
00071 #define IA64_PR0_REGNUM         256
00072 #define IA64_PR1_REGNUM         (IA64_PR0_REGNUM + 1)
00073 #define IA64_PR2_REGNUM         (IA64_PR0_REGNUM + 2)
00074 #define IA64_PR3_REGNUM         (IA64_PR0_REGNUM + 3)
00075 #define IA64_PR4_REGNUM         (IA64_PR0_REGNUM + 4)
00076 #define IA64_PR5_REGNUM         (IA64_PR0_REGNUM + 5)
00077 #define IA64_PR6_REGNUM         (IA64_PR0_REGNUM + 6)
00078 #define IA64_PR7_REGNUM         (IA64_PR0_REGNUM + 7)
00079 #define IA64_PR8_REGNUM         (IA64_PR0_REGNUM + 8)
00080 #define IA64_PR9_REGNUM         (IA64_PR0_REGNUM + 9)
00081 #define IA64_PR10_REGNUM        (IA64_PR0_REGNUM + 10)
00082 #define IA64_PR11_REGNUM        (IA64_PR0_REGNUM + 11)
00083 #define IA64_PR12_REGNUM        (IA64_PR0_REGNUM + 12)
00084 #define IA64_PR13_REGNUM        (IA64_PR0_REGNUM + 13)
00085 #define IA64_PR14_REGNUM        (IA64_PR0_REGNUM + 14)
00086 #define IA64_PR15_REGNUM        (IA64_PR0_REGNUM + 15)
00087 #define IA64_PR16_REGNUM        (IA64_PR0_REGNUM + 16)
00088 #define IA64_PR17_REGNUM        (IA64_PR0_REGNUM + 17)
00089 #define IA64_PR18_REGNUM        (IA64_PR0_REGNUM + 18)
00090 #define IA64_PR19_REGNUM        (IA64_PR0_REGNUM + 19)
00091 #define IA64_PR20_REGNUM        (IA64_PR0_REGNUM + 20)
00092 #define IA64_PR21_REGNUM        (IA64_PR0_REGNUM + 21)
00093 #define IA64_PR22_REGNUM        (IA64_PR0_REGNUM + 22)
00094 #define IA64_PR23_REGNUM        (IA64_PR0_REGNUM + 23)
00095 #define IA64_PR24_REGNUM        (IA64_PR0_REGNUM + 24)
00096 #define IA64_PR25_REGNUM        (IA64_PR0_REGNUM + 25)
00097 #define IA64_PR26_REGNUM        (IA64_PR0_REGNUM + 26)
00098 #define IA64_PR27_REGNUM        (IA64_PR0_REGNUM + 27)
00099 #define IA64_PR28_REGNUM        (IA64_PR0_REGNUM + 28)
00100 #define IA64_PR29_REGNUM        (IA64_PR0_REGNUM + 29)
00101 #define IA64_PR30_REGNUM        (IA64_PR0_REGNUM + 30)
00102 #define IA64_PR31_REGNUM        (IA64_PR0_REGNUM + 31)
00103 #define IA64_PR32_REGNUM        (IA64_PR0_REGNUM + 32)
00104 #define IA64_PR33_REGNUM        (IA64_PR0_REGNUM + 33)
00105 #define IA64_PR34_REGNUM        (IA64_PR0_REGNUM + 34)
00106 #define IA64_PR35_REGNUM        (IA64_PR0_REGNUM + 35)
00107 #define IA64_PR36_REGNUM        (IA64_PR0_REGNUM + 36)
00108 #define IA64_PR37_REGNUM        (IA64_PR0_REGNUM + 37)
00109 #define IA64_PR38_REGNUM        (IA64_PR0_REGNUM + 38)
00110 #define IA64_PR39_REGNUM        (IA64_PR0_REGNUM + 39)
00111 #define IA64_PR40_REGNUM        (IA64_PR0_REGNUM + 40)
00112 #define IA64_PR41_REGNUM        (IA64_PR0_REGNUM + 41)
00113 #define IA64_PR42_REGNUM        (IA64_PR0_REGNUM + 42)
00114 #define IA64_PR43_REGNUM        (IA64_PR0_REGNUM + 43)
00115 #define IA64_PR44_REGNUM        (IA64_PR0_REGNUM + 44)
00116 #define IA64_PR45_REGNUM        (IA64_PR0_REGNUM + 45)
00117 #define IA64_PR46_REGNUM        (IA64_PR0_REGNUM + 46)
00118 #define IA64_PR47_REGNUM        (IA64_PR0_REGNUM + 47)
00119 #define IA64_PR48_REGNUM        (IA64_PR0_REGNUM + 48)
00120 #define IA64_PR49_REGNUM        (IA64_PR0_REGNUM + 49)
00121 #define IA64_PR50_REGNUM        (IA64_PR0_REGNUM + 50)
00122 #define IA64_PR51_REGNUM        (IA64_PR0_REGNUM + 51)
00123 #define IA64_PR52_REGNUM        (IA64_PR0_REGNUM + 52)
00124 #define IA64_PR53_REGNUM        (IA64_PR0_REGNUM + 53)
00125 #define IA64_PR54_REGNUM        (IA64_PR0_REGNUM + 54)
00126 #define IA64_PR55_REGNUM        (IA64_PR0_REGNUM + 55)
00127 #define IA64_PR56_REGNUM        (IA64_PR0_REGNUM + 56)
00128 #define IA64_PR57_REGNUM        (IA64_PR0_REGNUM + 57)
00129 #define IA64_PR58_REGNUM        (IA64_PR0_REGNUM + 58)
00130 #define IA64_PR59_REGNUM        (IA64_PR0_REGNUM + 59)
00131 #define IA64_PR60_REGNUM        (IA64_PR0_REGNUM + 60)
00132 #define IA64_PR61_REGNUM        (IA64_PR0_REGNUM + 61)
00133 #define IA64_PR62_REGNUM        (IA64_PR0_REGNUM + 62)
00134 #define IA64_PR63_REGNUM        (IA64_PR0_REGNUM + 63)
00135 
00136 /* Branch registers: 8 64-bit registers for holding branch targets.  */
00137 #define IA64_BR0_REGNUM         320
00138 #define IA64_BR1_REGNUM         (IA64_BR0_REGNUM + 1)
00139 #define IA64_BR2_REGNUM         (IA64_BR0_REGNUM + 2)
00140 #define IA64_BR3_REGNUM         (IA64_BR0_REGNUM + 3)
00141 #define IA64_BR4_REGNUM         (IA64_BR0_REGNUM + 4)
00142 #define IA64_BR5_REGNUM         (IA64_BR0_REGNUM + 5)
00143 #define IA64_BR6_REGNUM         (IA64_BR0_REGNUM + 6)
00144 #define IA64_BR7_REGNUM         (IA64_BR0_REGNUM + 7)
00145 
00146 /* Virtual frame pointer; this matches IA64_FRAME_POINTER_REGNUM in
00147    gcc/config/ia64/ia64.h.  */
00148 #define IA64_VFP_REGNUM         328
00149 
00150 /* Virtual return address pointer; this matches
00151    IA64_RETURN_ADDRESS_POINTER_REGNUM in gcc/config/ia64/ia64.h.  */
00152 #define IA64_VRAP_REGNUM        329
00153 
00154 /* Predicate registers: There are 64 of these 1-bit registers.  We
00155    define a single register which is used to communicate these values
00156    to/from the target.  We will somehow contrive to make it appear
00157    that IA64_PR0_REGNUM thru IA64_PR63_REGNUM hold the actual values.  */
00158 #define IA64_PR_REGNUM          330
00159 
00160 /* Instruction pointer: 64 bits wide.  */
00161 #define IA64_IP_REGNUM          331
00162 
00163 /* Process Status Register.  */
00164 #define IA64_PSR_REGNUM         332
00165 
00166 /* Current Frame Marker (raw form may be the cr.ifs).  */
00167 #define IA64_CFM_REGNUM         333
00168 
00169 /* Application registers; 128 64-bit wide registers possible, but some
00170    of them are reserved.  */
00171 #define IA64_AR0_REGNUM         334
00172 #define IA64_KR0_REGNUM         (IA64_AR0_REGNUM + 0)
00173 #define IA64_KR7_REGNUM         (IA64_KR0_REGNUM + 7)
00174 
00175 #define IA64_RSC_REGNUM         (IA64_AR0_REGNUM + 16)
00176 #define IA64_BSP_REGNUM         (IA64_AR0_REGNUM + 17)
00177 #define IA64_BSPSTORE_REGNUM    (IA64_AR0_REGNUM + 18)
00178 #define IA64_RNAT_REGNUM        (IA64_AR0_REGNUM + 19)
00179 #define IA64_FCR_REGNUM         (IA64_AR0_REGNUM + 21)
00180 #define IA64_EFLAG_REGNUM       (IA64_AR0_REGNUM + 24)
00181 #define IA64_CSD_REGNUM         (IA64_AR0_REGNUM + 25)
00182 #define IA64_SSD_REGNUM         (IA64_AR0_REGNUM + 26)
00183 #define IA64_CFLG_REGNUM        (IA64_AR0_REGNUM + 27)
00184 #define IA64_FSR_REGNUM         (IA64_AR0_REGNUM + 28)
00185 #define IA64_FIR_REGNUM         (IA64_AR0_REGNUM + 29)
00186 #define IA64_FDR_REGNUM         (IA64_AR0_REGNUM + 30)
00187 #define IA64_CCV_REGNUM         (IA64_AR0_REGNUM + 32)
00188 #define IA64_UNAT_REGNUM        (IA64_AR0_REGNUM + 36)
00189 #define IA64_FPSR_REGNUM        (IA64_AR0_REGNUM + 40)
00190 #define IA64_ITC_REGNUM         (IA64_AR0_REGNUM + 44)
00191 #define IA64_PFS_REGNUM         (IA64_AR0_REGNUM + 64)
00192 #define IA64_LC_REGNUM          (IA64_AR0_REGNUM + 65)
00193 #define IA64_EC_REGNUM          (IA64_AR0_REGNUM + 66)
00194 
00195 /* NAT (Not A Thing) Bits for the general registers; there are 128 of
00196    these.  */
00197 #define IA64_NAT0_REGNUM        462
00198 #define IA64_NAT31_REGNUM       (IA64_NAT0_REGNUM + 31)
00199 #define IA64_NAT32_REGNUM       (IA64_NAT0_REGNUM + 32)
00200 #define IA64_NAT127_REGNUM      (IA64_NAT0_REGNUM + 127)
00201 
00202 struct frame_info;
00203 struct regcache;
00204 
00205 /* A struction containing pointers to all the target-dependent operations
00206    performed to setup an inferior function call. */
00207 
00208 struct ia64_infcall_ops
00209 {
00210   /* Allocate a new register stack frame starting after the output
00211      region of the current frame.  The new frame will contain SOF
00212      registers, all in the output region.  This is one way of protecting
00213      the stacked registers of the current frame.
00214 
00215      Should do nothing if this operation is not permitted by the OS.  */
00216   void (*allocate_new_rse_frame) (struct regcache *regcache, ULONGEST bsp,
00217                                   int sof);
00218 
00219   /* Store the argument stored in BUF into the appropriate location
00220      given the BSP and the SLOTNUM.  */
00221   void (*store_argument_in_slot) (struct regcache *regcache, CORE_ADDR bsp,
00222                                   int slotnum, gdb_byte *buf);
00223 
00224   /* For targets where we cannot call the function directly, store
00225      the address of the function we want to call at the location
00226      expected by the calling sequence.  */
00227   void (*set_function_addr) (struct regcache *regcache, CORE_ADDR func_addr);
00228 };
00229 
00230 struct gdbarch_tdep
00231 {
00232   CORE_ADDR (*sigcontext_register_address) (struct gdbarch *, CORE_ADDR, int);
00233   int (*pc_in_sigtramp) (CORE_ADDR);
00234 
00235   /* Return the total size of THIS_FRAME's register frame.
00236      CFM is THIS_FRAME's cfm register value.
00237 
00238      Normally, the size of the register frame is always obtained by
00239      extracting the lowest 7 bits ("cfm & 0x7f").  */
00240   int (*size_of_register_frame) (struct frame_info *this_frame, ULONGEST cfm);
00241 
00242   /* Determine the function address FADDR belongs to a shared library.
00243      If it does, then return the associated global pointer.  If no shared
00244      library was found to contain that function, then return zero.
00245 
00246      This pointer may be NULL.  */
00247   CORE_ADDR (*find_global_pointer_from_solib) (struct gdbarch *gdbarch,
00248                                                CORE_ADDR faddr);
00249 
00250   /* ISA-specific data types.  */
00251   struct type *ia64_ext_type;
00252 
00253   struct ia64_infcall_ops infcall_ops;
00254 };
00255 
00256 extern void ia64_write_pc (struct regcache *, CORE_ADDR);
00257 
00258 #ifdef HAVE_LIBUNWIND_IA64_H
00259 extern unw_accessors_t ia64_unw_accessors;
00260 extern unw_accessors_t ia64_unw_rse_accessors;
00261 extern struct libunwind_descr ia64_libunwind_descr;
00262 #endif
00263 
00264 #endif /* ia64-tdep.h */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines