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