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