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