| 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 13 matching lines...) Expand all Loading... |
| 24 #include "amd64-tdep.h" | 24 #include "amd64-tdep.h" |
| 25 #include "nacl-manifest.h" | 25 #include "nacl-manifest.h" |
| 26 #include "symtab.h" | 26 #include "symtab.h" |
| 27 #include "solib-svr4.h" | 27 #include "solib-svr4.h" |
| 28 #include "frame.h" | 28 #include "frame.h" |
| 29 #include "osabi.h" | 29 #include "osabi.h" |
| 30 #include "disasm.h" | 30 #include "disasm.h" |
| 31 #include "breakpoint.h" | 31 #include "breakpoint.h" |
| 32 #include "target.h" | 32 #include "target.h" |
| 33 #include "elf-bfd.h" | 33 #include "elf-bfd.h" |
| 34 #include "inferior.h" |
| 34 | 35 |
| 35 static enum gdb_osabi | 36 static enum gdb_osabi |
| 36 nacl_osabi_sniffer (bfd *abfd) | 37 nacl_osabi_sniffer (bfd *abfd) |
| 37 { | 38 { |
| 38 /* WARNING! This way of checking for NaCl OS ABI is deprecated. | 39 /* WARNING! This way of checking for NaCl OS ABI is deprecated. |
| 39 See http://code.google.com/p/nativeclient/issues/detail?id=2971 */ | 40 See http://code.google.com/p/nativeclient/issues/detail?id=2971 */ |
| 40 if (bfd_get_flavour (abfd) == bfd_target_elf_flavour && | 41 if (bfd_get_flavour (abfd) == bfd_target_elf_flavour && |
| 41 elf_elfheader (abfd)->e_ident[EI_OSABI] == 123) | 42 elf_elfheader (abfd)->e_ident[EI_OSABI] == 123) |
| 42 return GDB_OSABI_NACL; | 43 return GDB_OSABI_NACL; |
| 43 | 44 |
| 44 return GDB_OSABI_UNKNOWN; | 45 return GDB_OSABI_UNKNOWN; |
| 45 } | 46 } |
| 46 | 47 |
| 47 static void | 48 static void |
| 48 nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) | 49 nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) |
| 49 { | 50 { |
| 50 /* NaCl uses SVR4-style shared libraries. */ | 51 /* NaCl uses SVR4-style shared libraries. */ |
| 51 set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); | 52 set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); |
| 52 set_solib_svr4_map_so_name (gdbarch, nacl_manifest_find); | 53 set_solib_svr4_map_so_name (gdbarch, nacl_manifest_find); |
| 53 set_gdbarch_process_record (gdbarch, i386_process_record); | 54 set_gdbarch_process_record (gdbarch, i386_process_record); |
| 55 set_gdbarch_call_dummy_location(gdbarch, AT_ENTRY_POINT); |
| 54 } | 56 } |
| 55 | 57 |
| 56 static void | 58 static void |
| 57 i386_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) | 59 i386_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) |
| 58 { | 60 { |
| 59 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); | 61 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); |
| 60 linux_init_abi (info, gdbarch); | 62 linux_init_abi (info, gdbarch); |
| 61 i386_elf_init_abi (info, gdbarch); | 63 i386_elf_init_abi (info, gdbarch); |
| 62 tdep->tdesc = tdesc_i386_linux; | 64 tdep->tdesc = tdesc_i386_linux; |
| 63 set_solib_svr4_fetch_link_map_offsets (gdbarch, | 65 set_solib_svr4_fetch_link_map_offsets (gdbarch, |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 { | 224 { |
| 223 gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, | 225 gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, |
| 224 nacl_osabi_sniffer); | 226 nacl_osabi_sniffer); |
| 225 | 227 |
| 226 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, | 228 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, |
| 227 GDB_OSABI_NACL, amd64_nacl_init_abi); | 229 GDB_OSABI_NACL, amd64_nacl_init_abi); |
| 228 | 230 |
| 229 gdbarch_register_osabi (bfd_arch_i386, 0, | 231 gdbarch_register_osabi (bfd_arch_i386, 0, |
| 230 GDB_OSABI_NACL, i386_nacl_init_abi); | 232 GDB_OSABI_NACL, i386_nacl_init_abi); |
| 231 } | 233 } |
| OLD | NEW |