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