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