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 Contributed by Jiri Smid, SuSE Labs. | |
5 | 4 |
6 This file is part of GDB. | 5 This file is part of GDB. |
7 | 6 |
8 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 |
9 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 |
10 the Free Software Foundation; either version 3 of the License, or | 9 the Free Software Foundation; either version 3 of the License, or |
11 (at your option) any later version. | 10 (at your option) any later version. |
12 | 11 |
13 This program is distributed in the hope that it will be useful, | 12 This program is distributed in the hope that it will be useful, |
14 but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 GNU General Public License for more details. | 15 GNU General Public License for more details. |
17 | 16 |
18 You should have received a copy of the GNU General Public License | 17 You should have received a copy of the GNU General Public License |
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */ | 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
20 | 19 |
21 #include "defs.h" | 20 #include "defs.h" |
22 #include "amd64-linux-tdep.h" | 21 #include "amd64-linux-tdep.h" |
23 #include "i386-linux-tdep.h" | 22 #include "i386-linux-tdep.h" |
24 #include "linux-tdep.h" | 23 #include "linux-tdep.h" |
25 #include "amd64-tdep.h" | 24 #include "amd64-tdep.h" |
26 #include "nacl-manifest.h" | 25 #include "nacl-manifest.h" |
27 #include "symtab.h" | 26 #include "symtab.h" |
28 #include "solib-svr4.h" | 27 #include "solib-svr4.h" |
29 | 28 |
30 static void | 29 static void |
31 nacl_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch) | 30 nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) |
32 { | 31 { |
33 /* NaCl uses SVR4-style shared libraries. */ | 32 /* NaCl uses SVR4-style shared libraries. */ |
34 set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); | 33 set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); |
35 set_solib_svr4_map_so_name (gdbarch, nacl_manifest_find); | 34 set_solib_svr4_map_so_name (gdbarch, nacl_manifest_find); |
36 set_gdbarch_process_record (gdbarch, i386_process_record); | 35 set_gdbarch_process_record (gdbarch, i386_process_record); |
37 } | 36 } |
38 | 37 |
39 static void | 38 static void |
40 i386_nacl_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch) | 39 i386_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) |
41 { | 40 { |
42 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); | 41 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); |
43 linux_init_abi (info, gdbarch); | 42 linux_init_abi (info, gdbarch); |
44 i386_elf_init_abi (info, gdbarch); | 43 i386_elf_init_abi (info, gdbarch); |
45 tdep->tdesc = tdesc_i386_linux; | 44 tdep->tdesc = tdesc_i386_linux; |
46 set_solib_svr4_fetch_link_map_offsets (gdbarch, | 45 set_solib_svr4_fetch_link_map_offsets (gdbarch, |
47 svr4_ilp32_fetch_link_map_offsets); | 46 » » » » » svr4_ilp32_fetch_link_map_offsets); |
48 nacl_init_abi (info, gdbarch); | 47 nacl_init_abi (info, gdbarch); |
49 } | 48 } |
50 | 49 |
51 static void | 50 static void |
52 amd64_nacl_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch) | 51 amd64_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) |
53 { | 52 { |
54 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); | 53 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); |
55 linux_init_abi (info, gdbarch); | 54 linux_init_abi (info, gdbarch); |
56 amd64_init_abi (info, gdbarch); | 55 amd64_init_abi (info, gdbarch); |
57 tdep->tdesc = tdesc_amd64_linux; | 56 tdep->tdesc = tdesc_amd64_linux; |
58 set_solib_svr4_fetch_link_map_offsets (gdbarch, | 57 set_solib_svr4_fetch_link_map_offsets (gdbarch, |
59 svr4_lp64_fetch_link_map_offsets); | 58 » » » » » svr4_lp64_fetch_link_map_offsets); |
60 nacl_init_abi (info, gdbarch); | 59 nacl_init_abi (info, gdbarch); |
61 } | 60 } |
62 | 61 |
63 /* Provide a prototype to silence -Wmissing-prototypes. */ | 62 /* Provide a prototype to silence -Wmissing-prototypes. */ |
64 extern void _initialize_nacl_tdep (void); | 63 extern void _initialize_nacl_tdep (void); |
65 | 64 |
66 void | 65 void |
67 _initialize_nacl_tdep (void) | 66 _initialize_nacl_tdep (void) |
68 { | 67 { |
69 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, | 68 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, |
70 GDB_OSABI_NACL, amd64_nacl_init_abi); | 69 GDB_OSABI_NACL, amd64_nacl_init_abi); |
71 | 70 |
72 gdbarch_register_osabi(bfd_arch_i386, 0, | 71 gdbarch_register_osabi (bfd_arch_i386, 0, |
73 GDB_OSABI_NACL, i386_nacl_init_abi); | 72 » » » GDB_OSABI_NACL, i386_nacl_init_abi); |
74 } | 73 } |
OLD | NEW |