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