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