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