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