OLD | NEW |
1 /* Target-dependent code for NaCl. | 1 /* Target-dependent code for NaCl. |
2 | 2 |
3 Copyright (C) 2001, 2003-2012 Free Software Foundation, Inc. | 3 Copyright (C) 2001, 2003-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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 { | 155 { |
156 insert_single_step_breakpoint (gdbarch, | 156 insert_single_step_breakpoint (gdbarch, |
157 get_frame_address_space (frame), | 157 get_frame_address_space (frame), |
158 bp_pc); | 158 bp_pc); |
159 return 1; | 159 return 1; |
160 } | 160 } |
161 | 161 |
162 return 0; | 162 return 0; |
163 } | 163 } |
164 | 164 |
| 165 static struct frame_id |
| 166 amd64_nacl_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) |
| 167 { |
| 168 CORE_ADDR fp; |
| 169 |
| 170 fp = get_frame_register_unsigned (this_frame, AMD64_RBP_REGNUM) + 16; |
| 171 fp = amd64_nacl_addr_bits_remove(gdbarch, fp); |
| 172 |
| 173 return frame_id_build (fp, get_frame_pc (this_frame)); |
| 174 } |
| 175 |
165 static void | 176 static void |
166 amd64_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) | 177 amd64_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) |
167 { | 178 { |
168 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); | 179 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); |
169 | 180 |
170 linux_init_abi (info, gdbarch); | 181 linux_init_abi (info, gdbarch); |
171 amd64_init_abi (info, gdbarch); | 182 amd64_init_abi (info, gdbarch); |
172 tdep->tdesc = tdesc_amd64_linux; | 183 tdep->tdesc = tdesc_amd64_linux; |
173 set_solib_svr4_fetch_link_map_offsets (gdbarch, | 184 set_solib_svr4_fetch_link_map_offsets (gdbarch, |
174 amd64_nacl_fetch_link_map_offsets); | 185 amd64_nacl_fetch_link_map_offsets); |
(...skipping 17 matching lines...) Expand all Loading... |
192 | 203 |
193 /* How to extract addresses from registers. */ | 204 /* How to extract addresses from registers. */ |
194 set_gdbarch_addr_bits_remove (gdbarch, amd64_nacl_addr_bits_remove); | 205 set_gdbarch_addr_bits_remove (gdbarch, amd64_nacl_addr_bits_remove); |
195 set_gdbarch_unwind_pc (gdbarch, amd64_nacl_unwind_pc); | 206 set_gdbarch_unwind_pc (gdbarch, amd64_nacl_unwind_pc); |
196 set_gdbarch_unwind_sp (gdbarch, amd64_nacl_unwind_sp); | 207 set_gdbarch_unwind_sp (gdbarch, amd64_nacl_unwind_sp); |
197 | 208 |
198 /* Where to set breakpoints. */ | 209 /* Where to set breakpoints. */ |
199 set_gdbarch_adjust_breakpoint_address (gdbarch, | 210 set_gdbarch_adjust_breakpoint_address (gdbarch, |
200 amd64_nacl_adjust_breakpoint_address); | 211 amd64_nacl_adjust_breakpoint_address); |
201 set_gdbarch_software_single_step (gdbarch, amd64_nacl_software_single_step); | 212 set_gdbarch_software_single_step (gdbarch, amd64_nacl_software_single_step); |
| 213 /* Recognizing dummy frames. */ |
| 214 set_gdbarch_dummy_id(gdbarch, amd64_nacl_dummy_id); |
202 } | 215 } |
203 | 216 |
204 /* Provide a prototype to silence -Wmissing-prototypes. */ | 217 /* Provide a prototype to silence -Wmissing-prototypes. */ |
205 extern void _initialize_nacl_tdep (void); | 218 extern void _initialize_nacl_tdep (void); |
206 | 219 |
207 void | 220 void |
208 _initialize_nacl_tdep (void) | 221 _initialize_nacl_tdep (void) |
209 { | 222 { |
210 gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, | 223 gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, |
211 nacl_osabi_sniffer); | 224 nacl_osabi_sniffer); |
212 | 225 |
213 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, | 226 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, |
214 GDB_OSABI_NACL, amd64_nacl_init_abi); | 227 GDB_OSABI_NACL, amd64_nacl_init_abi); |
215 | 228 |
216 gdbarch_register_osabi (bfd_arch_i386, 0, | 229 gdbarch_register_osabi (bfd_arch_i386, 0, |
217 GDB_OSABI_NACL, i386_nacl_init_abi); | 230 GDB_OSABI_NACL, i386_nacl_init_abi); |
218 } | 231 } |
OLD | NEW |