| OLD | NEW |
| 1 /* Target-dependent code for the IA-64 for GDB, the GNU debugger. | 1 /* Target-dependent code for the IA-64 for GDB, the GNU debugger. |
| 2 | 2 |
| 3 Copyright (C) 1999-2012 Free Software Foundation, Inc. | 3 Copyright (C) 1999-2012 Free Software Foundation, Inc. |
| 4 | 4 |
| 5 This file is part of GDB. | 5 This file is part of GDB. |
| 6 | 6 |
| 7 This program is free software; you can redistribute it and/or modify | 7 This program is free software; you can redistribute it and/or modify |
| 8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
| 9 the Free Software Foundation; either version 3 of the License, or | 9 the Free Software Foundation; either version 3 of the License, or |
| 10 (at your option) any later version. | 10 (at your option) any later version. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "elf/common.h" /* for DT_PLTGOT value */ | 35 #include "elf/common.h" /* for DT_PLTGOT value */ |
| 36 #include "elf-bfd.h" | 36 #include "elf-bfd.h" |
| 37 #include "dis-asm.h" | 37 #include "dis-asm.h" |
| 38 #include "infcall.h" | 38 #include "infcall.h" |
| 39 #include "osabi.h" | 39 #include "osabi.h" |
| 40 #include "ia64-tdep.h" | 40 #include "ia64-tdep.h" |
| 41 #include "cp-abi.h" | 41 #include "cp-abi.h" |
| 42 | 42 |
| 43 #ifdef HAVE_LIBUNWIND_IA64_H | 43 #ifdef HAVE_LIBUNWIND_IA64_H |
| 44 #include "elf/ia64.h" /* for PT_IA_64_UNWIND value */ | 44 #include "elf/ia64.h" /* for PT_IA_64_UNWIND value */ |
| 45 #include "libunwind-frame.h" | 45 #include "ia64-libunwind-tdep.h" |
| 46 #include "libunwind-ia64.h" | |
| 47 | 46 |
| 48 /* Note: KERNEL_START is supposed to be an address which is not going | 47 /* Note: KERNEL_START is supposed to be an address which is not going |
| 49 to ever contain any valid unwind info. For ia64 linux, the choice | 48 to ever contain any valid unwind info. For ia64 linux, the choice |
| 50 of 0xc000000000000000 is fairly safe since that's uncached space. | 49 of 0xc000000000000000 is fairly safe since that's uncached space. |
| 51 | 50 |
| 52 We use KERNEL_START as follows: after obtaining the kernel's | 51 We use KERNEL_START as follows: after obtaining the kernel's |
| 53 unwind table via getunwind(), we project its unwind data into | 52 unwind table via getunwind(), we project its unwind data into |
| 54 address-range KERNEL_START-(KERNEL_START+ktab_size) and then | 53 address-range KERNEL_START-(KERNEL_START+ktab_size) and then |
| 55 when ia64_access_mem() sees a memory access to this | 54 when ia64_access_mem() sees a memory access to this |
| 56 address-range, we redirect it to ktab instead. | 55 address-range, we redirect it to ktab instead. |
| (...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 | 1034 |
| 1036 store_unsigned_integer (buf, register_size (gdbarch, regnum), | 1035 store_unsigned_integer (buf, register_size (gdbarch, regnum), |
| 1037 byte_order, natN_val); | 1036 byte_order, natN_val); |
| 1038 } | 1037 } |
| 1039 else if (regnum == VBOF_REGNUM) | 1038 else if (regnum == VBOF_REGNUM) |
| 1040 { | 1039 { |
| 1041 /* A virtual register frame start is provided for user convenience. | 1040 /* A virtual register frame start is provided for user convenience. |
| 1042 It can be calculated as the bsp - sof (sizeof frame). */ | 1041 It can be calculated as the bsp - sof (sizeof frame). */ |
| 1043 ULONGEST bsp, vbsp; | 1042 ULONGEST bsp, vbsp; |
| 1044 ULONGEST cfm; | 1043 ULONGEST cfm; |
| 1045 CORE_ADDR reg; | |
| 1046 status = regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp); | 1044 status = regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp); |
| 1047 if (status != REG_VALID) | 1045 if (status != REG_VALID) |
| 1048 return status; | 1046 return status; |
| 1049 status = regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm); | 1047 status = regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm); |
| 1050 if (status != REG_VALID) | 1048 if (status != REG_VALID) |
| 1051 return status; | 1049 return status; |
| 1052 | 1050 |
| 1053 /* The bsp points at the end of the register frame so we | 1051 /* The bsp points at the end of the register frame so we |
| 1054 subtract the size of frame from it to get beginning of frame. */ | 1052 subtract the size of frame from it to get beginning of frame. */ |
| 1055 vbsp = rse_address_add (bsp, -(cfm & 0x7f)); | 1053 vbsp = rse_address_add (bsp, -(cfm & 0x7f)); |
| 1056 store_unsigned_integer (buf, register_size (gdbarch, regnum), | 1054 store_unsigned_integer (buf, register_size (gdbarch, regnum), |
| 1057 byte_order, vbsp); | 1055 byte_order, vbsp); |
| 1058 } | 1056 } |
| 1059 else if (VP0_REGNUM <= regnum && regnum <= VP63_REGNUM) | 1057 else if (VP0_REGNUM <= regnum && regnum <= VP63_REGNUM) |
| 1060 { | 1058 { |
| 1061 ULONGEST pr; | 1059 ULONGEST pr; |
| 1062 ULONGEST cfm; | 1060 ULONGEST cfm; |
| 1063 ULONGEST prN_val; | 1061 ULONGEST prN_val; |
| 1064 CORE_ADDR reg; | |
| 1065 status = regcache_cooked_read_unsigned (regcache, IA64_PR_REGNUM, &pr); | 1062 status = regcache_cooked_read_unsigned (regcache, IA64_PR_REGNUM, &pr); |
| 1066 if (status != REG_VALID) | 1063 if (status != REG_VALID) |
| 1067 return status; | 1064 return status; |
| 1068 status = regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm); | 1065 status = regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm); |
| 1069 if (status != REG_VALID) | 1066 if (status != REG_VALID) |
| 1070 return status; | 1067 return status; |
| 1071 | 1068 |
| 1072 if (VP16_REGNUM <= regnum && regnum <= VP63_REGNUM) | 1069 if (VP16_REGNUM <= regnum && regnum <= VP63_REGNUM) |
| 1073 { | 1070 { |
| 1074 /* Fetch predicate register rename base from current frame | 1071 /* Fetch predicate register rename base from current frame |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1092 static void | 1089 static void |
| 1093 ia64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, | 1090 ia64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, |
| 1094 int regnum, const gdb_byte *buf) | 1091 int regnum, const gdb_byte *buf) |
| 1095 { | 1092 { |
| 1096 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); | 1093 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
| 1097 | 1094 |
| 1098 if (regnum >= V32_REGNUM && regnum <= V127_REGNUM) | 1095 if (regnum >= V32_REGNUM && regnum <= V127_REGNUM) |
| 1099 { | 1096 { |
| 1100 ULONGEST bsp; | 1097 ULONGEST bsp; |
| 1101 ULONGEST cfm; | 1098 ULONGEST cfm; |
| 1102 CORE_ADDR reg; | |
| 1103 regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp); | 1099 regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp); |
| 1104 regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm); | 1100 regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm); |
| 1105 | 1101 |
| 1106 bsp = rse_address_add (bsp, -(cfm & 0x7f)); | 1102 bsp = rse_address_add (bsp, -(cfm & 0x7f)); |
| 1107 | 1103 |
| 1108 if ((cfm & 0x7f) > regnum - V32_REGNUM) | 1104 if ((cfm & 0x7f) > regnum - V32_REGNUM) |
| 1109 { | 1105 { |
| 1110 ULONGEST reg_addr = rse_address_add (bsp, (regnum - V32_REGNUM)); | 1106 ULONGEST reg_addr = rse_address_add (bsp, (regnum - V32_REGNUM)); |
| 1111 write_memory (reg_addr, (void *) buf, 8); | 1107 write_memory (reg_addr, (void *) buf, 8); |
| 1112 } | 1108 } |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1848 | 1844 |
| 1849 /* Normal frames. */ | 1845 /* Normal frames. */ |
| 1850 | 1846 |
| 1851 static struct ia64_frame_cache * | 1847 static struct ia64_frame_cache * |
| 1852 ia64_frame_cache (struct frame_info *this_frame, void **this_cache) | 1848 ia64_frame_cache (struct frame_info *this_frame, void **this_cache) |
| 1853 { | 1849 { |
| 1854 struct gdbarch *gdbarch = get_frame_arch (this_frame); | 1850 struct gdbarch *gdbarch = get_frame_arch (this_frame); |
| 1855 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); | 1851 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
| 1856 struct ia64_frame_cache *cache; | 1852 struct ia64_frame_cache *cache; |
| 1857 char buf[8]; | 1853 char buf[8]; |
| 1858 CORE_ADDR cfm, sof, sol, bsp, psr; | 1854 CORE_ADDR cfm, psr; |
| 1859 int i; | |
| 1860 | 1855 |
| 1861 if (*this_cache) | 1856 if (*this_cache) |
| 1862 return *this_cache; | 1857 return *this_cache; |
| 1863 | 1858 |
| 1864 cache = ia64_alloc_frame_cache (); | 1859 cache = ia64_alloc_frame_cache (); |
| 1865 *this_cache = cache; | 1860 *this_cache = cache; |
| 1866 | 1861 |
| 1867 get_frame_register (this_frame, sp_regnum, buf); | 1862 get_frame_register (this_frame, sp_regnum, buf); |
| 1868 cache->saved_sp = extract_unsigned_integer (buf, 8, byte_order); | 1863 cache->saved_sp = extract_unsigned_integer (buf, 8, byte_order); |
| 1869 | 1864 |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2236 tdep->sigcontext_register_address (gdbarch, cache->base, regno); | 2231 tdep->sigcontext_register_address (gdbarch, cache->base, regno); |
| 2237 } | 2232 } |
| 2238 } | 2233 } |
| 2239 | 2234 |
| 2240 static struct ia64_frame_cache * | 2235 static struct ia64_frame_cache * |
| 2241 ia64_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache) | 2236 ia64_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache) |
| 2242 { | 2237 { |
| 2243 struct gdbarch *gdbarch = get_frame_arch (this_frame); | 2238 struct gdbarch *gdbarch = get_frame_arch (this_frame); |
| 2244 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); | 2239 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
| 2245 struct ia64_frame_cache *cache; | 2240 struct ia64_frame_cache *cache; |
| 2246 CORE_ADDR addr; | |
| 2247 char buf[8]; | 2241 char buf[8]; |
| 2248 int i; | |
| 2249 | 2242 |
| 2250 if (*this_cache) | 2243 if (*this_cache) |
| 2251 return *this_cache; | 2244 return *this_cache; |
| 2252 | 2245 |
| 2253 cache = ia64_alloc_frame_cache (); | 2246 cache = ia64_alloc_frame_cache (); |
| 2254 | 2247 |
| 2255 get_frame_register (this_frame, sp_regnum, buf); | 2248 get_frame_register (this_frame, sp_regnum, buf); |
| 2256 /* Note that frame size is hard-coded below. We cannot calculate it | 2249 /* Note that frame size is hard-coded below. We cannot calculate it |
| 2257 via prologue examination. */ | 2250 via prologue examination. */ |
| 2258 cache->base = extract_unsigned_integer (buf, 8, byte_order) + 16; | 2251 cache->base = extract_unsigned_integer (buf, 8, byte_order) + 16; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2408 } | 2401 } |
| 2409 | 2402 |
| 2410 /* Skip over a designated number of registers in the backing | 2403 /* Skip over a designated number of registers in the backing |
| 2411 store, remembering every 64th position is for NAT. */ | 2404 store, remembering every 64th position is for NAT. */ |
| 2412 static __inline__ uint64_t | 2405 static __inline__ uint64_t |
| 2413 ia64_rse_skip_regs (uint64_t addr, long num_regs) | 2406 ia64_rse_skip_regs (uint64_t addr, long num_regs) |
| 2414 { | 2407 { |
| 2415 long delta = ia64_rse_slot_num(addr) + num_regs; | 2408 long delta = ia64_rse_slot_num(addr) + num_regs; |
| 2416 | 2409 |
| 2417 if (num_regs < 0) | 2410 if (num_regs < 0) |
error: old chunk mismatch |
None
| OLD | NEW |