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