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