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