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