Commit | Line | Data |
---|---|---|
59233f88 AC |
1 | /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ |
2 | ||
adf40b2e | 3 | /* Dynamic architecture support for GDB, the GNU debugger. |
79d45cd4 | 4 | |
de584861 | 5 | Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 |
424163ea | 6 | Free Software Foundation, Inc. |
c906108c | 7 | |
96baa820 JM |
8 | This file is part of GDB. |
9 | ||
10 | This program is free software; you can redistribute it and/or modify | |
11 | it under the terms of the GNU General Public License as published by | |
a9762ec7 | 12 | the Free Software Foundation; either version 3 of the License, or |
96baa820 | 13 | (at your option) any later version. |
de584861 | 14 | |
96baa820 JM |
15 | This program is distributed in the hope that it will be useful, |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | GNU General Public License for more details. | |
de584861 | 19 | |
96baa820 | 20 | You should have received a copy of the GNU General Public License |
a9762ec7 | 21 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
adf40b2e | 22 | |
104c1213 JM |
23 | /* This file was created with the aid of ``gdbarch.sh''. |
24 | ||
52204a0b | 25 | The Bourne shell script ``gdbarch.sh'' creates the files |
104c1213 JM |
26 | ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them |
27 | against the existing ``gdbarch.[hc]''. Any differences found | |
28 | being reported. | |
29 | ||
30 | If editing this file, please also run gdbarch.sh and merge any | |
52204a0b | 31 | changes into that script. Conversely, when making sweeping changes |
104c1213 JM |
32 | to this file, modifying gdbarch.sh and using its output may prove |
33 | easier. */ | |
c906108c | 34 | |
c906108c SS |
35 | |
36 | #include "defs.h" | |
1ad03bde | 37 | #include "arch-utils.h" |
c906108c | 38 | |
0f71a2f6 | 39 | #include "gdbcmd.h" |
faaf634c | 40 | #include "inferior.h" |
7a292a7a | 41 | #include "symcat.h" |
c906108c | 42 | |
f0d4cc9e | 43 | #include "floatformat.h" |
c906108c | 44 | |
95160752 | 45 | #include "gdb_assert.h" |
b66d6d2e | 46 | #include "gdb_string.h" |
b59ff9d5 | 47 | #include "reggroups.h" |
4be87837 | 48 | #include "osabi.h" |
aebd7893 | 49 | #include "gdb_obstack.h" |
383f836e | 50 | #include "observer.h" |
a3ecef73 | 51 | #include "regcache.h" |
95160752 | 52 | |
104c1213 JM |
53 | /* Static function declarations */ |
54 | ||
b3cc3077 | 55 | static void alloc_gdbarch_data (struct gdbarch *); |
104c1213 | 56 | |
0f71a2f6 JM |
57 | /* Non-zero if we want to trace architecture code. */ |
58 | ||
59 | #ifndef GDBARCH_DEBUG | |
60 | #define GDBARCH_DEBUG 0 | |
61 | #endif | |
62 | int gdbarch_debug = GDBARCH_DEBUG; | |
920d2a44 AC |
63 | static void |
64 | show_gdbarch_debug (struct ui_file *file, int from_tty, | |
65 | struct cmd_list_element *c, const char *value) | |
66 | { | |
67 | fprintf_filtered (file, _("Architecture debugging is %s.\n"), value); | |
68 | } | |
0f71a2f6 | 69 | |
456fcf94 | 70 | static const char * |
8da61cc4 | 71 | pformat (const struct floatformat **format) |
456fcf94 AC |
72 | { |
73 | if (format == NULL) | |
74 | return "(null)"; | |
75 | else | |
8da61cc4 DJ |
76 | /* Just print out one of them - this is only for diagnostics. */ |
77 | return format[0]->name; | |
456fcf94 AC |
78 | } |
79 | ||
0f71a2f6 JM |
80 | |
81 | /* Maintain the struct gdbarch object */ | |
82 | ||
83 | struct gdbarch | |
adf40b2e | 84 | { |
76860b5f AC |
85 | /* Has this architecture been fully initialized? */ |
86 | int initialized_p; | |
aebd7893 AC |
87 | |
88 | /* An obstack bound to the lifetime of the architecture. */ | |
89 | struct obstack *obstack; | |
90 | ||
adf40b2e JM |
91 | /* basic architectural information */ |
92 | const struct bfd_arch_info * bfd_arch_info; | |
93 | int byte_order; | |
9d4fde75 | 94 | int byte_order_for_code; |
4be87837 | 95 | enum gdb_osabi osabi; |
424163ea | 96 | const struct target_desc * target_desc; |
0f71a2f6 | 97 | |
adf40b2e JM |
98 | /* target specific vector. */ |
99 | struct gdbarch_tdep *tdep; | |
4b9b3959 | 100 | gdbarch_dump_tdep_ftype *dump_tdep; |
0f71a2f6 | 101 | |
adf40b2e | 102 | /* per-architecture data-pointers */ |
95160752 | 103 | unsigned nr_data; |
adf40b2e | 104 | void **data; |
0f71a2f6 | 105 | |
adf40b2e JM |
106 | /* per-architecture swap-regions */ |
107 | struct gdbarch_swap *swap; | |
0f71a2f6 | 108 | |
adf40b2e | 109 | /* Multi-arch values. |
0f71a2f6 | 110 | |
adf40b2e | 111 | When extending this structure you must: |
0f71a2f6 | 112 | |
adf40b2e | 113 | Add the field below. |
0f71a2f6 | 114 | |
adf40b2e JM |
115 | Declare set/get functions and define the corresponding |
116 | macro in gdbarch.h. | |
0f71a2f6 | 117 | |
adf40b2e JM |
118 | gdbarch_alloc(): If zero/NULL is not a suitable default, |
119 | initialize the new field. | |
0f71a2f6 | 120 | |
adf40b2e JM |
121 | verify_gdbarch(): Confirm that the target updated the field |
122 | correctly. | |
0f71a2f6 | 123 | |
7e73cedf | 124 | gdbarch_dump(): Add a fprintf_unfiltered call so that the new |
adf40b2e | 125 | field is dumped out |
0f71a2f6 | 126 | |
c0e8c252 | 127 | ``startup_gdbarch()'': Append an initial value to the static |
adf40b2e | 128 | variable (base values on the host's c-type system). |
0f71a2f6 | 129 | |
adf40b2e JM |
130 | get_gdbarch(): Implement the set/get functions (probably using |
131 | the macro's as shortcuts). | |
0f71a2f6 JM |
132 | |
133 | */ | |
134 | ||
32c9a795 | 135 | int bits_big_endian; |
adf40b2e JM |
136 | int short_bit; |
137 | int int_bit; | |
138 | int long_bit; | |
139 | int long_long_bit; | |
140 | int float_bit; | |
8da61cc4 | 141 | const struct floatformat ** float_format; |
adf40b2e | 142 | int double_bit; |
8da61cc4 | 143 | const struct floatformat ** double_format; |
adf40b2e | 144 | int long_double_bit; |
8da61cc4 | 145 | const struct floatformat ** long_double_format; |
66b43ecb | 146 | int ptr_bit; |
52204a0b | 147 | int addr_bit; |
4e409299 | 148 | int char_signed; |
adf40b2e JM |
149 | gdbarch_read_pc_ftype *read_pc; |
150 | gdbarch_write_pc_ftype *write_pc; | |
39d4ef09 | 151 | gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer; |
d8124050 AC |
152 | gdbarch_pseudo_register_read_ftype *pseudo_register_read; |
153 | gdbarch_pseudo_register_write_ftype *pseudo_register_write; | |
adf40b2e | 154 | int num_regs; |
0aba1244 | 155 | int num_pseudo_regs; |
adf40b2e | 156 | int sp_regnum; |
adf40b2e | 157 | int pc_regnum; |
c2169756 | 158 | int ps_regnum; |
60054393 | 159 | int fp0_regnum; |
88c72b7d AC |
160 | gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum; |
161 | gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum; | |
88c72b7d AC |
162 | gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum; |
163 | gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum; | |
adf40b2e | 164 | gdbarch_register_name_ftype *register_name; |
9c04cab7 | 165 | gdbarch_register_type_ftype *register_type; |
669fac23 | 166 | gdbarch_dummy_id_ftype *dummy_id; |
f3be58bc | 167 | int deprecated_fp_regnum; |
b8de8283 | 168 | gdbarch_push_dummy_call_ftype *push_dummy_call; |
adf40b2e | 169 | int call_dummy_location; |
7043d8dc | 170 | gdbarch_push_dummy_code_ftype *push_dummy_code; |
b8de8283 AC |
171 | gdbarch_print_registers_info_ftype *print_registers_info; |
172 | gdbarch_print_float_info_ftype *print_float_info; | |
173 | gdbarch_print_vector_info_ftype *print_vector_info; | |
174 | gdbarch_register_sim_regno_ftype *register_sim_regno; | |
b8de8283 AC |
175 | gdbarch_cannot_fetch_register_ftype *cannot_fetch_register; |
176 | gdbarch_cannot_store_register_ftype *cannot_store_register; | |
177 | gdbarch_get_longjmp_target_ftype *get_longjmp_target; | |
adf40b2e | 178 | int believe_pcc_promotion; |
13d01224 AC |
179 | gdbarch_convert_register_p_ftype *convert_register_p; |
180 | gdbarch_register_to_value_ftype *register_to_value; | |
181 | gdbarch_value_to_register_ftype *value_to_register; | |
9acbedc0 | 182 | gdbarch_value_from_register_ftype *value_from_register; |
4478b372 JB |
183 | gdbarch_pointer_to_address_ftype *pointer_to_address; |
184 | gdbarch_address_to_pointer_ftype *address_to_pointer; | |
fc0c74b1 | 185 | gdbarch_integer_to_address_ftype *integer_to_address; |
92ad9cd9 | 186 | gdbarch_return_value_ftype *return_value; |
adf40b2e | 187 | gdbarch_skip_prologue_ftype *skip_prologue; |
4309257c | 188 | gdbarch_skip_main_prologue_ftype *skip_main_prologue; |
adf40b2e JM |
189 | gdbarch_inner_than_ftype *inner_than; |
190 | gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc; | |
a1131521 | 191 | gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address; |
917317f4 JM |
192 | gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint; |
193 | gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint; | |
adf40b2e | 194 | CORE_ADDR decr_pc_after_break; |
782263ab | 195 | CORE_ADDR deprecated_function_start_offset; |
123dc839 | 196 | gdbarch_remote_register_number_ftype *remote_register_number; |
b2756930 | 197 | gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address; |
adf40b2e | 198 | CORE_ADDR frame_args_skip; |
12cc2063 | 199 | gdbarch_unwind_pc_ftype *unwind_pc; |
a9e5fdc2 | 200 | gdbarch_unwind_sp_ftype *unwind_sp; |
adf40b2e | 201 | gdbarch_frame_num_args_ftype *frame_num_args; |
dc604539 | 202 | gdbarch_frame_align_ftype *frame_align; |
192cb3d4 | 203 | gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr; |
8b148df9 | 204 | int frame_red_zone_size; |
f517ea4e | 205 | gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr; |
875e1767 | 206 | gdbarch_addr_bits_remove_ftype *addr_bits_remove; |
181c1381 | 207 | gdbarch_smash_text_address_ftype *smash_text_address; |
64c4637f | 208 | gdbarch_software_single_step_ftype *software_single_step; |
3352ef37 | 209 | gdbarch_single_step_through_delay_ftype *single_step_through_delay; |
2bf0cb65 | 210 | gdbarch_print_insn_ftype *print_insn; |
bdcd319a | 211 | gdbarch_skip_trampoline_code_ftype *skip_trampoline_code; |
dea0c52f | 212 | gdbarch_skip_solib_resolver_ftype *skip_solib_resolver; |
d50355b6 | 213 | gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline; |
c12260ac | 214 | gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p; |
552c04a7 | 215 | gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments; |
a2cf933a EZ |
216 | gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special; |
217 | gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special; | |
c4ed33b9 | 218 | int cannot_step_breakpoint; |
f74fa174 | 219 | int have_nonsteppable_watchpoint; |
8b2dbe47 KB |
220 | gdbarch_address_class_type_flags_ftype *address_class_type_flags; |
221 | gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name; | |
222 | gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags; | |
b59ff9d5 | 223 | gdbarch_register_reggroup_p_ftype *register_reggroup_p; |
143985b7 | 224 | gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument; |
6ce6d90f | 225 | gdbarch_regset_from_core_section_ftype *regset_from_core_section; |
959b8724 | 226 | int core_reg_section_encodes_pid; |
17ea7499 | 227 | struct core_regset_section * core_regset_sections; |
de584861 | 228 | gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries; |
0d5de010 DJ |
229 | int vtable_function_descriptors; |
230 | int vbit_in_delta; | |
6d350bb5 | 231 | gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint; |
237fc4c9 PA |
232 | ULONGEST max_insn_length; |
233 | gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn; | |
234 | gdbarch_displaced_step_fixup_ftype *displaced_step_fixup; | |
235 | gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure; | |
236 | gdbarch_displaced_step_location_ftype *displaced_step_location; | |
1c772458 | 237 | gdbarch_overlay_update_ftype *overlay_update; |
4eb0ad19 | 238 | gdbarch_core_read_description_ftype *core_read_description; |
149ad273 | 239 | gdbarch_static_transform_name_ftype *static_transform_name; |
203c3895 | 240 | int sofun_address_maybe_missing; |
1cded358 AR |
241 | gdbarch_target_signal_from_host_ftype *target_signal_from_host; |
242 | gdbarch_target_signal_to_host_ftype *target_signal_to_host; | |
4aa995e1 | 243 | gdbarch_get_siginfo_type_ftype *get_siginfo_type; |
60c5725c | 244 | gdbarch_record_special_symbol_ftype *record_special_symbol; |
50c71eaf | 245 | int has_global_solist; |
adf40b2e | 246 | }; |
0f71a2f6 JM |
247 | |
248 | ||
249 | /* The default architecture uses host values (for want of a better | |
250 | choice). */ | |
251 | ||
252 | extern const struct bfd_arch_info bfd_default_arch_struct; | |
253 | ||
4b9b3959 AC |
254 | struct gdbarch startup_gdbarch = |
255 | { | |
76860b5f | 256 | 1, /* Always initialized. */ |
aebd7893 | 257 | NULL, /* The obstack. */ |
0f71a2f6 | 258 | /* basic architecture information */ |
ec5cbaec AC |
259 | &bfd_default_arch_struct, /* bfd_arch_info */ |
260 | BFD_ENDIAN_BIG, /* byte_order */ | |
9d4fde75 | 261 | BFD_ENDIAN_BIG, /* byte_order_for_code */ |
ec5cbaec | 262 | GDB_OSABI_UNKNOWN, /* osabi */ |
424163ea | 263 | 0, /* target_desc */ |
4b9b3959 AC |
264 | /* target specific vector and its dump routine */ |
265 | NULL, NULL, | |
0f71a2f6 JM |
266 | /*per-architecture data-pointers and swap regions */ |
267 | 0, NULL, NULL, | |
268 | /* Multi-arch values */ | |
32c9a795 | 269 | 1, /* bits_big_endian */ |
ec5cbaec AC |
270 | 8 * sizeof (short), /* short_bit */ |
271 | 8 * sizeof (int), /* int_bit */ | |
272 | 8 * sizeof (long), /* long_bit */ | |
273 | 8 * sizeof (LONGEST), /* long_long_bit */ | |
274 | 8 * sizeof (float), /* float_bit */ | |
456fcf94 | 275 | 0, /* float_format */ |
ec5cbaec | 276 | 8 * sizeof (double), /* double_bit */ |
456fcf94 | 277 | 0, /* double_format */ |
ec5cbaec | 278 | 8 * sizeof (long double), /* long_double_bit */ |
456fcf94 | 279 | 0, /* long_double_format */ |
ec5cbaec AC |
280 | 8 * sizeof (void*), /* ptr_bit */ |
281 | 8 * sizeof (void*), /* addr_bit */ | |
ec5cbaec AC |
282 | 1, /* char_signed */ |
283 | 0, /* read_pc */ | |
284 | 0, /* write_pc */ | |
a54fba4c | 285 | legacy_virtual_frame_pointer, /* virtual_frame_pointer */ |
ec5cbaec AC |
286 | 0, /* pseudo_register_read */ |
287 | 0, /* pseudo_register_write */ | |
288 | 0, /* num_regs */ | |
289 | 0, /* num_pseudo_regs */ | |
290 | -1, /* sp_regnum */ | |
ec5cbaec AC |
291 | -1, /* pc_regnum */ |
292 | -1, /* ps_regnum */ | |
293 | 0, /* fp0_regnum */ | |
d3f73121 MD |
294 | no_op_reg_to_regnum, /* stab_reg_to_regnum */ |
295 | no_op_reg_to_regnum, /* ecoff_reg_to_regnum */ | |
d3f73121 MD |
296 | no_op_reg_to_regnum, /* sdb_reg_to_regnum */ |
297 | no_op_reg_to_regnum, /* dwarf2_reg_to_regnum */ | |
ec5cbaec | 298 | 0, /* register_name */ |
9c04cab7 | 299 | 0, /* register_type */ |
669fac23 | 300 | 0, /* dummy_id */ |
f3be58bc | 301 | -1, /* deprecated_fp_regnum */ |
b8de8283 | 302 | 0, /* push_dummy_call */ |
ec5cbaec | 303 | 0, /* call_dummy_location */ |
ec5cbaec | 304 | 0, /* push_dummy_code */ |
b8de8283 AC |
305 | default_print_registers_info, /* print_registers_info */ |
306 | 0, /* print_float_info */ | |
307 | 0, /* print_vector_info */ | |
e7faf938 | 308 | legacy_register_sim_regno, /* register_sim_regno */ |
64a3914f MD |
309 | cannot_register_not, /* cannot_fetch_register */ |
310 | cannot_register_not, /* cannot_store_register */ | |
b8de8283 | 311 | 0, /* get_longjmp_target */ |
ec5cbaec | 312 | 0, /* believe_pcc_promotion */ |
0abe36f5 | 313 | generic_convert_register_p, /* convert_register_p */ |
ec5cbaec AC |
314 | 0, /* register_to_value */ |
315 | 0, /* value_to_register */ | |
9acbedc0 | 316 | 0, /* value_from_register */ |
ec5cbaec AC |
317 | 0, /* pointer_to_address */ |
318 | 0, /* address_to_pointer */ | |
319 | 0, /* integer_to_address */ | |
92ad9cd9 | 320 | 0, /* return_value */ |
ec5cbaec | 321 | 0, /* skip_prologue */ |
4309257c | 322 | 0, /* skip_main_prologue */ |
ec5cbaec AC |
323 | 0, /* inner_than */ |
324 | 0, /* breakpoint_from_pc */ | |
a1131521 | 325 | 0, /* adjust_breakpoint_address */ |
ae4b2284 MD |
326 | default_memory_insert_breakpoint, /* memory_insert_breakpoint */ |
327 | default_memory_remove_breakpoint, /* memory_remove_breakpoint */ | |
ec5cbaec | 328 | 0, /* decr_pc_after_break */ |
782263ab | 329 | 0, /* deprecated_function_start_offset */ |
123dc839 | 330 | default_remote_register_number, /* remote_register_number */ |
b2756930 | 331 | 0, /* fetch_tls_load_module_address */ |
ec5cbaec | 332 | 0, /* frame_args_skip */ |
ec5cbaec | 333 | 0, /* unwind_pc */ |
a9e5fdc2 | 334 | 0, /* unwind_sp */ |
ec5cbaec | 335 | 0, /* frame_num_args */ |
ec5cbaec | 336 | 0, /* frame_align */ |
192cb3d4 | 337 | default_stabs_argument_has_addr, /* stabs_argument_has_addr */ |
8b148df9 | 338 | 0, /* frame_red_zone_size */ |
e2d0e7eb | 339 | convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */ |
24568a2c UW |
340 | core_addr_identity, /* addr_bits_remove */ |
341 | core_addr_identity, /* smash_text_address */ | |
ec5cbaec | 342 | 0, /* software_single_step */ |
3352ef37 | 343 | 0, /* single_step_through_delay */ |
ec5cbaec AC |
344 | 0, /* print_insn */ |
345 | 0, /* skip_trampoline_code */ | |
4c8c40e6 | 346 | generic_skip_solib_resolver, /* skip_solib_resolver */ |
ec5cbaec | 347 | 0, /* in_solib_return_trampoline */ |
ec5cbaec AC |
348 | generic_in_function_epilogue_p, /* in_function_epilogue_p */ |
349 | construct_inferior_arguments, /* construct_inferior_arguments */ | |
ec5cbaec AC |
350 | 0, /* elf_make_msymbol_special */ |
351 | 0, /* coff_make_msymbol_special */ | |
ec5cbaec AC |
352 | 0, /* cannot_step_breakpoint */ |
353 | 0, /* have_nonsteppable_watchpoint */ | |
354 | 0, /* address_class_type_flags */ | |
355 | 0, /* address_class_type_flags_to_name */ | |
356 | 0, /* address_class_name_to_type_flags */ | |
357 | default_register_reggroup_p, /* register_reggroup_p */ | |
358 | 0, /* fetch_pointer_argument */ | |
6ce6d90f | 359 | 0, /* regset_from_core_section */ |
959b8724 | 360 | 0, /* core_reg_section_encodes_pid */ |
17ea7499 | 361 | 0, /* core_regset_sections */ |
de584861 | 362 | 0, /* core_xfer_shared_libraries */ |
0d5de010 DJ |
363 | 0, /* vtable_function_descriptors */ |
364 | 0, /* vbit_in_delta */ | |
6d350bb5 | 365 | 0, /* skip_permanent_breakpoint */ |
237fc4c9 PA |
366 | 0, /* max_insn_length */ |
367 | 0, /* displaced_step_copy_insn */ | |
368 | 0, /* displaced_step_fixup */ | |
369 | NULL, /* displaced_step_free_closure */ | |
370 | NULL, /* displaced_step_location */ | |
1c772458 | 371 | 0, /* overlay_update */ |
4eb0ad19 | 372 | 0, /* core_read_description */ |
149ad273 | 373 | 0, /* static_transform_name */ |
203c3895 | 374 | 0, /* sofun_address_maybe_missing */ |
1cded358 AR |
375 | default_target_signal_from_host, /* target_signal_from_host */ |
376 | default_target_signal_to_host, /* target_signal_to_host */ | |
4aa995e1 | 377 | 0, /* get_siginfo_type */ |
60c5725c | 378 | 0, /* record_special_symbol */ |
50c71eaf | 379 | 0, /* has_global_solist */ |
c0e8c252 | 380 | /* startup_gdbarch() */ |
0f71a2f6 | 381 | }; |
4b9b3959 | 382 | |
c0e8c252 | 383 | struct gdbarch *current_gdbarch = &startup_gdbarch; |
1cf3db46 | 384 | struct gdbarch *target_gdbarch = &startup_gdbarch; |
0f71a2f6 | 385 | |
66b43ecb | 386 | /* Create a new ``struct gdbarch'' based on information provided by |
0f71a2f6 JM |
387 | ``struct gdbarch_info''. */ |
388 | ||
389 | struct gdbarch * | |
104c1213 JM |
390 | gdbarch_alloc (const struct gdbarch_info *info, |
391 | struct gdbarch_tdep *tdep) | |
0f71a2f6 | 392 | { |
be7811ad | 393 | struct gdbarch *gdbarch; |
aebd7893 AC |
394 | |
395 | /* Create an obstack for allocating all the per-architecture memory, | |
396 | then use that to allocate the architecture vector. */ | |
397 | struct obstack *obstack = XMALLOC (struct obstack); | |
398 | obstack_init (obstack); | |
be7811ad MD |
399 | gdbarch = obstack_alloc (obstack, sizeof (*gdbarch)); |
400 | memset (gdbarch, 0, sizeof (*gdbarch)); | |
401 | gdbarch->obstack = obstack; | |
0f71a2f6 | 402 | |
be7811ad | 403 | alloc_gdbarch_data (gdbarch); |
b3cc3077 | 404 | |
be7811ad | 405 | gdbarch->tdep = tdep; |
0f71a2f6 | 406 | |
be7811ad MD |
407 | gdbarch->bfd_arch_info = info->bfd_arch_info; |
408 | gdbarch->byte_order = info->byte_order; | |
9d4fde75 | 409 | gdbarch->byte_order_for_code = info->byte_order_for_code; |
be7811ad MD |
410 | gdbarch->osabi = info->osabi; |
411 | gdbarch->target_desc = info->target_desc; | |
0f71a2f6 JM |
412 | |
413 | /* Force the explicit initialization of these. */ | |
32c9a795 | 414 | gdbarch->bits_big_endian = (gdbarch->byte_order == BFD_ENDIAN_BIG); |
be7811ad MD |
415 | gdbarch->short_bit = 2*TARGET_CHAR_BIT; |
416 | gdbarch->int_bit = 4*TARGET_CHAR_BIT; | |
417 | gdbarch->long_bit = 4*TARGET_CHAR_BIT; | |
418 | gdbarch->long_long_bit = 2*gdbarch->long_bit; | |
419 | gdbarch->float_bit = 4*TARGET_CHAR_BIT; | |
420 | gdbarch->double_bit = 8*TARGET_CHAR_BIT; | |
421 | gdbarch->long_double_bit = 8*TARGET_CHAR_BIT; | |
422 | gdbarch->ptr_bit = gdbarch->int_bit; | |
423 | gdbarch->char_signed = -1; | |
424 | gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer; | |
425 | gdbarch->num_regs = -1; | |
426 | gdbarch->sp_regnum = -1; | |
427 | gdbarch->pc_regnum = -1; | |
428 | gdbarch->ps_regnum = -1; | |
429 | gdbarch->fp0_regnum = -1; | |
430 | gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum; | |
431 | gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum; | |
be7811ad MD |
432 | gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum; |
433 | gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum; | |
434 | gdbarch->deprecated_fp_regnum = -1; | |
435 | gdbarch->call_dummy_location = AT_ENTRY_POINT; | |
436 | gdbarch->print_registers_info = default_print_registers_info; | |
437 | gdbarch->register_sim_regno = legacy_register_sim_regno; | |
438 | gdbarch->cannot_fetch_register = cannot_register_not; | |
439 | gdbarch->cannot_store_register = cannot_register_not; | |
440 | gdbarch->convert_register_p = generic_convert_register_p; | |
441 | gdbarch->value_from_register = default_value_from_register; | |
442 | gdbarch->pointer_to_address = unsigned_pointer_to_address; | |
443 | gdbarch->address_to_pointer = unsigned_address_to_pointer; | |
444 | gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint; | |
445 | gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint; | |
446 | gdbarch->remote_register_number = default_remote_register_number; | |
447 | gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr; | |
448 | gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity; | |
449 | gdbarch->addr_bits_remove = core_addr_identity; | |
450 | gdbarch->smash_text_address = core_addr_identity; | |
451 | gdbarch->skip_trampoline_code = generic_skip_trampoline_code; | |
452 | gdbarch->skip_solib_resolver = generic_skip_solib_resolver; | |
453 | gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline; | |
454 | gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p; | |
455 | gdbarch->construct_inferior_arguments = construct_inferior_arguments; | |
456 | gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special; | |
457 | gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special; | |
be7811ad | 458 | gdbarch->register_reggroup_p = default_register_reggroup_p; |
237fc4c9 PA |
459 | gdbarch->displaced_step_fixup = NULL; |
460 | gdbarch->displaced_step_free_closure = NULL; | |
461 | gdbarch->displaced_step_location = NULL; | |
1cded358 AR |
462 | gdbarch->target_signal_from_host = default_target_signal_from_host; |
463 | gdbarch->target_signal_to_host = default_target_signal_to_host; | |
0f71a2f6 JM |
464 | /* gdbarch_alloc() */ |
465 | ||
be7811ad | 466 | return gdbarch; |
0f71a2f6 JM |
467 | } |
468 | ||
469 | ||
aebd7893 AC |
470 | /* Allocate extra space using the per-architecture obstack. */ |
471 | ||
472 | void * | |
473 | gdbarch_obstack_zalloc (struct gdbarch *arch, long size) | |
474 | { | |
475 | void *data = obstack_alloc (arch->obstack, size); | |
476 | memset (data, 0, size); | |
477 | return data; | |
478 | } | |
479 | ||
480 | ||
058f20d5 JB |
481 | /* Free a gdbarch struct. This should never happen in normal |
482 | operation --- once you've created a gdbarch, you keep it around. | |
483 | However, if an architecture's init function encounters an error | |
484 | building the structure, it may need to clean up a partially | |
485 | constructed gdbarch. */ | |
4b9b3959 | 486 | |
058f20d5 JB |
487 | void |
488 | gdbarch_free (struct gdbarch *arch) | |
489 | { | |
aebd7893 | 490 | struct obstack *obstack; |
95160752 | 491 | gdb_assert (arch != NULL); |
aebd7893 AC |
492 | gdb_assert (!arch->initialized_p); |
493 | obstack = arch->obstack; | |
494 | obstack_free (obstack, 0); /* Includes the ARCH. */ | |
495 | xfree (obstack); | |
058f20d5 JB |
496 | } |
497 | ||
498 | ||
db446970 AC |
499 | /* Ensure that all values in a GDBARCH are reasonable. */ |
500 | ||
0f71a2f6 | 501 | static void |
be7811ad | 502 | verify_gdbarch (struct gdbarch *gdbarch) |
0f71a2f6 | 503 | { |
f16a1923 AC |
504 | struct ui_file *log; |
505 | struct cleanup *cleanups; | |
506 | long dummy; | |
507 | char *buf; | |
f16a1923 AC |
508 | log = mem_fileopen (); |
509 | cleanups = make_cleanup_ui_file_delete (log); | |
0f71a2f6 | 510 | /* fundamental */ |
be7811ad | 511 | if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN) |
f16a1923 | 512 | fprintf_unfiltered (log, "\n\tbyte-order"); |
be7811ad | 513 | if (gdbarch->bfd_arch_info == NULL) |
f16a1923 | 514 | fprintf_unfiltered (log, "\n\tbfd_arch_info"); |
0f71a2f6 | 515 | /* Check those that need to be defined for the given multi-arch level. */ |
32c9a795 | 516 | /* Skip verify of bits_big_endian, invalid_p == 0 */ |
66b43ecb AC |
517 | /* Skip verify of short_bit, invalid_p == 0 */ |
518 | /* Skip verify of int_bit, invalid_p == 0 */ | |
519 | /* Skip verify of long_bit, invalid_p == 0 */ | |
520 | /* Skip verify of long_long_bit, invalid_p == 0 */ | |
521 | /* Skip verify of float_bit, invalid_p == 0 */ | |
be7811ad MD |
522 | if (gdbarch->float_format == 0) |
523 | gdbarch->float_format = floatformats_ieee_single; | |
66b43ecb | 524 | /* Skip verify of double_bit, invalid_p == 0 */ |
be7811ad MD |
525 | if (gdbarch->double_format == 0) |
526 | gdbarch->double_format = floatformats_ieee_double; | |
66b43ecb | 527 | /* Skip verify of long_double_bit, invalid_p == 0 */ |
be7811ad MD |
528 | if (gdbarch->long_double_format == 0) |
529 | gdbarch->long_double_format = floatformats_ieee_double; | |
66b43ecb | 530 | /* Skip verify of ptr_bit, invalid_p == 0 */ |
be7811ad MD |
531 | if (gdbarch->addr_bit == 0) |
532 | gdbarch->addr_bit = gdbarch_ptr_bit (gdbarch); | |
533 | if (gdbarch->char_signed == -1) | |
534 | gdbarch->char_signed = 1; | |
cde9ea48 | 535 | /* Skip verify of read_pc, has predicate */ |
61a1198a | 536 | /* Skip verify of write_pc, has predicate */ |
39d4ef09 | 537 | /* Skip verify of virtual_frame_pointer, invalid_p == 0 */ |
d8124050 AC |
538 | /* Skip verify of pseudo_register_read, has predicate */ |
539 | /* Skip verify of pseudo_register_write, has predicate */ | |
be7811ad | 540 | if (gdbarch->num_regs == -1) |
f16a1923 | 541 | fprintf_unfiltered (log, "\n\tnum_regs"); |
0aba1244 | 542 | /* Skip verify of num_pseudo_regs, invalid_p == 0 */ |
1200cd6e | 543 | /* Skip verify of sp_regnum, invalid_p == 0 */ |
1200cd6e | 544 | /* Skip verify of pc_regnum, invalid_p == 0 */ |
c2169756 | 545 | /* Skip verify of ps_regnum, invalid_p == 0 */ |
60054393 | 546 | /* Skip verify of fp0_regnum, invalid_p == 0 */ |
88c72b7d AC |
547 | /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */ |
548 | /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */ | |
88c72b7d AC |
549 | /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */ |
550 | /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */ | |
be7811ad | 551 | if (gdbarch->register_name == 0) |
d93859e2 | 552 | fprintf_unfiltered (log, "\n\tregister_name"); |
9c04cab7 | 553 | /* Skip verify of register_type, has predicate */ |
669fac23 | 554 | /* Skip verify of dummy_id, has predicate */ |
f3be58bc | 555 | /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */ |
b8de8283 | 556 | /* Skip verify of push_dummy_call, has predicate */ |
b8de8283 | 557 | /* Skip verify of call_dummy_location, invalid_p == 0 */ |
b8de8283 | 558 | /* Skip verify of push_dummy_code, has predicate */ |
0ab7a791 | 559 | /* Skip verify of print_registers_info, invalid_p == 0 */ |
23e3a7ac | 560 | /* Skip verify of print_float_info, has predicate */ |
e76f1f2e | 561 | /* Skip verify of print_vector_info, has predicate */ |
7c7651b2 | 562 | /* Skip verify of register_sim_regno, invalid_p == 0 */ |
01fb7433 AC |
563 | /* Skip verify of cannot_fetch_register, invalid_p == 0 */ |
564 | /* Skip verify of cannot_store_register, invalid_p == 0 */ | |
9df628e0 | 565 | /* Skip verify of get_longjmp_target, has predicate */ |
13d01224 | 566 | /* Skip verify of convert_register_p, invalid_p == 0 */ |
9acbedc0 | 567 | /* Skip verify of value_from_register, invalid_p == 0 */ |
4478b372 JB |
568 | /* Skip verify of pointer_to_address, invalid_p == 0 */ |
569 | /* Skip verify of address_to_pointer, invalid_p == 0 */ | |
fc0c74b1 | 570 | /* Skip verify of integer_to_address, has predicate */ |
92ad9cd9 | 571 | /* Skip verify of return_value, has predicate */ |
be7811ad | 572 | if (gdbarch->skip_prologue == 0) |
f16a1923 | 573 | fprintf_unfiltered (log, "\n\tskip_prologue"); |
4309257c | 574 | /* Skip verify of skip_main_prologue, has predicate */ |
be7811ad | 575 | if (gdbarch->inner_than == 0) |
f16a1923 | 576 | fprintf_unfiltered (log, "\n\tinner_than"); |
be7811ad | 577 | if (gdbarch->breakpoint_from_pc == 0) |
aaab4dba | 578 | fprintf_unfiltered (log, "\n\tbreakpoint_from_pc"); |
a1131521 | 579 | /* Skip verify of adjust_breakpoint_address, has predicate */ |
c0e8c252 AC |
580 | /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */ |
581 | /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */ | |
71bd6bd4 | 582 | /* Skip verify of decr_pc_after_break, invalid_p == 0 */ |
782263ab | 583 | /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */ |
123dc839 | 584 | /* Skip verify of remote_register_number, invalid_p == 0 */ |
b2756930 | 585 | /* Skip verify of fetch_tls_load_module_address, has predicate */ |
5867a2fb | 586 | /* Skip verify of frame_args_skip, invalid_p == 0 */ |
12cc2063 | 587 | /* Skip verify of unwind_pc, has predicate */ |
a9e5fdc2 | 588 | /* Skip verify of unwind_sp, has predicate */ |
983a287a | 589 | /* Skip verify of frame_num_args, has predicate */ |
dc604539 | 590 | /* Skip verify of frame_align, has predicate */ |
192cb3d4 | 591 | /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */ |
f517ea4e | 592 | /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */ |
875e1767 | 593 | /* Skip verify of addr_bits_remove, invalid_p == 0 */ |
181c1381 | 594 | /* Skip verify of smash_text_address, invalid_p == 0 */ |
64c4637f | 595 | /* Skip verify of software_single_step, has predicate */ |
3352ef37 | 596 | /* Skip verify of single_step_through_delay, has predicate */ |
be7811ad | 597 | if (gdbarch->print_insn == 0) |
f6c40618 | 598 | fprintf_unfiltered (log, "\n\tprint_insn"); |
bdcd319a | 599 | /* Skip verify of skip_trampoline_code, invalid_p == 0 */ |
dea0c52f | 600 | /* Skip verify of skip_solib_resolver, invalid_p == 0 */ |
d50355b6 | 601 | /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */ |
c12260ac | 602 | /* Skip verify of in_function_epilogue_p, invalid_p == 0 */ |
552c04a7 | 603 | /* Skip verify of construct_inferior_arguments, invalid_p == 0 */ |
a2cf933a EZ |
604 | /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */ |
605 | /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */ | |
c4ed33b9 | 606 | /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */ |
f74fa174 | 607 | /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */ |
8b2dbe47 KB |
608 | /* Skip verify of address_class_type_flags, has predicate */ |
609 | /* Skip verify of address_class_type_flags_to_name, has predicate */ | |
610 | /* Skip verify of address_class_name_to_type_flags, has predicate */ | |
7e20f3fb | 611 | /* Skip verify of register_reggroup_p, invalid_p == 0 */ |
143985b7 | 612 | /* Skip verify of fetch_pointer_argument, has predicate */ |
6ce6d90f | 613 | /* Skip verify of regset_from_core_section, has predicate */ |
959b8724 | 614 | /* Skip verify of core_reg_section_encodes_pid, invalid_p == 0 */ |
de584861 | 615 | /* Skip verify of core_xfer_shared_libraries, has predicate */ |
0d5de010 DJ |
616 | /* Skip verify of vtable_function_descriptors, invalid_p == 0 */ |
617 | /* Skip verify of vbit_in_delta, invalid_p == 0 */ | |
6d350bb5 | 618 | /* Skip verify of skip_permanent_breakpoint, has predicate */ |
237fc4c9 PA |
619 | /* Skip verify of max_insn_length, has predicate */ |
620 | /* Skip verify of displaced_step_copy_insn, has predicate */ | |
621 | /* Skip verify of displaced_step_fixup, has predicate */ | |
622 | if ((! gdbarch->displaced_step_free_closure) != (! gdbarch->displaced_step_copy_insn)) | |
623 | fprintf_unfiltered (log, "\n\tdisplaced_step_free_closure"); | |
624 | if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn)) | |
625 | fprintf_unfiltered (log, "\n\tdisplaced_step_location"); | |
1c772458 | 626 | /* Skip verify of overlay_update, has predicate */ |
4eb0ad19 | 627 | /* Skip verify of core_read_description, has predicate */ |
149ad273 | 628 | /* Skip verify of static_transform_name, has predicate */ |
203c3895 | 629 | /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */ |
1cded358 AR |
630 | /* Skip verify of target_signal_from_host, invalid_p == 0 */ |
631 | /* Skip verify of target_signal_to_host, invalid_p == 0 */ | |
4aa995e1 | 632 | /* Skip verify of get_siginfo_type, has predicate */ |
60c5725c | 633 | /* Skip verify of record_special_symbol, has predicate */ |
50c71eaf | 634 | /* Skip verify of has_global_solist, invalid_p == 0 */ |
f16a1923 AC |
635 | buf = ui_file_xstrdup (log, &dummy); |
636 | make_cleanup (xfree, buf); | |
637 | if (strlen (buf) > 0) | |
638 | internal_error (__FILE__, __LINE__, | |
e2e0b3e5 | 639 | _("verify_gdbarch: the following are invalid ...%s"), |
f16a1923 AC |
640 | buf); |
641 | do_cleanups (cleanups); | |
0f71a2f6 JM |
642 | } |
643 | ||
644 | ||
645 | /* Print out the details of the current architecture. */ | |
646 | ||
647 | void | |
be7811ad | 648 | gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) |
0f71a2f6 | 649 | { |
b78960be | 650 | const char *gdb_nm_file = "<not-defined>"; |
b78960be AC |
651 | #if defined (GDB_NM_FILE) |
652 | gdb_nm_file = GDB_NM_FILE; | |
653 | #endif | |
654 | fprintf_unfiltered (file, | |
655 | "gdbarch_dump: GDB_NM_FILE = %s\n", | |
656 | gdb_nm_file); | |
48f7351b AC |
657 | fprintf_unfiltered (file, |
658 | "gdbarch_dump: addr_bit = %s\n", | |
623d3eb1 | 659 | plongest (gdbarch->addr_bit)); |
48f7351b | 660 | fprintf_unfiltered (file, |
30737ed9 JB |
661 | "gdbarch_dump: addr_bits_remove = <%s>\n", |
662 | host_address_to_string (gdbarch->addr_bits_remove)); | |
7996bcec AC |
663 | fprintf_unfiltered (file, |
664 | "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n", | |
be7811ad | 665 | gdbarch_address_class_name_to_type_flags_p (gdbarch)); |
7996bcec | 666 | fprintf_unfiltered (file, |
30737ed9 JB |
667 | "gdbarch_dump: address_class_name_to_type_flags = <%s>\n", |
668 | host_address_to_string (gdbarch->address_class_name_to_type_flags)); | |
48f7351b AC |
669 | fprintf_unfiltered (file, |
670 | "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n", | |
be7811ad | 671 | gdbarch_address_class_type_flags_p (gdbarch)); |
48f7351b | 672 | fprintf_unfiltered (file, |
30737ed9 JB |
673 | "gdbarch_dump: address_class_type_flags = <%s>\n", |
674 | host_address_to_string (gdbarch->address_class_type_flags)); | |
7996bcec AC |
675 | fprintf_unfiltered (file, |
676 | "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n", | |
be7811ad | 677 | gdbarch_address_class_type_flags_to_name_p (gdbarch)); |
7996bcec | 678 | fprintf_unfiltered (file, |
30737ed9 JB |
679 | "gdbarch_dump: address_class_type_flags_to_name = <%s>\n", |
680 | host_address_to_string (gdbarch->address_class_type_flags_to_name)); | |
48f7351b | 681 | fprintf_unfiltered (file, |
30737ed9 JB |
682 | "gdbarch_dump: address_to_pointer = <%s>\n", |
683 | host_address_to_string (gdbarch->address_to_pointer)); | |
a1131521 KB |
684 | fprintf_unfiltered (file, |
685 | "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n", | |
be7811ad | 686 | gdbarch_adjust_breakpoint_address_p (gdbarch)); |
a1131521 | 687 | fprintf_unfiltered (file, |
30737ed9 JB |
688 | "gdbarch_dump: adjust_breakpoint_address = <%s>\n", |
689 | host_address_to_string (gdbarch->adjust_breakpoint_address)); | |
48f7351b AC |
690 | fprintf_unfiltered (file, |
691 | "gdbarch_dump: believe_pcc_promotion = %s\n", | |
623d3eb1 | 692 | plongest (gdbarch->believe_pcc_promotion)); |
283354d8 | 693 | fprintf_unfiltered (file, |
48f7351b | 694 | "gdbarch_dump: bfd_arch_info = %s\n", |
be7811ad | 695 | gdbarch_bfd_arch_info (gdbarch)->printable_name); |
32c9a795 MD |
696 | fprintf_unfiltered (file, |
697 | "gdbarch_dump: bits_big_endian = %s\n", | |
623d3eb1 | 698 | plongest (gdbarch->bits_big_endian)); |
48f7351b | 699 | fprintf_unfiltered (file, |
30737ed9 JB |
700 | "gdbarch_dump: breakpoint_from_pc = <%s>\n", |
701 | host_address_to_string (gdbarch->breakpoint_from_pc)); | |
48f7351b AC |
702 | fprintf_unfiltered (file, |
703 | "gdbarch_dump: byte_order = %s\n", | |
623d3eb1 | 704 | plongest (gdbarch->byte_order)); |
9d4fde75 SS |
705 | fprintf_unfiltered (file, |
706 | "gdbarch_dump: byte_order_for_code = %s\n", | |
623d3eb1 | 707 | plongest (gdbarch->byte_order_for_code)); |
48f7351b AC |
708 | fprintf_unfiltered (file, |
709 | "gdbarch_dump: call_dummy_location = %s\n", | |
623d3eb1 | 710 | plongest (gdbarch->call_dummy_location)); |
48f7351b | 711 | fprintf_unfiltered (file, |
30737ed9 JB |
712 | "gdbarch_dump: cannot_fetch_register = <%s>\n", |
713 | host_address_to_string (gdbarch->cannot_fetch_register)); | |
48f7351b AC |
714 | fprintf_unfiltered (file, |
715 | "gdbarch_dump: cannot_step_breakpoint = %s\n", | |
623d3eb1 | 716 | plongest (gdbarch->cannot_step_breakpoint)); |
48f7351b | 717 | fprintf_unfiltered (file, |
30737ed9 JB |
718 | "gdbarch_dump: cannot_store_register = <%s>\n", |
719 | host_address_to_string (gdbarch->cannot_store_register)); | |
48f7351b AC |
720 | fprintf_unfiltered (file, |
721 | "gdbarch_dump: char_signed = %s\n", | |
623d3eb1 | 722 | plongest (gdbarch->char_signed)); |
7996bcec | 723 | fprintf_unfiltered (file, |
30737ed9 JB |
724 | "gdbarch_dump: coff_make_msymbol_special = <%s>\n", |
725 | host_address_to_string (gdbarch->coff_make_msymbol_special)); | |
48f7351b | 726 | fprintf_unfiltered (file, |
30737ed9 JB |
727 | "gdbarch_dump: construct_inferior_arguments = <%s>\n", |
728 | host_address_to_string (gdbarch->construct_inferior_arguments)); | |
a2428dbe | 729 | fprintf_unfiltered (file, |
30737ed9 JB |
730 | "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n", |
731 | host_address_to_string (gdbarch->convert_from_func_ptr_addr)); | |
48f7351b | 732 | fprintf_unfiltered (file, |
30737ed9 JB |
733 | "gdbarch_dump: convert_register_p = <%s>\n", |
734 | host_address_to_string (gdbarch->convert_register_p)); | |
4eb0ad19 DJ |
735 | fprintf_unfiltered (file, |
736 | "gdbarch_dump: gdbarch_core_read_description_p() = %d\n", | |
be7811ad | 737 | gdbarch_core_read_description_p (gdbarch)); |
4eb0ad19 | 738 | fprintf_unfiltered (file, |
30737ed9 JB |
739 | "gdbarch_dump: core_read_description = <%s>\n", |
740 | host_address_to_string (gdbarch->core_read_description)); | |
959b8724 PA |
741 | fprintf_unfiltered (file, |
742 | "gdbarch_dump: core_reg_section_encodes_pid = %s\n", | |
743 | plongest (gdbarch->core_reg_section_encodes_pid)); | |
17ea7499 CES |
744 | fprintf_unfiltered (file, |
745 | "gdbarch_dump: core_regset_sections = %s\n", | |
746 | host_address_to_string (gdbarch->core_regset_sections)); | |
de584861 PA |
747 | fprintf_unfiltered (file, |
748 | "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n", | |
be7811ad | 749 | gdbarch_core_xfer_shared_libraries_p (gdbarch)); |
de584861 | 750 | fprintf_unfiltered (file, |
30737ed9 JB |
751 | "gdbarch_dump: core_xfer_shared_libraries = <%s>\n", |
752 | host_address_to_string (gdbarch->core_xfer_shared_libraries)); | |
48f7351b | 753 | fprintf_unfiltered (file, |
0b1553bc UW |
754 | "gdbarch_dump: decr_pc_after_break = %s\n", |
755 | core_addr_to_string_nz (gdbarch->decr_pc_after_break)); | |
48f7351b AC |
756 | fprintf_unfiltered (file, |
757 | "gdbarch_dump: deprecated_fp_regnum = %s\n", | |
623d3eb1 | 758 | plongest (gdbarch->deprecated_fp_regnum)); |
48f7351b | 759 | fprintf_unfiltered (file, |
0b1553bc UW |
760 | "gdbarch_dump: deprecated_function_start_offset = %s\n", |
761 | core_addr_to_string_nz (gdbarch->deprecated_function_start_offset)); | |
237fc4c9 PA |
762 | fprintf_unfiltered (file, |
763 | "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n", | |
764 | gdbarch_displaced_step_copy_insn_p (gdbarch)); | |
765 | fprintf_unfiltered (file, | |
30737ed9 JB |
766 | "gdbarch_dump: displaced_step_copy_insn = <%s>\n", |
767 | host_address_to_string (gdbarch->displaced_step_copy_insn)); | |
237fc4c9 PA |
768 | fprintf_unfiltered (file, |
769 | "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n", | |
770 | gdbarch_displaced_step_fixup_p (gdbarch)); | |
771 | fprintf_unfiltered (file, | |
30737ed9 JB |
772 | "gdbarch_dump: displaced_step_fixup = <%s>\n", |
773 | host_address_to_string (gdbarch->displaced_step_fixup)); | |
237fc4c9 | 774 | fprintf_unfiltered (file, |
30737ed9 JB |
775 | "gdbarch_dump: displaced_step_free_closure = <%s>\n", |
776 | host_address_to_string (gdbarch->displaced_step_free_closure)); | |
237fc4c9 | 777 | fprintf_unfiltered (file, |
30737ed9 JB |
778 | "gdbarch_dump: displaced_step_location = <%s>\n", |
779 | host_address_to_string (gdbarch->displaced_step_location)); | |
48f7351b AC |
780 | fprintf_unfiltered (file, |
781 | "gdbarch_dump: double_bit = %s\n", | |
623d3eb1 | 782 | plongest (gdbarch->double_bit)); |
a2428dbe | 783 | fprintf_unfiltered (file, |
48f7351b | 784 | "gdbarch_dump: double_format = %s\n", |
be7811ad | 785 | pformat (gdbarch->double_format)); |
669fac23 DJ |
786 | fprintf_unfiltered (file, |
787 | "gdbarch_dump: gdbarch_dummy_id_p() = %d\n", | |
788 | gdbarch_dummy_id_p (gdbarch)); | |
789 | fprintf_unfiltered (file, | |
30737ed9 JB |
790 | "gdbarch_dump: dummy_id = <%s>\n", |
791 | host_address_to_string (gdbarch->dummy_id)); | |
48f7351b | 792 | fprintf_unfiltered (file, |
30737ed9 JB |
793 | "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n", |
794 | host_address_to_string (gdbarch->dwarf2_reg_to_regnum)); | |
48f7351b | 795 | fprintf_unfiltered (file, |
30737ed9 JB |
796 | "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n", |
797 | host_address_to_string (gdbarch->ecoff_reg_to_regnum)); | |
48f7351b | 798 | fprintf_unfiltered (file, |
30737ed9 JB |
799 | "gdbarch_dump: elf_make_msymbol_special = <%s>\n", |
800 | host_address_to_string (gdbarch->elf_make_msymbol_special)); | |
48f7351b AC |
801 | fprintf_unfiltered (file, |
802 | "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n", | |
be7811ad | 803 | gdbarch_fetch_pointer_argument_p (gdbarch)); |
48f7351b | 804 | fprintf_unfiltered (file, |
30737ed9 JB |
805 | "gdbarch_dump: fetch_pointer_argument = <%s>\n", |
806 | host_address_to_string (gdbarch->fetch_pointer_argument)); | |
b2756930 KB |
807 | fprintf_unfiltered (file, |
808 | "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n", | |
be7811ad | 809 | gdbarch_fetch_tls_load_module_address_p (gdbarch)); |
b2756930 | 810 | fprintf_unfiltered (file, |
30737ed9 JB |
811 | "gdbarch_dump: fetch_tls_load_module_address = <%s>\n", |
812 | host_address_to_string (gdbarch->fetch_tls_load_module_address)); | |
48f7351b AC |
813 | fprintf_unfiltered (file, |
814 | "gdbarch_dump: float_bit = %s\n", | |
623d3eb1 | 815 | plongest (gdbarch->float_bit)); |
a2428dbe | 816 | fprintf_unfiltered (file, |
48f7351b | 817 | "gdbarch_dump: float_format = %s\n", |
be7811ad | 818 | pformat (gdbarch->float_format)); |
48f7351b AC |
819 | fprintf_unfiltered (file, |
820 | "gdbarch_dump: fp0_regnum = %s\n", | |
623d3eb1 | 821 | plongest (gdbarch->fp0_regnum)); |
a2428dbe AC |
822 | fprintf_unfiltered (file, |
823 | "gdbarch_dump: gdbarch_frame_align_p() = %d\n", | |
be7811ad | 824 | gdbarch_frame_align_p (gdbarch)); |
a2428dbe | 825 | fprintf_unfiltered (file, |
30737ed9 JB |
826 | "gdbarch_dump: frame_align = <%s>\n", |
827 | host_address_to_string (gdbarch->frame_align)); | |
48f7351b | 828 | fprintf_unfiltered (file, |
0b1553bc UW |
829 | "gdbarch_dump: frame_args_skip = %s\n", |
830 | core_addr_to_string_nz (gdbarch->frame_args_skip)); | |
48f7351b AC |
831 | fprintf_unfiltered (file, |
832 | "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n", | |
be7811ad | 833 | gdbarch_frame_num_args_p (gdbarch)); |
48f7351b | 834 | fprintf_unfiltered (file, |
30737ed9 JB |
835 | "gdbarch_dump: frame_num_args = <%s>\n", |
836 | host_address_to_string (gdbarch->frame_num_args)); | |
48f7351b AC |
837 | fprintf_unfiltered (file, |
838 | "gdbarch_dump: frame_red_zone_size = %s\n", | |
623d3eb1 | 839 | plongest (gdbarch->frame_red_zone_size)); |
48f7351b AC |
840 | fprintf_unfiltered (file, |
841 | "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n", | |
be7811ad | 842 | gdbarch_get_longjmp_target_p (gdbarch)); |
48f7351b | 843 | fprintf_unfiltered (file, |
30737ed9 JB |
844 | "gdbarch_dump: get_longjmp_target = <%s>\n", |
845 | host_address_to_string (gdbarch->get_longjmp_target)); | |
4aa995e1 PA |
846 | fprintf_unfiltered (file, |
847 | "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n", | |
848 | gdbarch_get_siginfo_type_p (gdbarch)); | |
849 | fprintf_unfiltered (file, | |
315aef0a PA |
850 | "gdbarch_dump: get_siginfo_type = <%s>\n", |
851 | host_address_to_string (gdbarch->get_siginfo_type)); | |
50c71eaf PA |
852 | fprintf_unfiltered (file, |
853 | "gdbarch_dump: has_global_solist = %s\n", | |
854 | plongest (gdbarch->has_global_solist)); | |
a2428dbe | 855 | fprintf_unfiltered (file, |
48f7351b | 856 | "gdbarch_dump: have_nonsteppable_watchpoint = %s\n", |
623d3eb1 | 857 | plongest (gdbarch->have_nonsteppable_watchpoint)); |
48f7351b | 858 | fprintf_unfiltered (file, |
30737ed9 JB |
859 | "gdbarch_dump: in_function_epilogue_p = <%s>\n", |
860 | host_address_to_string (gdbarch->in_function_epilogue_p)); | |
48f7351b | 861 | fprintf_unfiltered (file, |
30737ed9 JB |
862 | "gdbarch_dump: in_solib_return_trampoline = <%s>\n", |
863 | host_address_to_string (gdbarch->in_solib_return_trampoline)); | |
48f7351b | 864 | fprintf_unfiltered (file, |
30737ed9 JB |
865 | "gdbarch_dump: inner_than = <%s>\n", |
866 | host_address_to_string (gdbarch->inner_than)); | |
48f7351b AC |
867 | fprintf_unfiltered (file, |
868 | "gdbarch_dump: int_bit = %s\n", | |
623d3eb1 | 869 | plongest (gdbarch->int_bit)); |
48f7351b AC |
870 | fprintf_unfiltered (file, |
871 | "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n", | |
be7811ad | 872 | gdbarch_integer_to_address_p (gdbarch)); |
48f7351b | 873 | fprintf_unfiltered (file, |
30737ed9 JB |
874 | "gdbarch_dump: integer_to_address = <%s>\n", |
875 | host_address_to_string (gdbarch->integer_to_address)); | |
48f7351b AC |
876 | fprintf_unfiltered (file, |
877 | "gdbarch_dump: long_bit = %s\n", | |
623d3eb1 | 878 | plongest (gdbarch->long_bit)); |
48f7351b AC |
879 | fprintf_unfiltered (file, |
880 | "gdbarch_dump: long_double_bit = %s\n", | |
623d3eb1 | 881 | plongest (gdbarch->long_double_bit)); |
a2428dbe | 882 | fprintf_unfiltered (file, |
48f7351b | 883 | "gdbarch_dump: long_double_format = %s\n", |
be7811ad | 884 | pformat (gdbarch->long_double_format)); |
48f7351b AC |
885 | fprintf_unfiltered (file, |
886 | "gdbarch_dump: long_long_bit = %s\n", | |
623d3eb1 | 887 | plongest (gdbarch->long_long_bit)); |
237fc4c9 PA |
888 | fprintf_unfiltered (file, |
889 | "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n", | |
890 | gdbarch_max_insn_length_p (gdbarch)); | |
891 | fprintf_unfiltered (file, | |
892 | "gdbarch_dump: max_insn_length = %s\n", | |
623d3eb1 | 893 | plongest (gdbarch->max_insn_length)); |
48f7351b | 894 | fprintf_unfiltered (file, |
30737ed9 JB |
895 | "gdbarch_dump: memory_insert_breakpoint = <%s>\n", |
896 | host_address_to_string (gdbarch->memory_insert_breakpoint)); | |
48f7351b | 897 | fprintf_unfiltered (file, |
30737ed9 JB |
898 | "gdbarch_dump: memory_remove_breakpoint = <%s>\n", |
899 | host_address_to_string (gdbarch->memory_remove_breakpoint)); | |
48f7351b AC |
900 | fprintf_unfiltered (file, |
901 | "gdbarch_dump: num_pseudo_regs = %s\n", | |
623d3eb1 | 902 | plongest (gdbarch->num_pseudo_regs)); |
48f7351b AC |
903 | fprintf_unfiltered (file, |
904 | "gdbarch_dump: num_regs = %s\n", | |
623d3eb1 | 905 | plongest (gdbarch->num_regs)); |
48f7351b AC |
906 | fprintf_unfiltered (file, |
907 | "gdbarch_dump: osabi = %s\n", | |
623d3eb1 | 908 | plongest (gdbarch->osabi)); |
1c772458 UW |
909 | fprintf_unfiltered (file, |
910 | "gdbarch_dump: gdbarch_overlay_update_p() = %d\n", | |
be7811ad | 911 | gdbarch_overlay_update_p (gdbarch)); |
1c772458 | 912 | fprintf_unfiltered (file, |
30737ed9 JB |
913 | "gdbarch_dump: overlay_update = <%s>\n", |
914 | host_address_to_string (gdbarch->overlay_update)); | |
48f7351b AC |
915 | fprintf_unfiltered (file, |
916 | "gdbarch_dump: pc_regnum = %s\n", | |
623d3eb1 | 917 | plongest (gdbarch->pc_regnum)); |
48f7351b | 918 | fprintf_unfiltered (file, |
30737ed9 JB |
919 | "gdbarch_dump: pointer_to_address = <%s>\n", |
920 | host_address_to_string (gdbarch->pointer_to_address)); | |
7996bcec AC |
921 | fprintf_unfiltered (file, |
922 | "gdbarch_dump: gdbarch_print_float_info_p() = %d\n", | |
be7811ad | 923 | gdbarch_print_float_info_p (gdbarch)); |
7996bcec | 924 | fprintf_unfiltered (file, |
30737ed9 JB |
925 | "gdbarch_dump: print_float_info = <%s>\n", |
926 | host_address_to_string (gdbarch->print_float_info)); | |
7996bcec | 927 | fprintf_unfiltered (file, |
30737ed9 JB |
928 | "gdbarch_dump: print_insn = <%s>\n", |
929 | host_address_to_string (gdbarch->print_insn)); | |
48f7351b | 930 | fprintf_unfiltered (file, |
30737ed9 JB |
931 | "gdbarch_dump: print_registers_info = <%s>\n", |
932 | host_address_to_string (gdbarch->print_registers_info)); | |
7996bcec AC |
933 | fprintf_unfiltered (file, |
934 | "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n", | |
be7811ad | 935 | gdbarch_print_vector_info_p (gdbarch)); |
7996bcec | 936 | fprintf_unfiltered (file, |
30737ed9 JB |
937 | "gdbarch_dump: print_vector_info = <%s>\n", |
938 | host_address_to_string (gdbarch->print_vector_info)); | |
48f7351b AC |
939 | fprintf_unfiltered (file, |
940 | "gdbarch_dump: ps_regnum = %s\n", | |
623d3eb1 | 941 | plongest (gdbarch->ps_regnum)); |
a2428dbe AC |
942 | fprintf_unfiltered (file, |
943 | "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n", | |
be7811ad | 944 | gdbarch_pseudo_register_read_p (gdbarch)); |
a2428dbe | 945 | fprintf_unfiltered (file, |
30737ed9 JB |
946 | "gdbarch_dump: pseudo_register_read = <%s>\n", |
947 | host_address_to_string (gdbarch->pseudo_register_read)); | |
a2428dbe AC |
948 | fprintf_unfiltered (file, |
949 | "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n", | |
be7811ad | 950 | gdbarch_pseudo_register_write_p (gdbarch)); |
a2428dbe | 951 | fprintf_unfiltered (file, |
30737ed9 JB |
952 | "gdbarch_dump: pseudo_register_write = <%s>\n", |
953 | host_address_to_string (gdbarch->pseudo_register_write)); | |
48f7351b AC |
954 | fprintf_unfiltered (file, |
955 | "gdbarch_dump: ptr_bit = %s\n", | |
623d3eb1 | 956 | plongest (gdbarch->ptr_bit)); |
7996bcec AC |
957 | fprintf_unfiltered (file, |
958 | "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n", | |
be7811ad | 959 | gdbarch_push_dummy_call_p (gdbarch)); |
7996bcec | 960 | fprintf_unfiltered (file, |
30737ed9 JB |
961 | "gdbarch_dump: push_dummy_call = <%s>\n", |
962 | host_address_to_string (gdbarch->push_dummy_call)); | |
7996bcec AC |
963 | fprintf_unfiltered (file, |
964 | "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n", | |
be7811ad | 965 | gdbarch_push_dummy_code_p (gdbarch)); |
7996bcec | 966 | fprintf_unfiltered (file, |
30737ed9 JB |
967 | "gdbarch_dump: push_dummy_code = <%s>\n", |
968 | host_address_to_string (gdbarch->push_dummy_code)); | |
48f7351b AC |
969 | fprintf_unfiltered (file, |
970 | "gdbarch_dump: gdbarch_read_pc_p() = %d\n", | |
be7811ad | 971 | gdbarch_read_pc_p (gdbarch)); |
48f7351b | 972 | fprintf_unfiltered (file, |
30737ed9 JB |
973 | "gdbarch_dump: read_pc = <%s>\n", |
974 | host_address_to_string (gdbarch->read_pc)); | |
60c5725c DJ |
975 | fprintf_unfiltered (file, |
976 | "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n", | |
977 | gdbarch_record_special_symbol_p (gdbarch)); | |
978 | fprintf_unfiltered (file, | |
30737ed9 JB |
979 | "gdbarch_dump: record_special_symbol = <%s>\n", |
980 | host_address_to_string (gdbarch->record_special_symbol)); | |
a2428dbe | 981 | fprintf_unfiltered (file, |
30737ed9 JB |
982 | "gdbarch_dump: register_name = <%s>\n", |
983 | host_address_to_string (gdbarch->register_name)); | |
48f7351b | 984 | fprintf_unfiltered (file, |
30737ed9 JB |
985 | "gdbarch_dump: register_reggroup_p = <%s>\n", |
986 | host_address_to_string (gdbarch->register_reggroup_p)); | |
48f7351b | 987 | fprintf_unfiltered (file, |
30737ed9 JB |
988 | "gdbarch_dump: register_sim_regno = <%s>\n", |
989 | host_address_to_string (gdbarch->register_sim_regno)); | |
48f7351b | 990 | fprintf_unfiltered (file, |
30737ed9 JB |
991 | "gdbarch_dump: register_to_value = <%s>\n", |
992 | host_address_to_string (gdbarch->register_to_value)); | |
7996bcec AC |
993 | fprintf_unfiltered (file, |
994 | "gdbarch_dump: gdbarch_register_type_p() = %d\n", | |
be7811ad | 995 | gdbarch_register_type_p (gdbarch)); |
7996bcec | 996 | fprintf_unfiltered (file, |
30737ed9 JB |
997 | "gdbarch_dump: register_type = <%s>\n", |
998 | host_address_to_string (gdbarch->register_type)); | |
a2428dbe AC |
999 | fprintf_unfiltered (file, |
1000 | "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n", | |
be7811ad | 1001 | gdbarch_regset_from_core_section_p (gdbarch)); |
a2428dbe | 1002 | fprintf_unfiltered (file, |
30737ed9 JB |
1003 | "gdbarch_dump: regset_from_core_section = <%s>\n", |
1004 | host_address_to_string (gdbarch->regset_from_core_section)); | |
123dc839 | 1005 | fprintf_unfiltered (file, |
30737ed9 JB |
1006 | "gdbarch_dump: remote_register_number = <%s>\n", |
1007 | host_address_to_string (gdbarch->remote_register_number)); | |
a2428dbe AC |
1008 | fprintf_unfiltered (file, |
1009 | "gdbarch_dump: gdbarch_return_value_p() = %d\n", | |
be7811ad | 1010 | gdbarch_return_value_p (gdbarch)); |
a2428dbe | 1011 | fprintf_unfiltered (file, |
30737ed9 JB |
1012 | "gdbarch_dump: return_value = <%s>\n", |
1013 | host_address_to_string (gdbarch->return_value)); | |
48f7351b | 1014 | fprintf_unfiltered (file, |
30737ed9 JB |
1015 | "gdbarch_dump: sdb_reg_to_regnum = <%s>\n", |
1016 | host_address_to_string (gdbarch->sdb_reg_to_regnum)); | |
48f7351b AC |
1017 | fprintf_unfiltered (file, |
1018 | "gdbarch_dump: short_bit = %s\n", | |
623d3eb1 | 1019 | plongest (gdbarch->short_bit)); |
3352ef37 AC |
1020 | fprintf_unfiltered (file, |
1021 | "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n", | |
be7811ad | 1022 | gdbarch_single_step_through_delay_p (gdbarch)); |
3352ef37 | 1023 | fprintf_unfiltered (file, |
30737ed9 JB |
1024 | "gdbarch_dump: single_step_through_delay = <%s>\n", |
1025 | host_address_to_string (gdbarch->single_step_through_delay)); | |
4309257c PM |
1026 | fprintf_unfiltered (file, |
1027 | "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n", | |
1028 | gdbarch_skip_main_prologue_p (gdbarch)); | |
1029 | fprintf_unfiltered (file, | |
30737ed9 JB |
1030 | "gdbarch_dump: skip_main_prologue = <%s>\n", |
1031 | host_address_to_string (gdbarch->skip_main_prologue)); | |
6d350bb5 UW |
1032 | fprintf_unfiltered (file, |
1033 | "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n", | |
be7811ad | 1034 | gdbarch_skip_permanent_breakpoint_p (gdbarch)); |
6d350bb5 | 1035 | fprintf_unfiltered (file, |
30737ed9 JB |
1036 | "gdbarch_dump: skip_permanent_breakpoint = <%s>\n", |
1037 | host_address_to_string (gdbarch->skip_permanent_breakpoint)); | |
dea0c52f | 1038 | fprintf_unfiltered (file, |
30737ed9 JB |
1039 | "gdbarch_dump: skip_prologue = <%s>\n", |
1040 | host_address_to_string (gdbarch->skip_prologue)); | |
48f7351b | 1041 | fprintf_unfiltered (file, |
30737ed9 JB |
1042 | "gdbarch_dump: skip_solib_resolver = <%s>\n", |
1043 | host_address_to_string (gdbarch->skip_solib_resolver)); | |
48f7351b | 1044 | fprintf_unfiltered (file, |
30737ed9 JB |
1045 | "gdbarch_dump: skip_trampoline_code = <%s>\n", |
1046 | host_address_to_string (gdbarch->skip_trampoline_code)); | |
48f7351b | 1047 | fprintf_unfiltered (file, |
30737ed9 JB |
1048 | "gdbarch_dump: smash_text_address = <%s>\n", |
1049 | host_address_to_string (gdbarch->smash_text_address)); | |
48f7351b AC |
1050 | fprintf_unfiltered (file, |
1051 | "gdbarch_dump: gdbarch_software_single_step_p() = %d\n", | |
be7811ad | 1052 | gdbarch_software_single_step_p (gdbarch)); |
48f7351b | 1053 | fprintf_unfiltered (file, |
30737ed9 JB |
1054 | "gdbarch_dump: software_single_step = <%s>\n", |
1055 | host_address_to_string (gdbarch->software_single_step)); | |
203c3895 UW |
1056 | fprintf_unfiltered (file, |
1057 | "gdbarch_dump: sofun_address_maybe_missing = %s\n", | |
623d3eb1 | 1058 | plongest (gdbarch->sofun_address_maybe_missing)); |
48f7351b AC |
1059 | fprintf_unfiltered (file, |
1060 | "gdbarch_dump: sp_regnum = %s\n", | |
623d3eb1 | 1061 | plongest (gdbarch->sp_regnum)); |
a2428dbe | 1062 | fprintf_unfiltered (file, |
30737ed9 JB |
1063 | "gdbarch_dump: stab_reg_to_regnum = <%s>\n", |
1064 | host_address_to_string (gdbarch->stab_reg_to_regnum)); | |
48f7351b | 1065 | fprintf_unfiltered (file, |
30737ed9 JB |
1066 | "gdbarch_dump: stabs_argument_has_addr = <%s>\n", |
1067 | host_address_to_string (gdbarch->stabs_argument_has_addr)); | |
149ad273 UW |
1068 | fprintf_unfiltered (file, |
1069 | "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n", | |
be7811ad | 1070 | gdbarch_static_transform_name_p (gdbarch)); |
149ad273 | 1071 | fprintf_unfiltered (file, |
30737ed9 JB |
1072 | "gdbarch_dump: static_transform_name = <%s>\n", |
1073 | host_address_to_string (gdbarch->static_transform_name)); | |
424163ea DJ |
1074 | fprintf_unfiltered (file, |
1075 | "gdbarch_dump: target_desc = %s\n", | |
30737ed9 | 1076 | host_address_to_string (gdbarch->target_desc)); |
1cded358 | 1077 | fprintf_unfiltered (file, |
30737ed9 JB |
1078 | "gdbarch_dump: target_signal_from_host = <%s>\n", |
1079 | host_address_to_string (gdbarch->target_signal_from_host)); | |
1cded358 | 1080 | fprintf_unfiltered (file, |
30737ed9 JB |
1081 | "gdbarch_dump: target_signal_to_host = <%s>\n", |
1082 | host_address_to_string (gdbarch->target_signal_to_host)); | |
08e45a40 | 1083 | fprintf_unfiltered (file, |
a2428dbe | 1084 | "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n", |
be7811ad | 1085 | gdbarch_unwind_pc_p (gdbarch)); |
7996bcec | 1086 | fprintf_unfiltered (file, |
30737ed9 JB |
1087 | "gdbarch_dump: unwind_pc = <%s>\n", |
1088 | host_address_to_string (gdbarch->unwind_pc)); | |
bd1ce8ba | 1089 | fprintf_unfiltered (file, |
a2428dbe | 1090 | "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n", |
be7811ad | 1091 | gdbarch_unwind_sp_p (gdbarch)); |
bd1ce8ba | 1092 | fprintf_unfiltered (file, |
30737ed9 JB |
1093 | "gdbarch_dump: unwind_sp = <%s>\n", |
1094 | host_address_to_string (gdbarch->unwind_sp)); | |
9acbedc0 | 1095 | fprintf_unfiltered (file, |
30737ed9 JB |
1096 | "gdbarch_dump: value_from_register = <%s>\n", |
1097 | host_address_to_string (gdbarch->value_from_register)); | |
48f7351b | 1098 | fprintf_unfiltered (file, |
30737ed9 JB |
1099 | "gdbarch_dump: value_to_register = <%s>\n", |
1100 | host_address_to_string (gdbarch->value_to_register)); | |
0d5de010 DJ |
1101 | fprintf_unfiltered (file, |
1102 | "gdbarch_dump: vbit_in_delta = %s\n", | |
623d3eb1 | 1103 | plongest (gdbarch->vbit_in_delta)); |
48f7351b | 1104 | fprintf_unfiltered (file, |
30737ed9 JB |
1105 | "gdbarch_dump: virtual_frame_pointer = <%s>\n", |
1106 | host_address_to_string (gdbarch->virtual_frame_pointer)); | |
0d5de010 DJ |
1107 | fprintf_unfiltered (file, |
1108 | "gdbarch_dump: vtable_function_descriptors = %s\n", | |
623d3eb1 | 1109 | plongest (gdbarch->vtable_function_descriptors)); |
4b9b3959 | 1110 | fprintf_unfiltered (file, |
61a1198a | 1111 | "gdbarch_dump: gdbarch_write_pc_p() = %d\n", |
be7811ad | 1112 | gdbarch_write_pc_p (gdbarch)); |
48f7351b | 1113 | fprintf_unfiltered (file, |
30737ed9 JB |
1114 | "gdbarch_dump: write_pc = <%s>\n", |
1115 | host_address_to_string (gdbarch->write_pc)); | |
be7811ad MD |
1116 | if (gdbarch->dump_tdep != NULL) |
1117 | gdbarch->dump_tdep (gdbarch, file); | |
0f71a2f6 JM |
1118 | } |
1119 | ||
1120 | struct gdbarch_tdep * | |
104c1213 | 1121 | gdbarch_tdep (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1122 | { |
1123 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
1124 | fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n"); |
1125 | return gdbarch->tdep; | |
1126 | } | |
1127 | ||
1128 | ||
1129 | const struct bfd_arch_info * | |
104c1213 | 1130 | gdbarch_bfd_arch_info (struct gdbarch *gdbarch) |
0f71a2f6 | 1131 | { |
8de9bdc4 | 1132 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 1133 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1134 | fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n"); |
1135 | return gdbarch->bfd_arch_info; | |
1136 | } | |
1137 | ||
1138 | int | |
104c1213 | 1139 | gdbarch_byte_order (struct gdbarch *gdbarch) |
0f71a2f6 | 1140 | { |
8de9bdc4 | 1141 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 1142 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1143 | fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n"); |
1144 | return gdbarch->byte_order; | |
1145 | } | |
1146 | ||
9d4fde75 SS |
1147 | int |
1148 | gdbarch_byte_order_for_code (struct gdbarch *gdbarch) | |
1149 | { | |
1150 | gdb_assert (gdbarch != NULL); | |
1151 | if (gdbarch_debug >= 2) | |
1152 | fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order_for_code called\n"); | |
1153 | return gdbarch->byte_order_for_code; | |
1154 | } | |
1155 | ||
4be87837 DJ |
1156 | enum gdb_osabi |
1157 | gdbarch_osabi (struct gdbarch *gdbarch) | |
1158 | { | |
1159 | gdb_assert (gdbarch != NULL); | |
1160 | if (gdbarch_debug >= 2) | |
1161 | fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n"); | |
1162 | return gdbarch->osabi; | |
1163 | } | |
1164 | ||
424163ea DJ |
1165 | const struct target_desc * |
1166 | gdbarch_target_desc (struct gdbarch *gdbarch) | |
1167 | { | |
1168 | gdb_assert (gdbarch != NULL); | |
1169 | if (gdbarch_debug >= 2) | |
1170 | fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n"); | |
1171 | return gdbarch->target_desc; | |
1172 | } | |
1173 | ||
32c9a795 MD |
1174 | int |
1175 | gdbarch_bits_big_endian (struct gdbarch *gdbarch) | |
1176 | { | |
1177 | gdb_assert (gdbarch != NULL); | |
1178 | /* Skip verify of bits_big_endian, invalid_p == 0 */ | |
1179 | if (gdbarch_debug >= 2) | |
1180 | fprintf_unfiltered (gdb_stdlog, "gdbarch_bits_big_endian called\n"); | |
1181 | return gdbarch->bits_big_endian; | |
1182 | } | |
1183 | ||
1184 | void | |
1185 | set_gdbarch_bits_big_endian (struct gdbarch *gdbarch, | |
1186 | int bits_big_endian) | |
1187 | { | |
1188 | gdbarch->bits_big_endian = bits_big_endian; | |
1189 | } | |
1190 | ||
0f71a2f6 | 1191 | int |
104c1213 | 1192 | gdbarch_short_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1193 | { |
8de9bdc4 | 1194 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1195 | /* Skip verify of short_bit, invalid_p == 0 */ |
0f71a2f6 | 1196 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1197 | fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n"); |
1198 | return gdbarch->short_bit; | |
1199 | } | |
1200 | ||
1201 | void | |
104c1213 JM |
1202 | set_gdbarch_short_bit (struct gdbarch *gdbarch, |
1203 | int short_bit) | |
0f71a2f6 JM |
1204 | { |
1205 | gdbarch->short_bit = short_bit; | |
1206 | } | |
1207 | ||
1208 | int | |
104c1213 | 1209 | gdbarch_int_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1210 | { |
8de9bdc4 | 1211 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1212 | /* Skip verify of int_bit, invalid_p == 0 */ |
0f71a2f6 | 1213 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1214 | fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n"); |
1215 | return gdbarch->int_bit; | |
1216 | } | |
1217 | ||
1218 | void | |
104c1213 JM |
1219 | set_gdbarch_int_bit (struct gdbarch *gdbarch, |
1220 | int int_bit) | |
0f71a2f6 JM |
1221 | { |
1222 | gdbarch->int_bit = int_bit; | |
1223 | } | |
1224 | ||
1225 | int | |
104c1213 | 1226 | gdbarch_long_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1227 | { |
8de9bdc4 | 1228 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1229 | /* Skip verify of long_bit, invalid_p == 0 */ |
0f71a2f6 | 1230 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1231 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n"); |
1232 | return gdbarch->long_bit; | |
1233 | } | |
1234 | ||
1235 | void | |
104c1213 JM |
1236 | set_gdbarch_long_bit (struct gdbarch *gdbarch, |
1237 | int long_bit) | |
0f71a2f6 JM |
1238 | { |
1239 | gdbarch->long_bit = long_bit; | |
1240 | } | |
1241 | ||
1242 | int | |
104c1213 | 1243 | gdbarch_long_long_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1244 | { |
8de9bdc4 | 1245 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1246 | /* Skip verify of long_long_bit, invalid_p == 0 */ |
0f71a2f6 | 1247 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1248 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n"); |
1249 | return gdbarch->long_long_bit; | |
1250 | } | |
1251 | ||
1252 | void | |
104c1213 JM |
1253 | set_gdbarch_long_long_bit (struct gdbarch *gdbarch, |
1254 | int long_long_bit) | |
0f71a2f6 JM |
1255 | { |
1256 | gdbarch->long_long_bit = long_long_bit; | |
1257 | } | |
1258 | ||
1259 | int | |
104c1213 | 1260 | gdbarch_float_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1261 | { |
8de9bdc4 | 1262 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1263 | /* Skip verify of float_bit, invalid_p == 0 */ |
0f71a2f6 | 1264 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1265 | fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n"); |
1266 | return gdbarch->float_bit; | |
1267 | } | |
1268 | ||
1269 | void | |
104c1213 JM |
1270 | set_gdbarch_float_bit (struct gdbarch *gdbarch, |
1271 | int float_bit) | |
0f71a2f6 JM |
1272 | { |
1273 | gdbarch->float_bit = float_bit; | |
1274 | } | |
1275 | ||
8da61cc4 | 1276 | const struct floatformat ** |
456fcf94 AC |
1277 | gdbarch_float_format (struct gdbarch *gdbarch) |
1278 | { | |
1279 | gdb_assert (gdbarch != NULL); | |
1280 | if (gdbarch_debug >= 2) | |
1281 | fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n"); | |
1282 | return gdbarch->float_format; | |
1283 | } | |
1284 | ||
1285 | void | |
1286 | set_gdbarch_float_format (struct gdbarch *gdbarch, | |
8da61cc4 | 1287 | const struct floatformat ** float_format) |
456fcf94 AC |
1288 | { |
1289 | gdbarch->float_format = float_format; | |
1290 | } | |
1291 | ||
0f71a2f6 | 1292 | int |
104c1213 | 1293 | gdbarch_double_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1294 | { |
8de9bdc4 | 1295 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1296 | /* Skip verify of double_bit, invalid_p == 0 */ |
0f71a2f6 | 1297 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1298 | fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n"); |
1299 | return gdbarch->double_bit; | |
1300 | } | |
1301 | ||
1302 | void | |
104c1213 JM |
1303 | set_gdbarch_double_bit (struct gdbarch *gdbarch, |
1304 | int double_bit) | |
0f71a2f6 JM |
1305 | { |
1306 | gdbarch->double_bit = double_bit; | |
1307 | } | |
1308 | ||
8da61cc4 | 1309 | const struct floatformat ** |
456fcf94 AC |
1310 | gdbarch_double_format (struct gdbarch *gdbarch) |
1311 | { | |
1312 | gdb_assert (gdbarch != NULL); | |
1313 | if (gdbarch_debug >= 2) | |
1314 | fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n"); | |
1315 | return gdbarch->double_format; | |
1316 | } | |
1317 | ||
1318 | void | |
1319 | set_gdbarch_double_format (struct gdbarch *gdbarch, | |
8da61cc4 | 1320 | const struct floatformat ** double_format) |
456fcf94 AC |
1321 | { |
1322 | gdbarch->double_format = double_format; | |
1323 | } | |
1324 | ||
0f71a2f6 | 1325 | int |
104c1213 | 1326 | gdbarch_long_double_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1327 | { |
8de9bdc4 | 1328 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1329 | /* Skip verify of long_double_bit, invalid_p == 0 */ |
0f71a2f6 | 1330 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1331 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n"); |
1332 | return gdbarch->long_double_bit; | |
1333 | } | |
1334 | ||
1335 | void | |
104c1213 JM |
1336 | set_gdbarch_long_double_bit (struct gdbarch *gdbarch, |
1337 | int long_double_bit) | |
0f71a2f6 JM |
1338 | { |
1339 | gdbarch->long_double_bit = long_double_bit; | |
1340 | } | |
1341 | ||
8da61cc4 | 1342 | const struct floatformat ** |
456fcf94 AC |
1343 | gdbarch_long_double_format (struct gdbarch *gdbarch) |
1344 | { | |
1345 | gdb_assert (gdbarch != NULL); | |
1346 | if (gdbarch_debug >= 2) | |
1347 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n"); | |
1348 | return gdbarch->long_double_format; | |
1349 | } | |
1350 | ||
1351 | void | |
1352 | set_gdbarch_long_double_format (struct gdbarch *gdbarch, | |
8da61cc4 | 1353 | const struct floatformat ** long_double_format) |
456fcf94 AC |
1354 | { |
1355 | gdbarch->long_double_format = long_double_format; | |
1356 | } | |
1357 | ||
66b43ecb AC |
1358 | int |
1359 | gdbarch_ptr_bit (struct gdbarch *gdbarch) | |
1360 | { | |
8de9bdc4 | 1361 | gdb_assert (gdbarch != NULL); |
66b43ecb AC |
1362 | /* Skip verify of ptr_bit, invalid_p == 0 */ |
1363 | if (gdbarch_debug >= 2) | |
1364 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n"); | |
1365 | return gdbarch->ptr_bit; | |
1366 | } | |
1367 | ||
1368 | void | |
1369 | set_gdbarch_ptr_bit (struct gdbarch *gdbarch, | |
1370 | int ptr_bit) | |
1371 | { | |
1372 | gdbarch->ptr_bit = ptr_bit; | |
1373 | } | |
1374 | ||
52204a0b DT |
1375 | int |
1376 | gdbarch_addr_bit (struct gdbarch *gdbarch) | |
1377 | { | |
8de9bdc4 | 1378 | gdb_assert (gdbarch != NULL); |
956ac328 AC |
1379 | /* Check variable changed from pre-default. */ |
1380 | gdb_assert (gdbarch->addr_bit != 0); | |
52204a0b DT |
1381 | if (gdbarch_debug >= 2) |
1382 | fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n"); | |
1383 | return gdbarch->addr_bit; | |
1384 | } | |
1385 | ||
1386 | void | |
1387 | set_gdbarch_addr_bit (struct gdbarch *gdbarch, | |
1388 | int addr_bit) | |
1389 | { | |
1390 | gdbarch->addr_bit = addr_bit; | |
1391 | } | |
1392 | ||
4e409299 JB |
1393 | int |
1394 | gdbarch_char_signed (struct gdbarch *gdbarch) | |
1395 | { | |
8de9bdc4 | 1396 | gdb_assert (gdbarch != NULL); |
956ac328 AC |
1397 | /* Check variable changed from pre-default. */ |
1398 | gdb_assert (gdbarch->char_signed != -1); | |
4e409299 JB |
1399 | if (gdbarch_debug >= 2) |
1400 | fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n"); | |
1401 | return gdbarch->char_signed; | |
1402 | } | |
1403 | ||
1404 | void | |
1405 | set_gdbarch_char_signed (struct gdbarch *gdbarch, | |
1406 | int char_signed) | |
1407 | { | |
1408 | gdbarch->char_signed = char_signed; | |
1409 | } | |
1410 | ||
cde9ea48 AC |
1411 | int |
1412 | gdbarch_read_pc_p (struct gdbarch *gdbarch) | |
1413 | { | |
1414 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1415 | return gdbarch->read_pc != NULL; |
cde9ea48 AC |
1416 | } |
1417 | ||
0f71a2f6 | 1418 | CORE_ADDR |
61a1198a | 1419 | gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache) |
0f71a2f6 | 1420 | { |
8de9bdc4 | 1421 | gdb_assert (gdbarch != NULL); |
956ac328 | 1422 | gdb_assert (gdbarch->read_pc != NULL); |
0f71a2f6 | 1423 | if (gdbarch_debug >= 2) |
0f71a2f6 | 1424 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n"); |
61a1198a | 1425 | return gdbarch->read_pc (regcache); |
0f71a2f6 JM |
1426 | } |
1427 | ||
1428 | void | |
104c1213 JM |
1429 | set_gdbarch_read_pc (struct gdbarch *gdbarch, |
1430 | gdbarch_read_pc_ftype read_pc) | |
0f71a2f6 JM |
1431 | { |
1432 | gdbarch->read_pc = read_pc; | |
1433 | } | |
1434 | ||
61a1198a UW |
1435 | int |
1436 | gdbarch_write_pc_p (struct gdbarch *gdbarch) | |
1437 | { | |
1438 | gdb_assert (gdbarch != NULL); | |
1439 | return gdbarch->write_pc != NULL; | |
1440 | } | |
1441 | ||
0f71a2f6 | 1442 | void |
61a1198a | 1443 | gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val) |
0f71a2f6 | 1444 | { |
8de9bdc4 | 1445 | gdb_assert (gdbarch != NULL); |
956ac328 | 1446 | gdb_assert (gdbarch->write_pc != NULL); |
0f71a2f6 | 1447 | if (gdbarch_debug >= 2) |
0f71a2f6 | 1448 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n"); |
61a1198a | 1449 | gdbarch->write_pc (regcache, val); |
0f71a2f6 JM |
1450 | } |
1451 | ||
1452 | void | |
104c1213 JM |
1453 | set_gdbarch_write_pc (struct gdbarch *gdbarch, |
1454 | gdbarch_write_pc_ftype write_pc) | |
0f71a2f6 JM |
1455 | { |
1456 | gdbarch->write_pc = write_pc; | |
1457 | } | |
1458 | ||
39d4ef09 AC |
1459 | void |
1460 | gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset) | |
1461 | { | |
8de9bdc4 | 1462 | gdb_assert (gdbarch != NULL); |
956ac328 | 1463 | gdb_assert (gdbarch->virtual_frame_pointer != NULL); |
39d4ef09 AC |
1464 | if (gdbarch_debug >= 2) |
1465 | fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n"); | |
a54fba4c | 1466 | gdbarch->virtual_frame_pointer (gdbarch, pc, frame_regnum, frame_offset); |
39d4ef09 AC |
1467 | } |
1468 | ||
1469 | void | |
1470 | set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, | |
1471 | gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer) | |
1472 | { | |
1473 | gdbarch->virtual_frame_pointer = virtual_frame_pointer; | |
1474 | } | |
1475 | ||
61a0eb5b | 1476 | int |
d8124050 | 1477 | gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch) |
61a0eb5b | 1478 | { |
8de9bdc4 | 1479 | gdb_assert (gdbarch != NULL); |
956ac328 | 1480 | return gdbarch->pseudo_register_read != NULL; |
61a0eb5b AC |
1481 | } |
1482 | ||
1483 | void | |
b60c417a | 1484 | gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf) |
61a0eb5b | 1485 | { |
8de9bdc4 | 1486 | gdb_assert (gdbarch != NULL); |
956ac328 | 1487 | gdb_assert (gdbarch->pseudo_register_read != NULL); |
61a0eb5b | 1488 | if (gdbarch_debug >= 2) |
d8124050 AC |
1489 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n"); |
1490 | gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf); | |
61a0eb5b AC |
1491 | } |
1492 | ||
1493 | void | |
d8124050 AC |
1494 | set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, |
1495 | gdbarch_pseudo_register_read_ftype pseudo_register_read) | |
61a0eb5b | 1496 | { |
d8124050 | 1497 | gdbarch->pseudo_register_read = pseudo_register_read; |
61a0eb5b AC |
1498 | } |
1499 | ||
1500 | int | |
d8124050 | 1501 | gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch) |
61a0eb5b | 1502 | { |
8de9bdc4 | 1503 | gdb_assert (gdbarch != NULL); |
956ac328 | 1504 | return gdbarch->pseudo_register_write != NULL; |
61a0eb5b AC |
1505 | } |
1506 | ||
1507 | void | |
b60c417a | 1508 | gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf) |
61a0eb5b | 1509 | { |
8de9bdc4 | 1510 | gdb_assert (gdbarch != NULL); |
956ac328 | 1511 | gdb_assert (gdbarch->pseudo_register_write != NULL); |
61a0eb5b | 1512 | if (gdbarch_debug >= 2) |
d8124050 AC |
1513 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n"); |
1514 | gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf); | |
61a0eb5b AC |
1515 | } |
1516 | ||
1517 | void | |
d8124050 AC |
1518 | set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, |
1519 | gdbarch_pseudo_register_write_ftype pseudo_register_write) | |
61a0eb5b | 1520 | { |
d8124050 | 1521 | gdbarch->pseudo_register_write = pseudo_register_write; |
61a0eb5b AC |
1522 | } |
1523 | ||
0f71a2f6 | 1524 | int |
104c1213 | 1525 | gdbarch_num_regs (struct gdbarch *gdbarch) |
0f71a2f6 | 1526 | { |
8de9bdc4 | 1527 | gdb_assert (gdbarch != NULL); |
956ac328 AC |
1528 | /* Check variable changed from pre-default. */ |
1529 | gdb_assert (gdbarch->num_regs != -1); | |
0f71a2f6 | 1530 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1531 | fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n"); |
1532 | return gdbarch->num_regs; | |
1533 | } | |
1534 | ||
1535 | void | |
104c1213 JM |
1536 | set_gdbarch_num_regs (struct gdbarch *gdbarch, |
1537 | int num_regs) | |
0f71a2f6 JM |
1538 | { |
1539 | gdbarch->num_regs = num_regs; | |
1540 | } | |
1541 | ||
0aba1244 EZ |
1542 | int |
1543 | gdbarch_num_pseudo_regs (struct gdbarch *gdbarch) | |
1544 | { | |
8de9bdc4 | 1545 | gdb_assert (gdbarch != NULL); |
0aba1244 EZ |
1546 | /* Skip verify of num_pseudo_regs, invalid_p == 0 */ |
1547 | if (gdbarch_debug >= 2) | |
1548 | fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n"); | |
1549 | return gdbarch->num_pseudo_regs; | |
1550 | } | |
1551 | ||
1552 | void | |
1553 | set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, | |
1554 | int num_pseudo_regs) | |
1555 | { | |
1556 | gdbarch->num_pseudo_regs = num_pseudo_regs; | |
1557 | } | |
1558 | ||
0f71a2f6 | 1559 | int |
104c1213 | 1560 | gdbarch_sp_regnum (struct gdbarch *gdbarch) |
0f71a2f6 | 1561 | { |
8de9bdc4 | 1562 | gdb_assert (gdbarch != NULL); |
1200cd6e | 1563 | /* Skip verify of sp_regnum, invalid_p == 0 */ |
0f71a2f6 | 1564 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1565 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n"); |
1566 | return gdbarch->sp_regnum; | |
1567 | } | |
1568 | ||
1569 | void | |
104c1213 JM |
1570 | set_gdbarch_sp_regnum (struct gdbarch *gdbarch, |
1571 | int sp_regnum) | |
0f71a2f6 JM |
1572 | { |
1573 | gdbarch->sp_regnum = sp_regnum; | |
1574 | } | |
1575 | ||
0f71a2f6 | 1576 | int |
104c1213 | 1577 | gdbarch_pc_regnum (struct gdbarch *gdbarch) |
0f71a2f6 | 1578 | { |
8de9bdc4 | 1579 | gdb_assert (gdbarch != NULL); |
1200cd6e | 1580 | /* Skip verify of pc_regnum, invalid_p == 0 */ |
0f71a2f6 | 1581 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1582 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n"); |
1583 | return gdbarch->pc_regnum; | |
1584 | } | |
1585 | ||
1586 | void | |
104c1213 JM |
1587 | set_gdbarch_pc_regnum (struct gdbarch *gdbarch, |
1588 | int pc_regnum) | |
0f71a2f6 JM |
1589 | { |
1590 | gdbarch->pc_regnum = pc_regnum; | |
1591 | } | |
1592 | ||
c2169756 AC |
1593 | int |
1594 | gdbarch_ps_regnum (struct gdbarch *gdbarch) | |
1595 | { | |
8de9bdc4 | 1596 | gdb_assert (gdbarch != NULL); |
c2169756 AC |
1597 | /* Skip verify of ps_regnum, invalid_p == 0 */ |
1598 | if (gdbarch_debug >= 2) | |
1599 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n"); | |
1600 | return gdbarch->ps_regnum; | |
1601 | } | |
1602 | ||
1603 | void | |
1604 | set_gdbarch_ps_regnum (struct gdbarch *gdbarch, | |
1605 | int ps_regnum) | |
1606 | { | |
1607 | gdbarch->ps_regnum = ps_regnum; | |
1608 | } | |
1609 | ||
60054393 MS |
1610 | int |
1611 | gdbarch_fp0_regnum (struct gdbarch *gdbarch) | |
1612 | { | |
8de9bdc4 | 1613 | gdb_assert (gdbarch != NULL); |
60054393 MS |
1614 | /* Skip verify of fp0_regnum, invalid_p == 0 */ |
1615 | if (gdbarch_debug >= 2) | |
1616 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n"); | |
1617 | return gdbarch->fp0_regnum; | |
1618 | } | |
1619 | ||
1620 | void | |
1621 | set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, | |
1622 | int fp0_regnum) | |
1623 | { | |
1624 | gdbarch->fp0_regnum = fp0_regnum; | |
1625 | } | |
1626 | ||
88c72b7d AC |
1627 | int |
1628 | gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr) | |
1629 | { | |
8de9bdc4 | 1630 | gdb_assert (gdbarch != NULL); |
956ac328 | 1631 | gdb_assert (gdbarch->stab_reg_to_regnum != NULL); |
88c72b7d AC |
1632 | if (gdbarch_debug >= 2) |
1633 | fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n"); | |
d3f73121 | 1634 | return gdbarch->stab_reg_to_regnum (gdbarch, stab_regnr); |
88c72b7d AC |
1635 | } |
1636 | ||
1637 | void | |
1638 | set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, | |
1639 | gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum) | |
1640 | { | |
1641 | gdbarch->stab_reg_to_regnum = stab_reg_to_regnum; | |
1642 | } | |
1643 | ||
1644 | int | |
1645 | gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr) | |
1646 | { | |
8de9bdc4 | 1647 | gdb_assert (gdbarch != NULL); |
956ac328 | 1648 | gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL); |
88c72b7d AC |
1649 | if (gdbarch_debug >= 2) |
1650 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n"); | |
d3f73121 | 1651 | return gdbarch->ecoff_reg_to_regnum (gdbarch, ecoff_regnr); |
88c72b7d AC |
1652 | } |
1653 | ||
1654 | void | |
1655 | set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, | |
1656 | gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum) | |
1657 | { | |
1658 | gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum; | |
1659 | } | |
1660 | ||
88c72b7d AC |
1661 | int |
1662 | gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr) | |
1663 | { | |
8de9bdc4 | 1664 | gdb_assert (gdbarch != NULL); |
956ac328 | 1665 | gdb_assert (gdbarch->sdb_reg_to_regnum != NULL); |
88c72b7d AC |
1666 | if (gdbarch_debug >= 2) |
1667 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n"); | |
d3f73121 | 1668 | return gdbarch->sdb_reg_to_regnum (gdbarch, sdb_regnr); |
88c72b7d AC |
1669 | } |
1670 | ||
1671 | void | |
1672 | set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, | |
1673 | gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum) | |
1674 | { | |
1675 | gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum; | |
1676 | } | |
1677 | ||
1678 | int | |
1679 | gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr) | |
1680 | { | |
8de9bdc4 | 1681 | gdb_assert (gdbarch != NULL); |
956ac328 | 1682 | gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL); |
88c72b7d AC |
1683 | if (gdbarch_debug >= 2) |
1684 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n"); | |
d3f73121 | 1685 | return gdbarch->dwarf2_reg_to_regnum (gdbarch, dwarf2_regnr); |
88c72b7d AC |
1686 | } |
1687 | ||
1688 | void | |
1689 | set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, | |
1690 | gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum) | |
1691 | { | |
1692 | gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum; | |
1693 | } | |
1694 | ||
fa88f677 | 1695 | const char * |
0f71a2f6 JM |
1696 | gdbarch_register_name (struct gdbarch *gdbarch, int regnr) |
1697 | { | |
8de9bdc4 | 1698 | gdb_assert (gdbarch != NULL); |
956ac328 | 1699 | gdb_assert (gdbarch->register_name != NULL); |
0f71a2f6 | 1700 | if (gdbarch_debug >= 2) |
0f71a2f6 | 1701 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n"); |
d93859e2 | 1702 | return gdbarch->register_name (gdbarch, regnr); |
0f71a2f6 JM |
1703 | } |
1704 | ||
1705 | void | |
104c1213 JM |
1706 | set_gdbarch_register_name (struct gdbarch *gdbarch, |
1707 | gdbarch_register_name_ftype register_name) | |
0f71a2f6 JM |
1708 | { |
1709 | gdbarch->register_name = register_name; | |
1710 | } | |
1711 | ||
0f71a2f6 | 1712 | int |
9c04cab7 | 1713 | gdbarch_register_type_p (struct gdbarch *gdbarch) |
0f71a2f6 | 1714 | { |
8de9bdc4 | 1715 | gdb_assert (gdbarch != NULL); |
956ac328 | 1716 | return gdbarch->register_type != NULL; |
9c04cab7 AC |
1717 | } |
1718 | ||
1719 | struct type * | |
1720 | gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr) | |
1721 | { | |
1722 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1723 | gdb_assert (gdbarch->register_type != NULL); |
0f71a2f6 | 1724 | if (gdbarch_debug >= 2) |
9c04cab7 AC |
1725 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n"); |
1726 | return gdbarch->register_type (gdbarch, reg_nr); | |
0f71a2f6 JM |
1727 | } |
1728 | ||
1729 | void | |
9c04cab7 AC |
1730 | set_gdbarch_register_type (struct gdbarch *gdbarch, |
1731 | gdbarch_register_type_ftype register_type) | |
0f71a2f6 | 1732 | { |
9c04cab7 | 1733 | gdbarch->register_type = register_type; |
0f71a2f6 JM |
1734 | } |
1735 | ||
f3be58bc | 1736 | int |
669fac23 | 1737 | gdbarch_dummy_id_p (struct gdbarch *gdbarch) |
f3be58bc AC |
1738 | { |
1739 | gdb_assert (gdbarch != NULL); | |
669fac23 | 1740 | return gdbarch->dummy_id != NULL; |
f3be58bc AC |
1741 | } |
1742 | ||
1743 | struct frame_id | |
669fac23 | 1744 | gdbarch_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) |
f3be58bc AC |
1745 | { |
1746 | gdb_assert (gdbarch != NULL); | |
669fac23 | 1747 | gdb_assert (gdbarch->dummy_id != NULL); |
f3be58bc | 1748 | if (gdbarch_debug >= 2) |
669fac23 DJ |
1749 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dummy_id called\n"); |
1750 | return gdbarch->dummy_id (gdbarch, this_frame); | |
f3be58bc AC |
1751 | } |
1752 | ||
1753 | void | |
669fac23 DJ |
1754 | set_gdbarch_dummy_id (struct gdbarch *gdbarch, |
1755 | gdbarch_dummy_id_ftype dummy_id) | |
f3be58bc | 1756 | { |
669fac23 | 1757 | gdbarch->dummy_id = dummy_id; |
f3be58bc AC |
1758 | } |
1759 | ||
f3be58bc AC |
1760 | int |
1761 | gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch) | |
1762 | { | |
1763 | gdb_assert (gdbarch != NULL); | |
1764 | /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */ | |
1765 | if (gdbarch_debug >= 2) | |
1766 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n"); | |
1767 | return gdbarch->deprecated_fp_regnum; | |
1768 | } | |
1769 | ||
1770 | void | |
1771 | set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, | |
1772 | int deprecated_fp_regnum) | |
1773 | { | |
1774 | gdbarch->deprecated_fp_regnum = deprecated_fp_regnum; | |
1775 | } | |
1776 | ||
0ab7a791 | 1777 | int |
b8de8283 | 1778 | gdbarch_push_dummy_call_p (struct gdbarch *gdbarch) |
0ab7a791 AC |
1779 | { |
1780 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1781 | return gdbarch->push_dummy_call != NULL; |
0ab7a791 AC |
1782 | } |
1783 | ||
b8de8283 | 1784 | CORE_ADDR |
7d9b040b | 1785 | gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) |
666e11c5 | 1786 | { |
8de9bdc4 | 1787 | gdb_assert (gdbarch != NULL); |
956ac328 | 1788 | gdb_assert (gdbarch->push_dummy_call != NULL); |
666e11c5 | 1789 | if (gdbarch_debug >= 2) |
b8de8283 | 1790 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n"); |
7d9b040b | 1791 | return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr); |
666e11c5 EZ |
1792 | } |
1793 | ||
1794 | void | |
b8de8283 AC |
1795 | set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, |
1796 | gdbarch_push_dummy_call_ftype push_dummy_call) | |
666e11c5 | 1797 | { |
b8de8283 | 1798 | gdbarch->push_dummy_call = push_dummy_call; |
666e11c5 EZ |
1799 | } |
1800 | ||
2649061d | 1801 | int |
b8de8283 | 1802 | gdbarch_call_dummy_location (struct gdbarch *gdbarch) |
2649061d | 1803 | { |
8de9bdc4 | 1804 | gdb_assert (gdbarch != NULL); |
b8de8283 AC |
1805 | /* Skip verify of call_dummy_location, invalid_p == 0 */ |
1806 | if (gdbarch_debug >= 2) | |
1807 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n"); | |
1808 | return gdbarch->call_dummy_location; | |
2649061d AC |
1809 | } |
1810 | ||
b8de8283 AC |
1811 | void |
1812 | set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, | |
1813 | int call_dummy_location) | |
1814 | { | |
1815 | gdbarch->call_dummy_location = call_dummy_location; | |
1816 | } | |
1817 | ||
0f71a2f6 | 1818 | int |
b8de8283 | 1819 | gdbarch_push_dummy_code_p (struct gdbarch *gdbarch) |
0f71a2f6 | 1820 | { |
8de9bdc4 | 1821 | gdb_assert (gdbarch != NULL); |
956ac328 | 1822 | return gdbarch->push_dummy_code != NULL; |
b8de8283 AC |
1823 | } |
1824 | ||
1825 | CORE_ADDR | |
82585c72 | 1826 | gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache) |
b8de8283 AC |
1827 | { |
1828 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1829 | gdb_assert (gdbarch->push_dummy_code != NULL); |
0f71a2f6 | 1830 | if (gdbarch_debug >= 2) |
b8de8283 | 1831 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n"); |
82585c72 | 1832 | return gdbarch->push_dummy_code (gdbarch, sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache); |
0f71a2f6 JM |
1833 | } |
1834 | ||
1835 | void | |
b8de8283 AC |
1836 | set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, |
1837 | gdbarch_push_dummy_code_ftype push_dummy_code) | |
0f71a2f6 | 1838 | { |
b8de8283 | 1839 | gdbarch->push_dummy_code = push_dummy_code; |
0f71a2f6 JM |
1840 | } |
1841 | ||
b8de8283 AC |
1842 | void |
1843 | gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all) | |
1844 | { | |
1845 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1846 | gdb_assert (gdbarch->print_registers_info != NULL); |
b8de8283 AC |
1847 | if (gdbarch_debug >= 2) |
1848 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n"); | |
1849 | gdbarch->print_registers_info (gdbarch, file, frame, regnum, all); | |
1850 | } | |
1851 | ||
1852 | void | |
1853 | set_gdbarch_print_registers_info (struct gdbarch *gdbarch, | |
1854 | gdbarch_print_registers_info_ftype print_registers_info) | |
1855 | { | |
1856 | gdbarch->print_registers_info = print_registers_info; | |
0f71a2f6 JM |
1857 | } |
1858 | ||
0f71a2f6 | 1859 | int |
b8de8283 AC |
1860 | gdbarch_print_float_info_p (struct gdbarch *gdbarch) |
1861 | { | |
1862 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1863 | return gdbarch->print_float_info != NULL; |
b8de8283 AC |
1864 | } |
1865 | ||
1866 | void | |
1867 | gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) | |
0f71a2f6 | 1868 | { |
8de9bdc4 | 1869 | gdb_assert (gdbarch != NULL); |
956ac328 | 1870 | gdb_assert (gdbarch->print_float_info != NULL); |
0f71a2f6 | 1871 | if (gdbarch_debug >= 2) |
b8de8283 AC |
1872 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n"); |
1873 | gdbarch->print_float_info (gdbarch, file, frame, args); | |
0f71a2f6 JM |
1874 | } |
1875 | ||
1876 | void | |
b8de8283 AC |
1877 | set_gdbarch_print_float_info (struct gdbarch *gdbarch, |
1878 | gdbarch_print_float_info_ftype print_float_info) | |
0f71a2f6 | 1879 | { |
b8de8283 AC |
1880 | gdbarch->print_float_info = print_float_info; |
1881 | } | |
1882 | ||
1883 | int | |
1884 | gdbarch_print_vector_info_p (struct gdbarch *gdbarch) | |
1885 | { | |
1886 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1887 | return gdbarch->print_vector_info != NULL; |
b8de8283 AC |
1888 | } |
1889 | ||
1890 | void | |
1891 | gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) | |
1892 | { | |
1893 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1894 | gdb_assert (gdbarch->print_vector_info != NULL); |
b8de8283 AC |
1895 | if (gdbarch_debug >= 2) |
1896 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n"); | |
1897 | gdbarch->print_vector_info (gdbarch, file, frame, args); | |
0f71a2f6 JM |
1898 | } |
1899 | ||
b8de8283 AC |
1900 | void |
1901 | set_gdbarch_print_vector_info (struct gdbarch *gdbarch, | |
1902 | gdbarch_print_vector_info_ftype print_vector_info) | |
ae45cd16 | 1903 | { |
b8de8283 | 1904 | gdbarch->print_vector_info = print_vector_info; |
ae45cd16 AC |
1905 | } |
1906 | ||
1907 | int | |
b8de8283 | 1908 | gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr) |
0f71a2f6 | 1909 | { |
8de9bdc4 | 1910 | gdb_assert (gdbarch != NULL); |
956ac328 | 1911 | gdb_assert (gdbarch->register_sim_regno != NULL); |
0f71a2f6 | 1912 | if (gdbarch_debug >= 2) |
b8de8283 | 1913 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n"); |
e7faf938 | 1914 | return gdbarch->register_sim_regno (gdbarch, reg_nr); |
0f71a2f6 JM |
1915 | } |
1916 | ||
1917 | void | |
b8de8283 AC |
1918 | set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, |
1919 | gdbarch_register_sim_regno_ftype register_sim_regno) | |
0f71a2f6 | 1920 | { |
b8de8283 | 1921 | gdbarch->register_sim_regno = register_sim_regno; |
0f71a2f6 JM |
1922 | } |
1923 | ||
0f71a2f6 | 1924 | int |
b8de8283 | 1925 | gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum) |
0f71a2f6 | 1926 | { |
8de9bdc4 | 1927 | gdb_assert (gdbarch != NULL); |
956ac328 | 1928 | gdb_assert (gdbarch->cannot_fetch_register != NULL); |
b8de8283 AC |
1929 | if (gdbarch_debug >= 2) |
1930 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n"); | |
64a3914f | 1931 | return gdbarch->cannot_fetch_register (gdbarch, regnum); |
b8de8283 AC |
1932 | } |
1933 | ||
1934 | void | |
1935 | set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, | |
1936 | gdbarch_cannot_fetch_register_ftype cannot_fetch_register) | |
1937 | { | |
1938 | gdbarch->cannot_fetch_register = cannot_fetch_register; | |
0f71a2f6 JM |
1939 | } |
1940 | ||
1941 | int | |
b8de8283 | 1942 | gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum) |
0f71a2f6 | 1943 | { |
8de9bdc4 | 1944 | gdb_assert (gdbarch != NULL); |
956ac328 | 1945 | gdb_assert (gdbarch->cannot_store_register != NULL); |
0f71a2f6 | 1946 | if (gdbarch_debug >= 2) |
b8de8283 | 1947 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n"); |
64a3914f | 1948 | return gdbarch->cannot_store_register (gdbarch, regnum); |
0f71a2f6 JM |
1949 | } |
1950 | ||
1951 | void | |
b8de8283 AC |
1952 | set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, |
1953 | gdbarch_cannot_store_register_ftype cannot_store_register) | |
0f71a2f6 | 1954 | { |
b8de8283 | 1955 | gdbarch->cannot_store_register = cannot_store_register; |
0f71a2f6 JM |
1956 | } |
1957 | ||
e8ab51f7 | 1958 | int |
b8de8283 | 1959 | gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch) |
e8ab51f7 AC |
1960 | { |
1961 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1962 | return gdbarch->get_longjmp_target != NULL; |
e8ab51f7 AC |
1963 | } |
1964 | ||
b8de8283 | 1965 | int |
60ade65d | 1966 | gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc) |
0f71a2f6 | 1967 | { |
8de9bdc4 | 1968 | gdb_assert (gdbarch != NULL); |
956ac328 | 1969 | gdb_assert (gdbarch->get_longjmp_target != NULL); |
0f71a2f6 | 1970 | if (gdbarch_debug >= 2) |
b8de8283 | 1971 | fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n"); |
60ade65d | 1972 | return gdbarch->get_longjmp_target (frame, pc); |
0f71a2f6 JM |
1973 | } |
1974 | ||
1975 | void | |
b8de8283 AC |
1976 | set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, |
1977 | gdbarch_get_longjmp_target_ftype get_longjmp_target) | |
0f71a2f6 | 1978 | { |
b8de8283 | 1979 | gdbarch->get_longjmp_target = get_longjmp_target; |
0f71a2f6 JM |
1980 | } |
1981 | ||
1982 | int | |
104c1213 | 1983 | gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch) |
0f71a2f6 | 1984 | { |
8de9bdc4 | 1985 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 1986 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1987 | fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n"); |
1988 | return gdbarch->believe_pcc_promotion; | |
1989 | } | |
1990 | ||
1991 | void | |
104c1213 JM |
1992 | set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, |
1993 | int believe_pcc_promotion) | |
0f71a2f6 JM |
1994 | { |
1995 | gdbarch->believe_pcc_promotion = believe_pcc_promotion; | |
1996 | } | |
1997 | ||
13d01224 | 1998 | int |
ff2e87ac | 1999 | gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) |
13d01224 AC |
2000 | { |
2001 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2002 | gdb_assert (gdbarch->convert_register_p != NULL); |
13d01224 AC |
2003 | if (gdbarch_debug >= 2) |
2004 | fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n"); | |
0abe36f5 | 2005 | return gdbarch->convert_register_p (gdbarch, regnum, type); |
13d01224 AC |
2006 | } |
2007 | ||
2008 | void | |
2009 | set_gdbarch_convert_register_p (struct gdbarch *gdbarch, | |
2010 | gdbarch_convert_register_p_ftype convert_register_p) | |
2011 | { | |
2012 | gdbarch->convert_register_p = convert_register_p; | |
2013 | } | |
2014 | ||
2015 | void | |
b60c417a | 2016 | gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf) |
13d01224 AC |
2017 | { |
2018 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2019 | gdb_assert (gdbarch->register_to_value != NULL); |
13d01224 AC |
2020 | if (gdbarch_debug >= 2) |
2021 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n"); | |
ff2e87ac | 2022 | gdbarch->register_to_value (frame, regnum, type, buf); |
13d01224 AC |
2023 | } |
2024 | ||
2025 | void | |
2026 | set_gdbarch_register_to_value (struct gdbarch *gdbarch, | |
2027 | gdbarch_register_to_value_ftype register_to_value) | |
2028 | { | |
2029 | gdbarch->register_to_value = register_to_value; | |
2030 | } | |
2031 | ||
2032 | void | |
b60c417a | 2033 | gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf) |
13d01224 AC |
2034 | { |
2035 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2036 | gdb_assert (gdbarch->value_to_register != NULL); |
13d01224 AC |
2037 | if (gdbarch_debug >= 2) |
2038 | fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n"); | |
ff2e87ac | 2039 | gdbarch->value_to_register (frame, regnum, type, buf); |
13d01224 AC |
2040 | } |
2041 | ||
2042 | void | |
2043 | set_gdbarch_value_to_register (struct gdbarch *gdbarch, | |
2044 | gdbarch_value_to_register_ftype value_to_register) | |
2045 | { | |
2046 | gdbarch->value_to_register = value_to_register; | |
2047 | } | |
2048 | ||
9acbedc0 UW |
2049 | struct value * |
2050 | gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame) | |
2051 | { | |
2052 | gdb_assert (gdbarch != NULL); | |
2053 | gdb_assert (gdbarch->value_from_register != NULL); | |
2054 | if (gdbarch_debug >= 2) | |
2055 | fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n"); | |
2056 | return gdbarch->value_from_register (type, regnum, frame); | |
2057 | } | |
2058 | ||
2059 | void | |
2060 | set_gdbarch_value_from_register (struct gdbarch *gdbarch, | |
2061 | gdbarch_value_from_register_ftype value_from_register) | |
2062 | { | |
2063 | gdbarch->value_from_register = value_from_register; | |
2064 | } | |
2065 | ||
4478b372 | 2066 | CORE_ADDR |
b60c417a | 2067 | gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf) |
4478b372 | 2068 | { |
8de9bdc4 | 2069 | gdb_assert (gdbarch != NULL); |
956ac328 | 2070 | gdb_assert (gdbarch->pointer_to_address != NULL); |
4478b372 JB |
2071 | if (gdbarch_debug >= 2) |
2072 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n"); | |
2073 | return gdbarch->pointer_to_address (type, buf); | |
2074 | } | |
2075 | ||
2076 | void | |
2077 | set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, | |
2078 | gdbarch_pointer_to_address_ftype pointer_to_address) | |
2079 | { | |
2080 | gdbarch->pointer_to_address = pointer_to_address; | |
2081 | } | |
2082 | ||
2083 | void | |
b60c417a | 2084 | gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr) |
4478b372 | 2085 | { |
8de9bdc4 | 2086 | gdb_assert (gdbarch != NULL); |
956ac328 | 2087 | gdb_assert (gdbarch->address_to_pointer != NULL); |
4478b372 JB |
2088 | if (gdbarch_debug >= 2) |
2089 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n"); | |
2090 | gdbarch->address_to_pointer (type, buf, addr); | |
2091 | } | |
2092 | ||
2093 | void | |
2094 | set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, | |
2095 | gdbarch_address_to_pointer_ftype address_to_pointer) | |
2096 | { | |
2097 | gdbarch->address_to_pointer = address_to_pointer; | |
2098 | } | |
2099 | ||
fc0c74b1 AC |
2100 | int |
2101 | gdbarch_integer_to_address_p (struct gdbarch *gdbarch) | |
2102 | { | |
8de9bdc4 | 2103 | gdb_assert (gdbarch != NULL); |
956ac328 | 2104 | return gdbarch->integer_to_address != NULL; |
fc0c74b1 AC |
2105 | } |
2106 | ||
2107 | CORE_ADDR | |
fc1a4b47 | 2108 | gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf) |
fc0c74b1 | 2109 | { |
8de9bdc4 | 2110 | gdb_assert (gdbarch != NULL); |
956ac328 | 2111 | gdb_assert (gdbarch->integer_to_address != NULL); |
fc0c74b1 AC |
2112 | if (gdbarch_debug >= 2) |
2113 | fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n"); | |
79dd2d24 | 2114 | return gdbarch->integer_to_address (gdbarch, type, buf); |
fc0c74b1 AC |
2115 | } |
2116 | ||
2117 | void | |
2118 | set_gdbarch_integer_to_address (struct gdbarch *gdbarch, | |
2119 | gdbarch_integer_to_address_ftype integer_to_address) | |
2120 | { | |
2121 | gdbarch->integer_to_address = integer_to_address; | |
2122 | } | |
2123 | ||
92ad9cd9 AC |
2124 | int |
2125 | gdbarch_return_value_p (struct gdbarch *gdbarch) | |
2126 | { | |
2127 | gdb_assert (gdbarch != NULL); | |
c1874924 | 2128 | return gdbarch->return_value != NULL; |
92ad9cd9 AC |
2129 | } |
2130 | ||
2131 | enum return_value_convention | |
c055b101 | 2132 | gdbarch_return_value (struct gdbarch *gdbarch, struct type *functype, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) |
92ad9cd9 AC |
2133 | { |
2134 | gdb_assert (gdbarch != NULL); | |
2135 | gdb_assert (gdbarch->return_value != NULL); | |
2136 | if (gdbarch_debug >= 2) | |
2137 | fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n"); | |
c055b101 | 2138 | return gdbarch->return_value (gdbarch, functype, valtype, regcache, readbuf, writebuf); |
92ad9cd9 AC |
2139 | } |
2140 | ||
2141 | void | |
2142 | set_gdbarch_return_value (struct gdbarch *gdbarch, | |
2143 | gdbarch_return_value_ftype return_value) | |
2144 | { | |
2145 | gdbarch->return_value = return_value; | |
2146 | } | |
2147 | ||
0f71a2f6 JM |
2148 | CORE_ADDR |
2149 | gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) | |
2150 | { | |
8de9bdc4 | 2151 | gdb_assert (gdbarch != NULL); |
956ac328 | 2152 | gdb_assert (gdbarch->skip_prologue != NULL); |
0f71a2f6 | 2153 | if (gdbarch_debug >= 2) |
0f71a2f6 | 2154 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n"); |
6093d2eb | 2155 | return gdbarch->skip_prologue (gdbarch, ip); |
0f71a2f6 JM |
2156 | } |
2157 | ||
2158 | void | |
104c1213 JM |
2159 | set_gdbarch_skip_prologue (struct gdbarch *gdbarch, |
2160 | gdbarch_skip_prologue_ftype skip_prologue) | |
0f71a2f6 JM |
2161 | { |
2162 | gdbarch->skip_prologue = skip_prologue; | |
2163 | } | |
2164 | ||
4309257c PM |
2165 | int |
2166 | gdbarch_skip_main_prologue_p (struct gdbarch *gdbarch) | |
2167 | { | |
2168 | gdb_assert (gdbarch != NULL); | |
2169 | return gdbarch->skip_main_prologue != NULL; | |
2170 | } | |
2171 | ||
2172 | CORE_ADDR | |
2173 | gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) | |
2174 | { | |
2175 | gdb_assert (gdbarch != NULL); | |
2176 | gdb_assert (gdbarch->skip_main_prologue != NULL); | |
2177 | if (gdbarch_debug >= 2) | |
2178 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_main_prologue called\n"); | |
2179 | return gdbarch->skip_main_prologue (gdbarch, ip); | |
2180 | } | |
2181 | ||
2182 | void | |
2183 | set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch, | |
cfd8ab24 | 2184 | gdbarch_skip_main_prologue_ftype skip_main_prologue) |
4309257c PM |
2185 | { |
2186 | gdbarch->skip_main_prologue = skip_main_prologue; | |
2187 | } | |
2188 | ||
0f71a2f6 JM |
2189 | int |
2190 | gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) | |
2191 | { | |
8de9bdc4 | 2192 | gdb_assert (gdbarch != NULL); |
956ac328 | 2193 | gdb_assert (gdbarch->inner_than != NULL); |
0f71a2f6 | 2194 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2195 | fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n"); |
2196 | return gdbarch->inner_than (lhs, rhs); | |
2197 | } | |
2198 | ||
2199 | void | |
104c1213 JM |
2200 | set_gdbarch_inner_than (struct gdbarch *gdbarch, |
2201 | gdbarch_inner_than_ftype inner_than) | |
0f71a2f6 JM |
2202 | { |
2203 | gdbarch->inner_than = inner_than; | |
2204 | } | |
2205 | ||
fc1a4b47 | 2206 | const gdb_byte * |
adf40b2e | 2207 | gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) |
0f71a2f6 | 2208 | { |
8de9bdc4 | 2209 | gdb_assert (gdbarch != NULL); |
956ac328 | 2210 | gdb_assert (gdbarch->breakpoint_from_pc != NULL); |
0f71a2f6 | 2211 | if (gdbarch_debug >= 2) |
0f71a2f6 | 2212 | fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n"); |
67d57894 | 2213 | return gdbarch->breakpoint_from_pc (gdbarch, pcptr, lenptr); |
0f71a2f6 JM |
2214 | } |
2215 | ||
2216 | void | |
104c1213 JM |
2217 | set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, |
2218 | gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc) | |
0f71a2f6 JM |
2219 | { |
2220 | gdbarch->breakpoint_from_pc = breakpoint_from_pc; | |
2221 | } | |
2222 | ||
a1131521 KB |
2223 | int |
2224 | gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch) | |
2225 | { | |
2226 | gdb_assert (gdbarch != NULL); | |
2227 | return gdbarch->adjust_breakpoint_address != NULL; | |
2228 | } | |
2229 | ||
2230 | CORE_ADDR | |
2231 | gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr) | |
2232 | { | |
2233 | gdb_assert (gdbarch != NULL); | |
2234 | gdb_assert (gdbarch->adjust_breakpoint_address != NULL); | |
2235 | if (gdbarch_debug >= 2) | |
2236 | fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n"); | |
2237 | return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr); | |
2238 | } | |
2239 | ||
2240 | void | |
2241 | set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, | |
2242 | gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address) | |
2243 | { | |
2244 | gdbarch->adjust_breakpoint_address = adjust_breakpoint_address; | |
2245 | } | |
2246 | ||
917317f4 | 2247 | int |
8181d85f | 2248 | gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt) |
917317f4 | 2249 | { |
8de9bdc4 | 2250 | gdb_assert (gdbarch != NULL); |
956ac328 | 2251 | gdb_assert (gdbarch->memory_insert_breakpoint != NULL); |
917317f4 | 2252 | if (gdbarch_debug >= 2) |
917317f4 | 2253 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n"); |
ae4b2284 | 2254 | return gdbarch->memory_insert_breakpoint (gdbarch, bp_tgt); |
917317f4 JM |
2255 | } |
2256 | ||
2257 | void | |
2258 | set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, | |
2259 | gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint) | |
2260 | { | |
2261 | gdbarch->memory_insert_breakpoint = memory_insert_breakpoint; | |
2262 | } | |
2263 | ||
2264 | int | |
8181d85f | 2265 | gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt) |
917317f4 | 2266 | { |
8de9bdc4 | 2267 | gdb_assert (gdbarch != NULL); |
956ac328 | 2268 | gdb_assert (gdbarch->memory_remove_breakpoint != NULL); |
917317f4 | 2269 | if (gdbarch_debug >= 2) |
917317f4 | 2270 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n"); |
ae4b2284 | 2271 | return gdbarch->memory_remove_breakpoint (gdbarch, bp_tgt); |
917317f4 JM |
2272 | } |
2273 | ||
2274 | void | |
2275 | set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, | |
2276 | gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint) | |
2277 | { | |
2278 | gdbarch->memory_remove_breakpoint = memory_remove_breakpoint; | |
2279 | } | |
2280 | ||
0f71a2f6 | 2281 | CORE_ADDR |
104c1213 | 2282 | gdbarch_decr_pc_after_break (struct gdbarch *gdbarch) |
0f71a2f6 | 2283 | { |
8de9bdc4 | 2284 | gdb_assert (gdbarch != NULL); |
71bd6bd4 | 2285 | /* Skip verify of decr_pc_after_break, invalid_p == 0 */ |
0f71a2f6 | 2286 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2287 | fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n"); |
2288 | return gdbarch->decr_pc_after_break; | |
2289 | } | |
2290 | ||
2291 | void | |
104c1213 JM |
2292 | set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, |
2293 | CORE_ADDR decr_pc_after_break) | |
0f71a2f6 JM |
2294 | { |
2295 | gdbarch->decr_pc_after_break = decr_pc_after_break; | |
2296 | } | |
2297 | ||
2298 | CORE_ADDR | |
782263ab | 2299 | gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch) |
0f71a2f6 | 2300 | { |
8de9bdc4 | 2301 | gdb_assert (gdbarch != NULL); |
782263ab | 2302 | /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */ |
0f71a2f6 | 2303 | if (gdbarch_debug >= 2) |
782263ab AC |
2304 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n"); |
2305 | return gdbarch->deprecated_function_start_offset; | |
0f71a2f6 JM |
2306 | } |
2307 | ||
2308 | void | |
782263ab AC |
2309 | set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch, |
2310 | CORE_ADDR deprecated_function_start_offset) | |
0f71a2f6 | 2311 | { |
782263ab | 2312 | gdbarch->deprecated_function_start_offset = deprecated_function_start_offset; |
0f71a2f6 JM |
2313 | } |
2314 | ||
123dc839 DJ |
2315 | int |
2316 | gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno) | |
2317 | { | |
2318 | gdb_assert (gdbarch != NULL); | |
2319 | gdb_assert (gdbarch->remote_register_number != NULL); | |
2320 | if (gdbarch_debug >= 2) | |
2321 | fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n"); | |
2322 | return gdbarch->remote_register_number (gdbarch, regno); | |
2323 | } | |
2324 | ||
2325 | void | |
2326 | set_gdbarch_remote_register_number (struct gdbarch *gdbarch, | |
2327 | gdbarch_remote_register_number_ftype remote_register_number) | |
2328 | { | |
2329 | gdbarch->remote_register_number = remote_register_number; | |
2330 | } | |
2331 | ||
b2756930 KB |
2332 | int |
2333 | gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch) | |
2334 | { | |
2335 | gdb_assert (gdbarch != NULL); | |
2336 | return gdbarch->fetch_tls_load_module_address != NULL; | |
2337 | } | |
2338 | ||
2339 | CORE_ADDR | |
2340 | gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile) | |
2341 | { | |
2342 | gdb_assert (gdbarch != NULL); | |
2343 | gdb_assert (gdbarch->fetch_tls_load_module_address != NULL); | |
2344 | if (gdbarch_debug >= 2) | |
2345 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n"); | |
2346 | return gdbarch->fetch_tls_load_module_address (objfile); | |
2347 | } | |
2348 | ||
2349 | void | |
2350 | set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, | |
2351 | gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address) | |
2352 | { | |
2353 | gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address; | |
2354 | } | |
2355 | ||
0f71a2f6 | 2356 | CORE_ADDR |
104c1213 | 2357 | gdbarch_frame_args_skip (struct gdbarch *gdbarch) |
0f71a2f6 | 2358 | { |
8de9bdc4 | 2359 | gdb_assert (gdbarch != NULL); |
5867a2fb | 2360 | /* Skip verify of frame_args_skip, invalid_p == 0 */ |
0f71a2f6 | 2361 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2362 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n"); |
2363 | return gdbarch->frame_args_skip; | |
2364 | } | |
2365 | ||
2366 | void | |
104c1213 JM |
2367 | set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, |
2368 | CORE_ADDR frame_args_skip) | |
0f71a2f6 JM |
2369 | { |
2370 | gdbarch->frame_args_skip = frame_args_skip; | |
2371 | } | |
2372 | ||
12cc2063 AC |
2373 | int |
2374 | gdbarch_unwind_pc_p (struct gdbarch *gdbarch) | |
2375 | { | |
2376 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2377 | return gdbarch->unwind_pc != NULL; |
12cc2063 AC |
2378 | } |
2379 | ||
2380 | CORE_ADDR | |
2381 | gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) | |
2382 | { | |
2383 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2384 | gdb_assert (gdbarch->unwind_pc != NULL); |
12cc2063 AC |
2385 | if (gdbarch_debug >= 2) |
2386 | fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n"); | |
2387 | return gdbarch->unwind_pc (gdbarch, next_frame); | |
2388 | } | |
2389 | ||
2390 | void | |
2391 | set_gdbarch_unwind_pc (struct gdbarch *gdbarch, | |
2392 | gdbarch_unwind_pc_ftype unwind_pc) | |
2393 | { | |
2394 | gdbarch->unwind_pc = unwind_pc; | |
2395 | } | |
2396 | ||
a9e5fdc2 AC |
2397 | int |
2398 | gdbarch_unwind_sp_p (struct gdbarch *gdbarch) | |
2399 | { | |
2400 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2401 | return gdbarch->unwind_sp != NULL; |
a9e5fdc2 AC |
2402 | } |
2403 | ||
2404 | CORE_ADDR | |
2405 | gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) | |
2406 | { | |
2407 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2408 | gdb_assert (gdbarch->unwind_sp != NULL); |
a9e5fdc2 AC |
2409 | if (gdbarch_debug >= 2) |
2410 | fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n"); | |
2411 | return gdbarch->unwind_sp (gdbarch, next_frame); | |
2412 | } | |
2413 | ||
2414 | void | |
2415 | set_gdbarch_unwind_sp (struct gdbarch *gdbarch, | |
2416 | gdbarch_unwind_sp_ftype unwind_sp) | |
2417 | { | |
2418 | gdbarch->unwind_sp = unwind_sp; | |
2419 | } | |
2420 | ||
983a287a AC |
2421 | int |
2422 | gdbarch_frame_num_args_p (struct gdbarch *gdbarch) | |
2423 | { | |
2424 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2425 | return gdbarch->frame_num_args != NULL; |
983a287a AC |
2426 | } |
2427 | ||
0f71a2f6 JM |
2428 | int |
2429 | gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame) | |
2430 | { | |
8de9bdc4 | 2431 | gdb_assert (gdbarch != NULL); |
956ac328 | 2432 | gdb_assert (gdbarch->frame_num_args != NULL); |
0f71a2f6 | 2433 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2434 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n"); |
2435 | return gdbarch->frame_num_args (frame); | |
2436 | } | |
2437 | ||
2438 | void | |
104c1213 JM |
2439 | set_gdbarch_frame_num_args (struct gdbarch *gdbarch, |
2440 | gdbarch_frame_num_args_ftype frame_num_args) | |
0f71a2f6 JM |
2441 | { |
2442 | gdbarch->frame_num_args = frame_num_args; | |
2443 | } | |
2444 | ||
dc604539 AC |
2445 | int |
2446 | gdbarch_frame_align_p (struct gdbarch *gdbarch) | |
2447 | { | |
2448 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2449 | return gdbarch->frame_align != NULL; |
dc604539 AC |
2450 | } |
2451 | ||
2452 | CORE_ADDR | |
2453 | gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address) | |
2454 | { | |
2455 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2456 | gdb_assert (gdbarch->frame_align != NULL); |
dc604539 AC |
2457 | if (gdbarch_debug >= 2) |
2458 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n"); | |
2459 | return gdbarch->frame_align (gdbarch, address); | |
2460 | } | |
2461 | ||
2462 | void | |
2463 | set_gdbarch_frame_align (struct gdbarch *gdbarch, | |
2464 | gdbarch_frame_align_ftype frame_align) | |
2465 | { | |
2466 | gdbarch->frame_align = frame_align; | |
2467 | } | |
2468 | ||
192cb3d4 MK |
2469 | int |
2470 | gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type) | |
2471 | { | |
2472 | gdb_assert (gdbarch != NULL); | |
2473 | gdb_assert (gdbarch->stabs_argument_has_addr != NULL); | |
2474 | if (gdbarch_debug >= 2) | |
2475 | fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n"); | |
2476 | return gdbarch->stabs_argument_has_addr (gdbarch, type); | |
2477 | } | |
2478 | ||
2479 | void | |
2480 | set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, | |
2481 | gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr) | |
2482 | { | |
2483 | gdbarch->stabs_argument_has_addr = stabs_argument_has_addr; | |
2484 | } | |
2485 | ||
8b148df9 AC |
2486 | int |
2487 | gdbarch_frame_red_zone_size (struct gdbarch *gdbarch) | |
2488 | { | |
2489 | gdb_assert (gdbarch != NULL); | |
2490 | if (gdbarch_debug >= 2) | |
2491 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n"); | |
2492 | return gdbarch->frame_red_zone_size; | |
2493 | } | |
2494 | ||
2495 | void | |
2496 | set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch, | |
2497 | int frame_red_zone_size) | |
2498 | { | |
2499 | gdbarch->frame_red_zone_size = frame_red_zone_size; | |
2500 | } | |
2501 | ||
f517ea4e | 2502 | CORE_ADDR |
e2d0e7eb | 2503 | gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ) |
f517ea4e | 2504 | { |
8de9bdc4 | 2505 | gdb_assert (gdbarch != NULL); |
956ac328 | 2506 | gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL); |
f517ea4e PS |
2507 | if (gdbarch_debug >= 2) |
2508 | fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n"); | |
e2d0e7eb | 2509 | return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ); |
f517ea4e PS |
2510 | } |
2511 | ||
2512 | void | |
2513 | set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, | |
2514 | gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr) | |
2515 | { | |
2516 | gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr; | |
2517 | } | |
2518 | ||
875e1767 AC |
2519 | CORE_ADDR |
2520 | gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr) | |
2521 | { | |
8de9bdc4 | 2522 | gdb_assert (gdbarch != NULL); |
956ac328 | 2523 | gdb_assert (gdbarch->addr_bits_remove != NULL); |
875e1767 AC |
2524 | if (gdbarch_debug >= 2) |
2525 | fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n"); | |
24568a2c | 2526 | return gdbarch->addr_bits_remove (gdbarch, addr); |
875e1767 AC |
2527 | } |
2528 | ||
2529 | void | |
2530 | set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, | |
2531 | gdbarch_addr_bits_remove_ftype addr_bits_remove) | |
2532 | { | |
2533 | gdbarch->addr_bits_remove = addr_bits_remove; | |
2534 | } | |
2535 | ||
181c1381 RE |
2536 | CORE_ADDR |
2537 | gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr) | |
2538 | { | |
8de9bdc4 | 2539 | gdb_assert (gdbarch != NULL); |
956ac328 | 2540 | gdb_assert (gdbarch->smash_text_address != NULL); |
181c1381 RE |
2541 | if (gdbarch_debug >= 2) |
2542 | fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n"); | |
24568a2c | 2543 | return gdbarch->smash_text_address (gdbarch, addr); |
181c1381 RE |
2544 | } |
2545 | ||
2546 | void | |
2547 | set_gdbarch_smash_text_address (struct gdbarch *gdbarch, | |
2548 | gdbarch_smash_text_address_ftype smash_text_address) | |
2549 | { | |
2550 | gdbarch->smash_text_address = smash_text_address; | |
2551 | } | |
2552 | ||
64c4637f AC |
2553 | int |
2554 | gdbarch_software_single_step_p (struct gdbarch *gdbarch) | |
2555 | { | |
8de9bdc4 | 2556 | gdb_assert (gdbarch != NULL); |
956ac328 | 2557 | return gdbarch->software_single_step != NULL; |
64c4637f AC |
2558 | } |
2559 | ||
e6590a1b | 2560 | int |
0b1b3e42 | 2561 | gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame) |
64c4637f | 2562 | { |
8de9bdc4 | 2563 | gdb_assert (gdbarch != NULL); |
956ac328 | 2564 | gdb_assert (gdbarch->software_single_step != NULL); |
64c4637f AC |
2565 | if (gdbarch_debug >= 2) |
2566 | fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n"); | |
0b1b3e42 | 2567 | return gdbarch->software_single_step (frame); |
64c4637f AC |
2568 | } |
2569 | ||
2570 | void | |
2571 | set_gdbarch_software_single_step (struct gdbarch *gdbarch, | |
2572 | gdbarch_software_single_step_ftype software_single_step) | |
2573 | { | |
2574 | gdbarch->software_single_step = software_single_step; | |
2575 | } | |
2576 | ||
3352ef37 AC |
2577 | int |
2578 | gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch) | |
2579 | { | |
2580 | gdb_assert (gdbarch != NULL); | |
2581 | return gdbarch->single_step_through_delay != NULL; | |
2582 | } | |
2583 | ||
2584 | int | |
2585 | gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame) | |
2586 | { | |
2587 | gdb_assert (gdbarch != NULL); | |
2588 | gdb_assert (gdbarch->single_step_through_delay != NULL); | |
2589 | if (gdbarch_debug >= 2) | |
2590 | fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n"); | |
2591 | return gdbarch->single_step_through_delay (gdbarch, frame); | |
2592 | } | |
2593 | ||
2594 | void | |
2595 | set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch, | |
2596 | gdbarch_single_step_through_delay_ftype single_step_through_delay) | |
2597 | { | |
2598 | gdbarch->single_step_through_delay = single_step_through_delay; | |
2599 | } | |
2600 | ||
2bf0cb65 | 2601 | int |
a89aa300 | 2602 | gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info) |
2bf0cb65 | 2603 | { |
8de9bdc4 | 2604 | gdb_assert (gdbarch != NULL); |
956ac328 | 2605 | gdb_assert (gdbarch->print_insn != NULL); |
2bf0cb65 EZ |
2606 | if (gdbarch_debug >= 2) |
2607 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n"); | |
2608 | return gdbarch->print_insn (vma, info); | |
2609 | } | |
2610 | ||
2611 | void | |
2612 | set_gdbarch_print_insn (struct gdbarch *gdbarch, | |
2613 | gdbarch_print_insn_ftype print_insn) | |
2614 | { | |
2615 | gdbarch->print_insn = print_insn; | |
2616 | } | |
2617 | ||
bdcd319a | 2618 | CORE_ADDR |
52f729a7 | 2619 | gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc) |
bdcd319a | 2620 | { |
8de9bdc4 | 2621 | gdb_assert (gdbarch != NULL); |
956ac328 | 2622 | gdb_assert (gdbarch->skip_trampoline_code != NULL); |
bdcd319a CV |
2623 | if (gdbarch_debug >= 2) |
2624 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n"); | |
52f729a7 | 2625 | return gdbarch->skip_trampoline_code (frame, pc); |
bdcd319a CV |
2626 | } |
2627 | ||
2628 | void | |
2629 | set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, | |
2630 | gdbarch_skip_trampoline_code_ftype skip_trampoline_code) | |
2631 | { | |
2632 | gdbarch->skip_trampoline_code = skip_trampoline_code; | |
2633 | } | |
2634 | ||
dea0c52f MK |
2635 | CORE_ADDR |
2636 | gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) | |
2637 | { | |
2638 | gdb_assert (gdbarch != NULL); | |
2639 | gdb_assert (gdbarch->skip_solib_resolver != NULL); | |
2640 | if (gdbarch_debug >= 2) | |
2641 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n"); | |
4c8c40e6 | 2642 | return gdbarch->skip_solib_resolver (gdbarch, pc); |
dea0c52f MK |
2643 | } |
2644 | ||
2645 | void | |
2646 | set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, | |
2647 | gdbarch_skip_solib_resolver_ftype skip_solib_resolver) | |
2648 | { | |
2649 | gdbarch->skip_solib_resolver = skip_solib_resolver; | |
2650 | } | |
2651 | ||
d50355b6 MS |
2652 | int |
2653 | gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name) | |
2654 | { | |
2655 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2656 | gdb_assert (gdbarch->in_solib_return_trampoline != NULL); |
d50355b6 MS |
2657 | if (gdbarch_debug >= 2) |
2658 | fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n"); | |
2659 | return gdbarch->in_solib_return_trampoline (pc, name); | |
2660 | } | |
2661 | ||
2662 | void | |
2663 | set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, | |
2664 | gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline) | |
2665 | { | |
2666 | gdbarch->in_solib_return_trampoline = in_solib_return_trampoline; | |
2667 | } | |
2668 | ||
c12260ac CV |
2669 | int |
2670 | gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr) | |
2671 | { | |
8de9bdc4 | 2672 | gdb_assert (gdbarch != NULL); |
956ac328 | 2673 | gdb_assert (gdbarch->in_function_epilogue_p != NULL); |
c12260ac CV |
2674 | if (gdbarch_debug >= 2) |
2675 | fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n"); | |
2676 | return gdbarch->in_function_epilogue_p (gdbarch, addr); | |
2677 | } | |
2678 | ||
2679 | void | |
2680 | set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, | |
2681 | gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p) | |
2682 | { | |
2683 | gdbarch->in_function_epilogue_p = in_function_epilogue_p; | |
2684 | } | |
2685 | ||
552c04a7 TT |
2686 | char * |
2687 | gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv) | |
2688 | { | |
8de9bdc4 | 2689 | gdb_assert (gdbarch != NULL); |
956ac328 | 2690 | gdb_assert (gdbarch->construct_inferior_arguments != NULL); |
552c04a7 TT |
2691 | if (gdbarch_debug >= 2) |
2692 | fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n"); | |
2693 | return gdbarch->construct_inferior_arguments (gdbarch, argc, argv); | |
2694 | } | |
2695 | ||
2696 | void | |
2697 | set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, | |
2698 | gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments) | |
2699 | { | |
2700 | gdbarch->construct_inferior_arguments = construct_inferior_arguments; | |
2701 | } | |
2702 | ||
a2cf933a EZ |
2703 | void |
2704 | gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym) | |
2705 | { | |
8de9bdc4 | 2706 | gdb_assert (gdbarch != NULL); |
956ac328 | 2707 | gdb_assert (gdbarch->elf_make_msymbol_special != NULL); |
a2cf933a EZ |
2708 | if (gdbarch_debug >= 2) |
2709 | fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n"); | |
2710 | gdbarch->elf_make_msymbol_special (sym, msym); | |
2711 | } | |
2712 | ||
2713 | void | |
2714 | set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, | |
2715 | gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special) | |
2716 | { | |
2717 | gdbarch->elf_make_msymbol_special = elf_make_msymbol_special; | |
2718 | } | |
2719 | ||
2720 | void | |
2721 | gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym) | |
2722 | { | |
8de9bdc4 | 2723 | gdb_assert (gdbarch != NULL); |
956ac328 | 2724 | gdb_assert (gdbarch->coff_make_msymbol_special != NULL); |
a2cf933a EZ |
2725 | if (gdbarch_debug >= 2) |
2726 | fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n"); | |
2727 | gdbarch->coff_make_msymbol_special (val, msym); | |
2728 | } | |
2729 | ||
2730 | void | |
2731 | set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, | |
2732 | gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special) | |
2733 | { | |
2734 | gdbarch->coff_make_msymbol_special = coff_make_msymbol_special; | |
2735 | } | |
2736 | ||
c4ed33b9 AC |
2737 | int |
2738 | gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch) | |
2739 | { | |
2740 | gdb_assert (gdbarch != NULL); | |
2741 | /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */ | |
2742 | if (gdbarch_debug >= 2) | |
2743 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n"); | |
2744 | return gdbarch->cannot_step_breakpoint; | |
2745 | } | |
2746 | ||
2747 | void | |
2748 | set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, | |
2749 | int cannot_step_breakpoint) | |
2750 | { | |
2751 | gdbarch->cannot_step_breakpoint = cannot_step_breakpoint; | |
2752 | } | |
2753 | ||
f74fa174 MM |
2754 | int |
2755 | gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch) | |
2756 | { | |
2757 | gdb_assert (gdbarch != NULL); | |
2758 | /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */ | |
2759 | if (gdbarch_debug >= 2) | |
2760 | fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n"); | |
2761 | return gdbarch->have_nonsteppable_watchpoint; | |
2762 | } | |
2763 | ||
2764 | void | |
2765 | set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, | |
967c0d83 | 2766 | int have_nonsteppable_watchpoint) |
f74fa174 MM |
2767 | { |
2768 | gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint; | |
2769 | } | |
2770 | ||
8b2dbe47 KB |
2771 | int |
2772 | gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch) | |
2773 | { | |
2774 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2775 | return gdbarch->address_class_type_flags != NULL; |
8b2dbe47 KB |
2776 | } |
2777 | ||
2778 | int | |
2779 | gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class) | |
2780 | { | |
2781 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2782 | gdb_assert (gdbarch->address_class_type_flags != NULL); |
8b2dbe47 KB |
2783 | if (gdbarch_debug >= 2) |
2784 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n"); | |
2785 | return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class); | |
2786 | } | |
2787 | ||
2788 | void | |
2789 | set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, | |
2790 | gdbarch_address_class_type_flags_ftype address_class_type_flags) | |
2791 | { | |
2792 | gdbarch->address_class_type_flags = address_class_type_flags; | |
2793 | } | |
2794 | ||
2795 | int | |
2796 | gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch) | |
2797 | { | |
2798 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2799 | return gdbarch->address_class_type_flags_to_name != NULL; |
8b2dbe47 KB |
2800 | } |
2801 | ||
321432c0 | 2802 | const char * |
8b2dbe47 KB |
2803 | gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags) |
2804 | { | |
2805 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2806 | gdb_assert (gdbarch->address_class_type_flags_to_name != NULL); |
8b2dbe47 KB |
2807 | if (gdbarch_debug >= 2) |
2808 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n"); | |
5f11f355 | 2809 | return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags); |
8b2dbe47 KB |
2810 | } |
2811 | ||
2812 | void | |
2813 | set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, | |
2814 | gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name) | |
2815 | { | |
2816 | gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name; | |
2817 | } | |
2818 | ||
2819 | int | |
2820 | gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch) | |
2821 | { | |
2822 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2823 | return gdbarch->address_class_name_to_type_flags != NULL; |
8b2dbe47 KB |
2824 | } |
2825 | ||
2826 | int | |
321432c0 | 2827 | gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr) |
8b2dbe47 KB |
2828 | { |
2829 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2830 | gdb_assert (gdbarch->address_class_name_to_type_flags != NULL); |
8b2dbe47 KB |
2831 | if (gdbarch_debug >= 2) |
2832 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n"); | |
5f11f355 | 2833 | return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr); |
8b2dbe47 KB |
2834 | } |
2835 | ||
2836 | void | |
2837 | set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, | |
2838 | gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags) | |
2839 | { | |
2840 | gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags; | |
2841 | } | |
2842 | ||
b59ff9d5 AC |
2843 | int |
2844 | gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup) | |
2845 | { | |
2846 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2847 | gdb_assert (gdbarch->register_reggroup_p != NULL); |
b59ff9d5 AC |
2848 | if (gdbarch_debug >= 2) |
2849 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n"); | |
2850 | return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup); | |
2851 | } | |
2852 | ||
2853 | void | |
2854 | set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, | |
2855 | gdbarch_register_reggroup_p_ftype register_reggroup_p) | |
2856 | { | |
2857 | gdbarch->register_reggroup_p = register_reggroup_p; | |
2858 | } | |
2859 | ||
143985b7 AF |
2860 | int |
2861 | gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch) | |
2862 | { | |
2863 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2864 | return gdbarch->fetch_pointer_argument != NULL; |
143985b7 AF |
2865 | } |
2866 | ||
2867 | CORE_ADDR | |
2868 | gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type) | |
2869 | { | |
2870 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2871 | gdb_assert (gdbarch->fetch_pointer_argument != NULL); |
143985b7 AF |
2872 | if (gdbarch_debug >= 2) |
2873 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n"); | |
2874 | return gdbarch->fetch_pointer_argument (frame, argi, type); | |
2875 | } | |
2876 | ||
2877 | void | |
2878 | set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, | |
2879 | gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument) | |
2880 | { | |
2881 | gdbarch->fetch_pointer_argument = fetch_pointer_argument; | |
2882 | } | |
2883 | ||
6ce6d90f MK |
2884 | int |
2885 | gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch) | |
2886 | { | |
2887 | gdb_assert (gdbarch != NULL); | |
2888 | return gdbarch->regset_from_core_section != NULL; | |
2889 | } | |
2890 | ||
2891 | const struct regset * | |
2892 | gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size) | |
2893 | { | |
2894 | gdb_assert (gdbarch != NULL); | |
2895 | gdb_assert (gdbarch->regset_from_core_section != NULL); | |
2896 | if (gdbarch_debug >= 2) | |
2897 | fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n"); | |
2898 | return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size); | |
2899 | } | |
2900 | ||
2901 | void | |
2902 | set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch, | |
2903 | gdbarch_regset_from_core_section_ftype regset_from_core_section) | |
2904 | { | |
2905 | gdbarch->regset_from_core_section = regset_from_core_section; | |
2906 | } | |
2907 | ||
959b8724 PA |
2908 | int |
2909 | gdbarch_core_reg_section_encodes_pid (struct gdbarch *gdbarch) | |
2910 | { | |
2911 | gdb_assert (gdbarch != NULL); | |
2912 | /* Skip verify of core_reg_section_encodes_pid, invalid_p == 0 */ | |
2913 | if (gdbarch_debug >= 2) | |
2914 | fprintf_unfiltered (gdb_stdlog, "gdbarch_core_reg_section_encodes_pid called\n"); | |
2915 | return gdbarch->core_reg_section_encodes_pid; | |
2916 | } | |
2917 | ||
2918 | void | |
2919 | set_gdbarch_core_reg_section_encodes_pid (struct gdbarch *gdbarch, | |
2920 | int core_reg_section_encodes_pid) | |
2921 | { | |
2922 | gdbarch->core_reg_section_encodes_pid = core_reg_section_encodes_pid; | |
2923 | } | |
2924 | ||
17ea7499 CES |
2925 | struct core_regset_section * |
2926 | gdbarch_core_regset_sections (struct gdbarch *gdbarch) | |
2927 | { | |
2928 | gdb_assert (gdbarch != NULL); | |
2929 | if (gdbarch_debug >= 2) | |
2930 | fprintf_unfiltered (gdb_stdlog, "gdbarch_core_regset_sections called\n"); | |
2931 | return gdbarch->core_regset_sections; | |
2932 | } | |
2933 | ||
2934 | void | |
2935 | set_gdbarch_core_regset_sections (struct gdbarch *gdbarch, | |
2936 | struct core_regset_section * core_regset_sections) | |
2937 | { | |
2938 | gdbarch->core_regset_sections = core_regset_sections; | |
2939 | } | |
2940 | ||
de584861 PA |
2941 | int |
2942 | gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch) | |
2943 | { | |
2944 | gdb_assert (gdbarch != NULL); | |
2945 | return gdbarch->core_xfer_shared_libraries != NULL; | |
2946 | } | |
2947 | ||
2948 | LONGEST | |
2949 | gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len) | |
2950 | { | |
2951 | gdb_assert (gdbarch != NULL); | |
2952 | gdb_assert (gdbarch->core_xfer_shared_libraries != NULL); | |
2953 | if (gdbarch_debug >= 2) | |
2954 | fprintf_unfiltered (gdb_stdlog, "gdbarch_core_xfer_shared_libraries called\n"); | |
2955 | return gdbarch->core_xfer_shared_libraries (gdbarch, readbuf, offset, len); | |
2956 | } | |
2957 | ||
2958 | void | |
2959 | set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, | |
2960 | gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries) | |
2961 | { | |
2962 | gdbarch->core_xfer_shared_libraries = core_xfer_shared_libraries; | |
2963 | } | |
2964 | ||
0d5de010 DJ |
2965 | int |
2966 | gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch) | |
2967 | { | |
2968 | gdb_assert (gdbarch != NULL); | |
2969 | /* Skip verify of vtable_function_descriptors, invalid_p == 0 */ | |
2970 | if (gdbarch_debug >= 2) | |
2971 | fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n"); | |
2972 | return gdbarch->vtable_function_descriptors; | |
2973 | } | |
2974 | ||
2975 | void | |
2976 | set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch, | |
2977 | int vtable_function_descriptors) | |
2978 | { | |
2979 | gdbarch->vtable_function_descriptors = vtable_function_descriptors; | |
2980 | } | |
2981 | ||
2982 | int | |
2983 | gdbarch_vbit_in_delta (struct gdbarch *gdbarch) | |
2984 | { | |
2985 | gdb_assert (gdbarch != NULL); | |
2986 | /* Skip verify of vbit_in_delta, invalid_p == 0 */ | |
2987 | if (gdbarch_debug >= 2) | |
2988 | fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n"); | |
2989 | return gdbarch->vbit_in_delta; | |
2990 | } | |
2991 | ||
2992 | void | |
2993 | set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch, | |
2994 | int vbit_in_delta) | |
2995 | { | |
2996 | gdbarch->vbit_in_delta = vbit_in_delta; | |
2997 | } | |
2998 | ||
6d350bb5 UW |
2999 | int |
3000 | gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch) | |
3001 | { | |
3002 | gdb_assert (gdbarch != NULL); | |
3003 | return gdbarch->skip_permanent_breakpoint != NULL; | |
3004 | } | |
3005 | ||
3006 | void | |
3007 | gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache) | |
3008 | { | |
3009 | gdb_assert (gdbarch != NULL); | |
3010 | gdb_assert (gdbarch->skip_permanent_breakpoint != NULL); | |
3011 | if (gdbarch_debug >= 2) | |
3012 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n"); | |
3013 | gdbarch->skip_permanent_breakpoint (regcache); | |
3014 | } | |
3015 | ||
3016 | void | |
3017 | set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, | |
3018 | gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint) | |
3019 | { | |
3020 | gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint; | |
3021 | } | |
3022 | ||
237fc4c9 PA |
3023 | int |
3024 | gdbarch_max_insn_length_p (struct gdbarch *gdbarch) | |
3025 | { | |
3026 | gdb_assert (gdbarch != NULL); | |
3027 | return gdbarch->max_insn_length != 0; | |
3028 | } | |
3029 | ||
3030 | ULONGEST | |
3031 | gdbarch_max_insn_length (struct gdbarch *gdbarch) | |
3032 | { | |
3033 | gdb_assert (gdbarch != NULL); | |
3034 | /* Check variable changed from pre-default. */ | |
3035 | gdb_assert (gdbarch->max_insn_length != 0); | |
3036 | if (gdbarch_debug >= 2) | |
3037 | fprintf_unfiltered (gdb_stdlog, "gdbarch_max_insn_length called\n"); | |
3038 | return gdbarch->max_insn_length; | |
3039 | } | |
3040 | ||
3041 | void | |
3042 | set_gdbarch_max_insn_length (struct gdbarch *gdbarch, | |
3043 | ULONGEST max_insn_length) | |
3044 | { | |
3045 | gdbarch->max_insn_length = max_insn_length; | |
3046 | } | |
3047 | ||
3048 | int | |
3049 | gdbarch_displaced_step_copy_insn_p (struct gdbarch *gdbarch) | |
3050 | { | |
3051 | gdb_assert (gdbarch != NULL); | |
3052 | return gdbarch->displaced_step_copy_insn != NULL; | |
3053 | } | |
3054 | ||
3055 | struct displaced_step_closure * | |
3056 | gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs) | |
3057 | { | |
3058 | gdb_assert (gdbarch != NULL); | |
3059 | gdb_assert (gdbarch->displaced_step_copy_insn != NULL); | |
3060 | if (gdbarch_debug >= 2) | |
3061 | fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_copy_insn called\n"); | |
3062 | return gdbarch->displaced_step_copy_insn (gdbarch, from, to, regs); | |
3063 | } | |
3064 | ||
3065 | void | |
3066 | set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, | |
3067 | gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn) | |
3068 | { | |
3069 | gdbarch->displaced_step_copy_insn = displaced_step_copy_insn; | |
3070 | } | |
3071 | ||
3072 | int | |
3073 | gdbarch_displaced_step_fixup_p (struct gdbarch *gdbarch) | |
3074 | { | |
3075 | gdb_assert (gdbarch != NULL); | |
3076 | return gdbarch->displaced_step_fixup != NULL; | |
3077 | } | |
3078 | ||
3079 | void | |
3080 | gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs) | |
3081 | { | |
3082 | gdb_assert (gdbarch != NULL); | |
3083 | gdb_assert (gdbarch->displaced_step_fixup != NULL); | |
3084 | /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */ | |
3085 | if (gdbarch_debug >= 2) | |
3086 | fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_fixup called\n"); | |
3087 | gdbarch->displaced_step_fixup (gdbarch, closure, from, to, regs); | |
3088 | } | |
3089 | ||
3090 | void | |
3091 | set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, | |
3092 | gdbarch_displaced_step_fixup_ftype displaced_step_fixup) | |
3093 | { | |
3094 | gdbarch->displaced_step_fixup = displaced_step_fixup; | |
3095 | } | |
3096 | ||
3097 | void | |
3098 | gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, struct displaced_step_closure *closure) | |
3099 | { | |
3100 | gdb_assert (gdbarch != NULL); | |
3101 | gdb_assert (gdbarch->displaced_step_free_closure != NULL); | |
3102 | if (gdbarch_debug >= 2) | |
3103 | fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_free_closure called\n"); | |
3104 | gdbarch->displaced_step_free_closure (gdbarch, closure); | |
3105 | } | |
3106 | ||
3107 | void | |
3108 | set_gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, | |
3109 | gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure) | |
3110 | { | |
3111 | gdbarch->displaced_step_free_closure = displaced_step_free_closure; | |
3112 | } | |
3113 | ||
3114 | CORE_ADDR | |
3115 | gdbarch_displaced_step_location (struct gdbarch *gdbarch) | |
3116 | { | |
3117 | gdb_assert (gdbarch != NULL); | |
3118 | gdb_assert (gdbarch->displaced_step_location != NULL); | |
3119 | if (gdbarch_debug >= 2) | |
3120 | fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_location called\n"); | |
3121 | return gdbarch->displaced_step_location (gdbarch); | |
3122 | } | |
3123 | ||
3124 | void | |
3125 | set_gdbarch_displaced_step_location (struct gdbarch *gdbarch, | |
3126 | gdbarch_displaced_step_location_ftype displaced_step_location) | |
3127 | { | |
3128 | gdbarch->displaced_step_location = displaced_step_location; | |
3129 | } | |
3130 | ||
1c772458 UW |
3131 | int |
3132 | gdbarch_overlay_update_p (struct gdbarch *gdbarch) | |
3133 | { | |
3134 | gdb_assert (gdbarch != NULL); | |
3135 | return gdbarch->overlay_update != NULL; | |
3136 | } | |
3137 | ||
3138 | void | |
3139 | gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect) | |
3140 | { | |
3141 | gdb_assert (gdbarch != NULL); | |
3142 | gdb_assert (gdbarch->overlay_update != NULL); | |
3143 | if (gdbarch_debug >= 2) | |
3144 | fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n"); | |
3145 | gdbarch->overlay_update (osect); | |
3146 | } | |
3147 | ||
3148 | void | |
3149 | set_gdbarch_overlay_update (struct gdbarch *gdbarch, | |
3150 | gdbarch_overlay_update_ftype overlay_update) | |
3151 | { | |
3152 | gdbarch->overlay_update = overlay_update; | |
3153 | } | |
3154 | ||
4eb0ad19 DJ |
3155 | int |
3156 | gdbarch_core_read_description_p (struct gdbarch *gdbarch) | |
3157 | { | |
3158 | gdb_assert (gdbarch != NULL); | |
3159 | return gdbarch->core_read_description != NULL; | |
3160 | } | |
3161 | ||
3162 | const struct target_desc * | |
3163 | gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd) | |
3164 | { | |
3165 | gdb_assert (gdbarch != NULL); | |
3166 | gdb_assert (gdbarch->core_read_description != NULL); | |
3167 | if (gdbarch_debug >= 2) | |
3168 | fprintf_unfiltered (gdb_stdlog, "gdbarch_core_read_description called\n"); | |
3169 | return gdbarch->core_read_description (gdbarch, target, abfd); | |
3170 | } | |
3171 | ||
3172 | void | |
3173 | set_gdbarch_core_read_description (struct gdbarch *gdbarch, | |
3174 | gdbarch_core_read_description_ftype core_read_description) | |
3175 | { | |
3176 | gdbarch->core_read_description = core_read_description; | |
3177 | } | |
3178 | ||
149ad273 UW |
3179 | int |
3180 | gdbarch_static_transform_name_p (struct gdbarch *gdbarch) | |
3181 | { | |
3182 | gdb_assert (gdbarch != NULL); | |
3183 | return gdbarch->static_transform_name != NULL; | |
3184 | } | |
3185 | ||
3186 | char * | |
3187 | gdbarch_static_transform_name (struct gdbarch *gdbarch, char *name) | |
3188 | { | |
3189 | gdb_assert (gdbarch != NULL); | |
3190 | gdb_assert (gdbarch->static_transform_name != NULL); | |
3191 | if (gdbarch_debug >= 2) | |
3192 | fprintf_unfiltered (gdb_stdlog, "gdbarch_static_transform_name called\n"); | |
3193 | return gdbarch->static_transform_name (name); | |
3194 | } | |
3195 | ||
3196 | void | |
3197 | set_gdbarch_static_transform_name (struct gdbarch *gdbarch, | |
3198 | gdbarch_static_transform_name_ftype static_transform_name) | |
3199 | { | |
3200 | gdbarch->static_transform_name = static_transform_name; | |
3201 | } | |
3202 | ||
203c3895 UW |
3203 | int |
3204 | gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch) | |
3205 | { | |
3206 | gdb_assert (gdbarch != NULL); | |
3207 | /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */ | |
3208 | if (gdbarch_debug >= 2) | |
3209 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sofun_address_maybe_missing called\n"); | |
3210 | return gdbarch->sofun_address_maybe_missing; | |
3211 | } | |
3212 | ||
3213 | void | |
3214 | set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch, | |
3215 | int sofun_address_maybe_missing) | |
3216 | { | |
3217 | gdbarch->sofun_address_maybe_missing = sofun_address_maybe_missing; | |
3218 | } | |
3219 | ||
1cded358 AR |
3220 | enum target_signal |
3221 | gdbarch_target_signal_from_host (struct gdbarch *gdbarch, int signo) | |
3222 | { | |
3223 | gdb_assert (gdbarch != NULL); | |
3224 | gdb_assert (gdbarch->target_signal_from_host != NULL); | |
3225 | if (gdbarch_debug >= 2) | |
3226 | fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_from_host called\n"); | |
3227 | return gdbarch->target_signal_from_host (gdbarch, signo); | |
3228 | } | |
3229 | ||
3230 | void | |
3231 | set_gdbarch_target_signal_from_host (struct gdbarch *gdbarch, | |
3232 | gdbarch_target_signal_from_host_ftype target_signal_from_host) | |
3233 | { | |
3234 | gdbarch->target_signal_from_host = target_signal_from_host; | |
3235 | } | |
3236 | ||
3237 | int | |
3238 | gdbarch_target_signal_to_host (struct gdbarch *gdbarch, enum target_signal ts) | |
3239 | { | |
3240 | gdb_assert (gdbarch != NULL); | |
3241 | gdb_assert (gdbarch->target_signal_to_host != NULL); | |
3242 | if (gdbarch_debug >= 2) | |
3243 | fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_to_host called\n"); | |
3244 | return gdbarch->target_signal_to_host (gdbarch, ts); | |
3245 | } | |
3246 | ||
3247 | void | |
3248 | set_gdbarch_target_signal_to_host (struct gdbarch *gdbarch, | |
3249 | gdbarch_target_signal_to_host_ftype target_signal_to_host) | |
3250 | { | |
3251 | gdbarch->target_signal_to_host = target_signal_to_host; | |
3252 | } | |
3253 | ||
4aa995e1 PA |
3254 | int |
3255 | gdbarch_get_siginfo_type_p (struct gdbarch *gdbarch) | |
3256 | { | |
3257 | gdb_assert (gdbarch != NULL); | |
3258 | return gdbarch->get_siginfo_type != NULL; | |
3259 | } | |
3260 | ||
3261 | struct type * | |
3262 | gdbarch_get_siginfo_type (struct gdbarch *gdbarch) | |
3263 | { | |
3264 | gdb_assert (gdbarch != NULL); | |
3265 | gdb_assert (gdbarch->get_siginfo_type != NULL); | |
3266 | if (gdbarch_debug >= 2) | |
3267 | fprintf_unfiltered (gdb_stdlog, "gdbarch_get_siginfo_type called\n"); | |
3268 | return gdbarch->get_siginfo_type (gdbarch); | |
3269 | } | |
3270 | ||
3271 | void | |
3272 | set_gdbarch_get_siginfo_type (struct gdbarch *gdbarch, | |
3273 | gdbarch_get_siginfo_type_ftype get_siginfo_type) | |
3274 | { | |
3275 | gdbarch->get_siginfo_type = get_siginfo_type; | |
3276 | } | |
3277 | ||
60c5725c DJ |
3278 | int |
3279 | gdbarch_record_special_symbol_p (struct gdbarch *gdbarch) | |
3280 | { | |
3281 | gdb_assert (gdbarch != NULL); | |
3282 | return gdbarch->record_special_symbol != NULL; | |
3283 | } | |
3284 | ||
3285 | void | |
3286 | gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym) | |
3287 | { | |
3288 | gdb_assert (gdbarch != NULL); | |
3289 | gdb_assert (gdbarch->record_special_symbol != NULL); | |
3290 | if (gdbarch_debug >= 2) | |
3291 | fprintf_unfiltered (gdb_stdlog, "gdbarch_record_special_symbol called\n"); | |
3292 | gdbarch->record_special_symbol (gdbarch, objfile, sym); | |
3293 | } | |
3294 | ||
3295 | void | |
3296 | set_gdbarch_record_special_symbol (struct gdbarch *gdbarch, | |
3297 | gdbarch_record_special_symbol_ftype record_special_symbol) | |
3298 | { | |
3299 | gdbarch->record_special_symbol = record_special_symbol; | |
3300 | } | |
3301 | ||
50c71eaf PA |
3302 | int |
3303 | gdbarch_has_global_solist (struct gdbarch *gdbarch) | |
3304 | { | |
3305 | gdb_assert (gdbarch != NULL); | |
3306 | /* Skip verify of has_global_solist, invalid_p == 0 */ | |
3307 | if (gdbarch_debug >= 2) | |
3308 | fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_solist called\n"); | |
3309 | return gdbarch->has_global_solist; | |
3310 | } | |
3311 | ||
3312 | void | |
3313 | set_gdbarch_has_global_solist (struct gdbarch *gdbarch, | |
3314 | int has_global_solist) | |
3315 | { | |
3316 | gdbarch->has_global_solist = has_global_solist; | |
3317 | } | |
3318 | ||
0f71a2f6 | 3319 | |
be5a57e1 | 3320 | /* Keep a registry of per-architecture data-pointers required by GDB |
0f71a2f6 JM |
3321 | modules. */ |
3322 | ||
3323 | struct gdbarch_data | |
3324 | { | |
95160752 | 3325 | unsigned index; |
76860b5f | 3326 | int init_p; |
030f20e1 AC |
3327 | gdbarch_data_pre_init_ftype *pre_init; |
3328 | gdbarch_data_post_init_ftype *post_init; | |
0f71a2f6 JM |
3329 | }; |
3330 | ||
3331 | struct gdbarch_data_registration | |
adf40b2e | 3332 | { |
adf40b2e JM |
3333 | struct gdbarch_data *data; |
3334 | struct gdbarch_data_registration *next; | |
3335 | }; | |
0f71a2f6 | 3336 | |
be5a57e1 | 3337 | struct gdbarch_data_registry |
adf40b2e | 3338 | { |
95160752 | 3339 | unsigned nr; |
adf40b2e JM |
3340 | struct gdbarch_data_registration *registrations; |
3341 | }; | |
0f71a2f6 | 3342 | |
be5a57e1 | 3343 | struct gdbarch_data_registry gdbarch_data_registry = |
0f71a2f6 JM |
3344 | { |
3345 | 0, NULL, | |
3346 | }; | |
3347 | ||
030f20e1 AC |
3348 | static struct gdbarch_data * |
3349 | gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init, | |
3350 | gdbarch_data_post_init_ftype *post_init) | |
0f71a2f6 JM |
3351 | { |
3352 | struct gdbarch_data_registration **curr; | |
76860b5f | 3353 | /* Append the new registraration. */ |
be5a57e1 | 3354 | for (curr = &gdbarch_data_registry.registrations; |
0f71a2f6 JM |
3355 | (*curr) != NULL; |
3356 | curr = &(*curr)->next); | |
3357 | (*curr) = XMALLOC (struct gdbarch_data_registration); | |
3358 | (*curr)->next = NULL; | |
0f71a2f6 | 3359 | (*curr)->data = XMALLOC (struct gdbarch_data); |
be5a57e1 | 3360 | (*curr)->data->index = gdbarch_data_registry.nr++; |
030f20e1 AC |
3361 | (*curr)->data->pre_init = pre_init; |
3362 | (*curr)->data->post_init = post_init; | |
76860b5f | 3363 | (*curr)->data->init_p = 1; |
0f71a2f6 JM |
3364 | return (*curr)->data; |
3365 | } | |
3366 | ||
030f20e1 AC |
3367 | struct gdbarch_data * |
3368 | gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init) | |
3369 | { | |
3370 | return gdbarch_data_register (pre_init, NULL); | |
3371 | } | |
3372 | ||
3373 | struct gdbarch_data * | |
3374 | gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init) | |
3375 | { | |
3376 | return gdbarch_data_register (NULL, post_init); | |
3377 | } | |
0f71a2f6 | 3378 | |
b3cc3077 | 3379 | /* Create/delete the gdbarch data vector. */ |
95160752 AC |
3380 | |
3381 | static void | |
b3cc3077 | 3382 | alloc_gdbarch_data (struct gdbarch *gdbarch) |
95160752 | 3383 | { |
b3cc3077 JB |
3384 | gdb_assert (gdbarch->data == NULL); |
3385 | gdbarch->nr_data = gdbarch_data_registry.nr; | |
aebd7893 | 3386 | gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *); |
0f71a2f6 JM |
3387 | } |
3388 | ||
76860b5f | 3389 | /* Initialize the current value of the specified per-architecture |
b3cc3077 JB |
3390 | data-pointer. */ |
3391 | ||
95160752 | 3392 | void |
030f20e1 AC |
3393 | deprecated_set_gdbarch_data (struct gdbarch *gdbarch, |
3394 | struct gdbarch_data *data, | |
3395 | void *pointer) | |
95160752 AC |
3396 | { |
3397 | gdb_assert (data->index < gdbarch->nr_data); | |
aebd7893 | 3398 | gdb_assert (gdbarch->data[data->index] == NULL); |
030f20e1 | 3399 | gdb_assert (data->pre_init == NULL); |
95160752 AC |
3400 | gdbarch->data[data->index] = pointer; |
3401 | } | |
3402 | ||
0f71a2f6 JM |
3403 | /* Return the current value of the specified per-architecture |
3404 | data-pointer. */ | |
3405 | ||
3406 | void * | |
451fbdda | 3407 | gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data) |
0f71a2f6 | 3408 | { |
451fbdda | 3409 | gdb_assert (data->index < gdbarch->nr_data); |
030f20e1 | 3410 | if (gdbarch->data[data->index] == NULL) |
76860b5f | 3411 | { |
030f20e1 AC |
3412 | /* The data-pointer isn't initialized, call init() to get a |
3413 | value. */ | |
3414 | if (data->pre_init != NULL) | |
3415 | /* Mid architecture creation: pass just the obstack, and not | |
3416 | the entire architecture, as that way it isn't possible for | |
3417 | pre-init code to refer to undefined architecture | |
3418 | fields. */ | |
3419 | gdbarch->data[data->index] = data->pre_init (gdbarch->obstack); | |
3420 | else if (gdbarch->initialized_p | |
3421 | && data->post_init != NULL) | |
3422 | /* Post architecture creation: pass the entire architecture | |
3423 | (as all fields are valid), but be careful to also detect | |
3424 | recursive references. */ | |
3425 | { | |
3426 | gdb_assert (data->init_p); | |
3427 | data->init_p = 0; | |
3428 | gdbarch->data[data->index] = data->post_init (gdbarch); | |
3429 | data->init_p = 1; | |
3430 | } | |
3431 | else | |
3432 | /* The architecture initialization hasn't completed - punt - | |
3433 | hope that the caller knows what they are doing. Once | |
3434 | deprecated_set_gdbarch_data has been initialized, this can be | |
3435 | changed to an internal error. */ | |
3436 | return NULL; | |
76860b5f AC |
3437 | gdb_assert (gdbarch->data[data->index] != NULL); |
3438 | } | |
451fbdda | 3439 | return gdbarch->data[data->index]; |
0f71a2f6 JM |
3440 | } |
3441 | ||
3442 | ||
be5a57e1 | 3443 | /* Keep a registry of the architectures known by GDB. */ |
0f71a2f6 | 3444 | |
4b9b3959 | 3445 | struct gdbarch_registration |
0f71a2f6 JM |
3446 | { |
3447 | enum bfd_architecture bfd_architecture; | |
3448 | gdbarch_init_ftype *init; | |
4b9b3959 | 3449 | gdbarch_dump_tdep_ftype *dump_tdep; |
0f71a2f6 | 3450 | struct gdbarch_list *arches; |
4b9b3959 | 3451 | struct gdbarch_registration *next; |
0f71a2f6 JM |
3452 | }; |
3453 | ||
be5a57e1 | 3454 | static struct gdbarch_registration *gdbarch_registry = NULL; |
0f71a2f6 | 3455 | |
b4a20239 AC |
3456 | static void |
3457 | append_name (const char ***buf, int *nr, const char *name) | |
3458 | { | |
3459 | *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1)); | |
3460 | (*buf)[*nr] = name; | |
3461 | *nr += 1; | |
3462 | } | |
3463 | ||
3464 | const char ** | |
3465 | gdbarch_printable_names (void) | |
3466 | { | |
7996bcec AC |
3467 | /* Accumulate a list of names based on the registed list of |
3468 | architectures. */ | |
3469 | enum bfd_architecture a; | |
3470 | int nr_arches = 0; | |
3471 | const char **arches = NULL; | |
3472 | struct gdbarch_registration *rego; | |
3473 | for (rego = gdbarch_registry; | |
3474 | rego != NULL; | |
3475 | rego = rego->next) | |
b4a20239 | 3476 | { |
7996bcec AC |
3477 | const struct bfd_arch_info *ap; |
3478 | ap = bfd_lookup_arch (rego->bfd_architecture, 0); | |
3479 | if (ap == NULL) | |
3480 | internal_error (__FILE__, __LINE__, | |
e2e0b3e5 | 3481 | _("gdbarch_architecture_names: multi-arch unknown")); |
7996bcec AC |
3482 | do |
3483 | { | |
3484 | append_name (&arches, &nr_arches, ap->printable_name); | |
3485 | ap = ap->next; | |
3486 | } | |
3487 | while (ap != NULL); | |
b4a20239 | 3488 | } |
7996bcec AC |
3489 | append_name (&arches, &nr_arches, NULL); |
3490 | return arches; | |
b4a20239 AC |
3491 | } |
3492 | ||
3493 | ||
0f71a2f6 | 3494 | void |
4b9b3959 AC |
3495 | gdbarch_register (enum bfd_architecture bfd_architecture, |
3496 | gdbarch_init_ftype *init, | |
3497 | gdbarch_dump_tdep_ftype *dump_tdep) | |
0f71a2f6 | 3498 | { |
4b9b3959 | 3499 | struct gdbarch_registration **curr; |
0f71a2f6 | 3500 | const struct bfd_arch_info *bfd_arch_info; |
ec3d358c | 3501 | /* Check that BFD recognizes this architecture */ |
0f71a2f6 JM |
3502 | bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0); |
3503 | if (bfd_arch_info == NULL) | |
3504 | { | |
8e65ff28 | 3505 | internal_error (__FILE__, __LINE__, |
85c07804 | 3506 | _("gdbarch: Attempt to register unknown architecture (%d)"), |
8e65ff28 | 3507 | bfd_architecture); |
0f71a2f6 JM |
3508 | } |
3509 | /* Check that we haven't seen this architecture before */ | |
be5a57e1 | 3510 | for (curr = &gdbarch_registry; |
0f71a2f6 JM |
3511 | (*curr) != NULL; |
3512 | curr = &(*curr)->next) | |
3513 | { | |
3514 | if (bfd_architecture == (*curr)->bfd_architecture) | |
8e65ff28 | 3515 | internal_error (__FILE__, __LINE__, |
85c07804 | 3516 | _("gdbarch: Duplicate registraration of architecture (%s)"), |
8e65ff28 | 3517 | bfd_arch_info->printable_name); |
0f71a2f6 JM |
3518 | } |
3519 | /* log it */ | |
3520 | if (gdbarch_debug) | |
30737ed9 | 3521 | fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n", |
0f71a2f6 | 3522 | bfd_arch_info->printable_name, |
30737ed9 | 3523 | host_address_to_string (init)); |
0f71a2f6 | 3524 | /* Append it */ |
4b9b3959 | 3525 | (*curr) = XMALLOC (struct gdbarch_registration); |
0f71a2f6 JM |
3526 | (*curr)->bfd_architecture = bfd_architecture; |
3527 | (*curr)->init = init; | |
4b9b3959 | 3528 | (*curr)->dump_tdep = dump_tdep; |
0f71a2f6 JM |
3529 | (*curr)->arches = NULL; |
3530 | (*curr)->next = NULL; | |
4b9b3959 AC |
3531 | } |
3532 | ||
3533 | void | |
3534 | register_gdbarch_init (enum bfd_architecture bfd_architecture, | |
3535 | gdbarch_init_ftype *init) | |
3536 | { | |
3537 | gdbarch_register (bfd_architecture, init, NULL); | |
0f71a2f6 | 3538 | } |
0f71a2f6 JM |
3539 | |
3540 | ||
424163ea | 3541 | /* Look for an architecture using gdbarch_info. */ |
0f71a2f6 JM |
3542 | |
3543 | struct gdbarch_list * | |
104c1213 JM |
3544 | gdbarch_list_lookup_by_info (struct gdbarch_list *arches, |
3545 | const struct gdbarch_info *info) | |
0f71a2f6 JM |
3546 | { |
3547 | for (; arches != NULL; arches = arches->next) | |
3548 | { | |
3549 | if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info) | |
3550 | continue; | |
3551 | if (info->byte_order != arches->gdbarch->byte_order) | |
3552 | continue; | |
4be87837 DJ |
3553 | if (info->osabi != arches->gdbarch->osabi) |
3554 | continue; | |
424163ea DJ |
3555 | if (info->target_desc != arches->gdbarch->target_desc) |
3556 | continue; | |
0f71a2f6 JM |
3557 | return arches; |
3558 | } | |
3559 | return NULL; | |
3560 | } | |
3561 | ||
3562 | ||
ebdba546 AC |
3563 | /* Find an architecture that matches the specified INFO. Create a new |
3564 | architecture if needed. Return that new architecture. Assumes | |
3565 | that there is no current architecture. */ | |
0f71a2f6 | 3566 | |
ebdba546 | 3567 | static struct gdbarch * |
7a107747 | 3568 | find_arch_by_info (struct gdbarch_info info) |
0f71a2f6 JM |
3569 | { |
3570 | struct gdbarch *new_gdbarch; | |
4b9b3959 | 3571 | struct gdbarch_registration *rego; |
0f71a2f6 | 3572 | |
ebdba546 AC |
3573 | /* The existing architecture has been swapped out - all this code |
3574 | works from a clean slate. */ | |
3575 | gdb_assert (current_gdbarch == NULL); | |
3576 | ||
b732d07d | 3577 | /* Fill in missing parts of the INFO struct using a number of |
7a107747 DJ |
3578 | sources: "set ..."; INFOabfd supplied; and the global |
3579 | defaults. */ | |
3580 | gdbarch_info_fill (&info); | |
4be87837 | 3581 | |
b732d07d AC |
3582 | /* Must have found some sort of architecture. */ |
3583 | gdb_assert (info.bfd_arch_info != NULL); | |
0f71a2f6 JM |
3584 | |
3585 | if (gdbarch_debug) | |
3586 | { | |
0f71a2f6 | 3587 | fprintf_unfiltered (gdb_stdlog, |
ebdba546 | 3588 | "find_arch_by_info: info.bfd_arch_info %s\n", |
0f71a2f6 JM |
3589 | (info.bfd_arch_info != NULL |
3590 | ? info.bfd_arch_info->printable_name | |
3591 | : "(null)")); | |
3592 | fprintf_unfiltered (gdb_stdlog, | |
ebdba546 | 3593 | "find_arch_by_info: info.byte_order %d (%s)\n", |
0f71a2f6 | 3594 | info.byte_order, |
d7449b42 | 3595 | (info.byte_order == BFD_ENDIAN_BIG ? "big" |
778eb05e | 3596 | : info.byte_order == BFD_ENDIAN_LITTLE ? "little" |
0f71a2f6 | 3597 | : "default")); |
4be87837 | 3598 | fprintf_unfiltered (gdb_stdlog, |
ebdba546 | 3599 | "find_arch_by_info: info.osabi %d (%s)\n", |
4be87837 | 3600 | info.osabi, gdbarch_osabi_name (info.osabi)); |
0f71a2f6 | 3601 | fprintf_unfiltered (gdb_stdlog, |
30737ed9 JB |
3602 | "find_arch_by_info: info.abfd %s\n", |
3603 | host_address_to_string (info.abfd)); | |
0f71a2f6 | 3604 | fprintf_unfiltered (gdb_stdlog, |
30737ed9 JB |
3605 | "find_arch_by_info: info.tdep_info %s\n", |
3606 | host_address_to_string (info.tdep_info)); | |
0f71a2f6 JM |
3607 | } |
3608 | ||
ebdba546 | 3609 | /* Find the tdep code that knows about this architecture. */ |
b732d07d AC |
3610 | for (rego = gdbarch_registry; |
3611 | rego != NULL; | |
3612 | rego = rego->next) | |
3613 | if (rego->bfd_architecture == info.bfd_arch_info->arch) | |
3614 | break; | |
3615 | if (rego == NULL) | |
3616 | { | |
3617 | if (gdbarch_debug) | |
ebdba546 AC |
3618 | fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " |
3619 | "No matching architecture\n"); | |
b732d07d AC |
3620 | return 0; |
3621 | } | |
3622 | ||
ebdba546 | 3623 | /* Ask the tdep code for an architecture that matches "info". */ |
0f71a2f6 JM |
3624 | new_gdbarch = rego->init (info, rego->arches); |
3625 | ||
ebdba546 AC |
3626 | /* Did the tdep code like it? No. Reject the change and revert to |
3627 | the old architecture. */ | |
0f71a2f6 JM |
3628 | if (new_gdbarch == NULL) |
3629 | { | |
3630 | if (gdbarch_debug) | |
ebdba546 AC |
3631 | fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " |
3632 | "Target rejected architecture\n"); | |
3633 | return NULL; | |
0f71a2f6 JM |
3634 | } |
3635 | ||
ebdba546 AC |
3636 | /* Is this a pre-existing architecture (as determined by already |
3637 | being initialized)? Move it to the front of the architecture | |
3638 | list (keeping the list sorted Most Recently Used). */ | |
3639 | if (new_gdbarch->initialized_p) | |
0f71a2f6 | 3640 | { |
ebdba546 AC |
3641 | struct gdbarch_list **list; |
3642 | struct gdbarch_list *this; | |
0f71a2f6 | 3643 | if (gdbarch_debug) |
ebdba546 | 3644 | fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " |
30737ed9 JB |
3645 | "Previous architecture %s (%s) selected\n", |
3646 | host_address_to_string (new_gdbarch), | |
0f71a2f6 | 3647 | new_gdbarch->bfd_arch_info->printable_name); |
ebdba546 AC |
3648 | /* Find the existing arch in the list. */ |
3649 | for (list = ®o->arches; | |
3650 | (*list) != NULL && (*list)->gdbarch != new_gdbarch; | |
3651 | list = &(*list)->next); | |
3652 | /* It had better be in the list of architectures. */ | |
3653 | gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch); | |
3654 | /* Unlink THIS. */ | |
3655 | this = (*list); | |
3656 | (*list) = this->next; | |
3657 | /* Insert THIS at the front. */ | |
3658 | this->next = rego->arches; | |
3659 | rego->arches = this; | |
3660 | /* Return it. */ | |
3661 | return new_gdbarch; | |
0f71a2f6 JM |
3662 | } |
3663 | ||
ebdba546 AC |
3664 | /* It's a new architecture. */ |
3665 | if (gdbarch_debug) | |
3666 | fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " | |
30737ed9 JB |
3667 | "New architecture %s (%s) selected\n", |
3668 | host_address_to_string (new_gdbarch), | |
ebdba546 AC |
3669 | new_gdbarch->bfd_arch_info->printable_name); |
3670 | ||
3671 | /* Insert the new architecture into the front of the architecture | |
3672 | list (keep the list sorted Most Recently Used). */ | |
0f79675b AC |
3673 | { |
3674 | struct gdbarch_list *this = XMALLOC (struct gdbarch_list); | |
3675 | this->next = rego->arches; | |
3676 | this->gdbarch = new_gdbarch; | |
3677 | rego->arches = this; | |
3678 | } | |
0f71a2f6 | 3679 | |
4b9b3959 AC |
3680 | /* Check that the newly installed architecture is valid. Plug in |
3681 | any post init values. */ | |
3682 | new_gdbarch->dump_tdep = rego->dump_tdep; | |
0f71a2f6 | 3683 | verify_gdbarch (new_gdbarch); |
ebdba546 | 3684 | new_gdbarch->initialized_p = 1; |
0f71a2f6 | 3685 | |
4b9b3959 | 3686 | if (gdbarch_debug) |
ebdba546 | 3687 | gdbarch_dump (new_gdbarch, gdb_stdlog); |
4b9b3959 | 3688 | |
ebdba546 | 3689 | return new_gdbarch; |
0f71a2f6 | 3690 | } |
c906108c | 3691 | |
ebdba546 AC |
3692 | struct gdbarch * |
3693 | gdbarch_find_by_info (struct gdbarch_info info) | |
3694 | { | |
e487cc15 UW |
3695 | struct gdbarch *new_gdbarch; |
3696 | ||
ebdba546 AC |
3697 | /* Save the previously selected architecture, setting the global to |
3698 | NULL. This stops things like gdbarch->init() trying to use the | |
3699 | previous architecture's configuration. The previous architecture | |
3700 | may not even be of the same architecture family. The most recent | |
3701 | architecture of the same family is found at the head of the | |
3702 | rego->arches list. */ | |
e487cc15 UW |
3703 | struct gdbarch *old_gdbarch = current_gdbarch; |
3704 | current_gdbarch = NULL; | |
ebdba546 AC |
3705 | |
3706 | /* Find the specified architecture. */ | |
e487cc15 | 3707 | new_gdbarch = find_arch_by_info (info); |
ebdba546 AC |
3708 | |
3709 | /* Restore the existing architecture. */ | |
3710 | gdb_assert (current_gdbarch == NULL); | |
e487cc15 | 3711 | current_gdbarch = old_gdbarch; |
ebdba546 AC |
3712 | |
3713 | return new_gdbarch; | |
3714 | } | |
3715 | ||
e487cc15 | 3716 | /* Make the specified architecture current. */ |
ebdba546 AC |
3717 | |
3718 | void | |
3719 | deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch) | |
3720 | { | |
3721 | gdb_assert (new_gdbarch != NULL); | |
3722 | gdb_assert (current_gdbarch != NULL); | |
3723 | gdb_assert (new_gdbarch->initialized_p); | |
e487cc15 | 3724 | current_gdbarch = new_gdbarch; |
1cf3db46 | 3725 | target_gdbarch = new_gdbarch; |
383f836e | 3726 | observer_notify_architecture_changed (new_gdbarch); |
a3ecef73 | 3727 | registers_changed (); |
ebdba546 | 3728 | } |
c906108c | 3729 | |
104c1213 | 3730 | extern void _initialize_gdbarch (void); |
b4a20239 | 3731 | |
c906108c | 3732 | void |
7c7651b2 | 3733 | _initialize_gdbarch (void) |
c906108c | 3734 | { |
5d161b24 DB |
3735 | struct cmd_list_element *c; |
3736 | ||
85c07804 AC |
3737 | add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\ |
3738 | Set architecture debugging."), _("\ | |
3739 | Show architecture debugging."), _("\ | |
3740 | When non-zero, architecture debugging is enabled."), | |
3741 | NULL, | |
920d2a44 | 3742 | show_gdbarch_debug, |
85c07804 | 3743 | &setdebuglist, &showdebuglist); |
c906108c | 3744 | } |