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