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