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