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