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