Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: gdb/nacl-tdep.c

Issue 22590004: Create NaCl specific frame inner detection function. (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 amd64_nacl_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) 177 amd64_nacl_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
178 { 178 {
179 CORE_ADDR fp; 179 CORE_ADDR fp;
180 180
181 fp = get_frame_register_unsigned (this_frame, AMD64_RBP_REGNUM) + 16; 181 fp = get_frame_register_unsigned (this_frame, AMD64_RBP_REGNUM) + 16;
182 fp = amd64_nacl_addr_bits_remove(gdbarch, fp); 182 fp = amd64_nacl_addr_bits_remove(gdbarch, fp);
183 183
184 return frame_id_build (fp, get_frame_pc (this_frame)); 184 return frame_id_build (fp, get_frame_pc (this_frame));
185 } 185 }
186 186
187 static int
188 amd64_nacl_inner_than (CORE_ADDR lhs, CORE_ADDR rhs)
189 {
190 return (uint32_t)lhs < (uint32_t)rhs;
191 }
192
187 static void 193 static void
188 amd64_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) 194 amd64_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
189 { 195 {
190 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); 196 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
191 197
192 linux_init_abi (info, gdbarch); 198 linux_init_abi (info, gdbarch);
193 amd64_init_abi (info, gdbarch); 199 amd64_init_abi (info, gdbarch);
194 amd64_linux_init_gregset (tdep); 200 amd64_linux_init_gregset (tdep);
195 tdep->tdesc = tdesc_amd64_linux; 201 tdep->tdesc = tdesc_amd64_linux;
196 set_solib_svr4_fetch_link_map_offsets (gdbarch, 202 set_solib_svr4_fetch_link_map_offsets (gdbarch,
(...skipping 13 matching lines...) Expand all
210 216
211 /* TODO(eaeltsin): we might use address size instead of pointer size to 217 /* TODO(eaeltsin): we might use address size instead of pointer size to
212 distinguish between i386 and x86_64... At least address size is not 218 distinguish between i386 and x86_64... At least address size is not
213 a property of the data model. */ 219 a property of the data model. */
214 set_gdbarch_addr_bit (gdbarch, 64); 220 set_gdbarch_addr_bit (gdbarch, 64);
215 221
216 /* How to extract addresses from registers. */ 222 /* How to extract addresses from registers. */
217 set_gdbarch_addr_bits_remove (gdbarch, amd64_nacl_addr_bits_remove); 223 set_gdbarch_addr_bits_remove (gdbarch, amd64_nacl_addr_bits_remove);
218 set_gdbarch_unwind_pc (gdbarch, amd64_nacl_unwind_pc); 224 set_gdbarch_unwind_pc (gdbarch, amd64_nacl_unwind_pc);
219 set_gdbarch_unwind_sp (gdbarch, amd64_nacl_unwind_sp); 225 set_gdbarch_unwind_sp (gdbarch, amd64_nacl_unwind_sp);
226 set_gdbarch_inner_than (gdbarch, amd64_nacl_inner_than);
220 227
221 /* Where to set breakpoints. */ 228 /* Where to set breakpoints. */
222 set_gdbarch_adjust_breakpoint_address (gdbarch, 229 set_gdbarch_adjust_breakpoint_address (gdbarch,
223 amd64_nacl_adjust_breakpoint_address); 230 amd64_nacl_adjust_breakpoint_address);
224 set_gdbarch_software_single_step (gdbarch, amd64_nacl_software_single_step); 231 set_gdbarch_software_single_step (gdbarch, amd64_nacl_software_single_step);
225 /* Recognizing dummy frames. */ 232 /* Recognizing dummy frames. */
226 set_gdbarch_dummy_id(gdbarch, amd64_nacl_dummy_id); 233 set_gdbarch_dummy_id(gdbarch, amd64_nacl_dummy_id);
227 } 234 }
228 235
229 /* Provide a prototype to silence -Wmissing-prototypes. */ 236 /* Provide a prototype to silence -Wmissing-prototypes. */
230 extern void _initialize_nacl_tdep (void); 237 extern void _initialize_nacl_tdep (void);
231 238
232 void 239 void
233 _initialize_nacl_tdep (void) 240 _initialize_nacl_tdep (void)
234 { 241 {
235 gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, 242 gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour,
236 nacl_osabi_sniffer); 243 nacl_osabi_sniffer);
237 244
238 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, 245 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
239 GDB_OSABI_NACL, amd64_nacl_init_abi); 246 GDB_OSABI_NACL, amd64_nacl_init_abi);
240 247
241 gdbarch_register_osabi (bfd_arch_i386, 0, 248 gdbarch_register_osabi (bfd_arch_i386, 0,
242 GDB_OSABI_NACL, i386_nacl_init_abi); 249 GDB_OSABI_NACL, i386_nacl_init_abi);
243 } 250 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698