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