Commit | Line | Data |
---|---|---|
59233f88 AC |
1 | /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ |
2 | ||
adf40b2e | 3 | /* Dynamic architecture support for GDB, the GNU debugger. |
1e698235 | 4 | Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. |
c906108c | 5 | |
96baa820 JM |
6 | This file is part of GDB. |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 2 of the License, or | |
11 | (at your option) any later version. | |
c906108c | 12 | |
96baa820 JM |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
c906108c | 17 | |
96baa820 JM |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software | |
20 | Foundation, Inc., 59 Temple Place - Suite 330, | |
21 | Boston, MA 02111-1307, USA. */ | |
adf40b2e | 22 | |
104c1213 JM |
23 | /* This file was created with the aid of ``gdbarch.sh''. |
24 | ||
52204a0b | 25 | The Bourne shell script ``gdbarch.sh'' creates the files |
104c1213 JM |
26 | ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them |
27 | against the existing ``gdbarch.[hc]''. Any differences found | |
28 | being reported. | |
29 | ||
30 | If editing this file, please also run gdbarch.sh and merge any | |
52204a0b | 31 | changes into that script. Conversely, when making sweeping changes |
104c1213 JM |
32 | to this file, modifying gdbarch.sh and using its output may prove |
33 | easier. */ | |
c906108c | 34 | |
c906108c SS |
35 | |
36 | #include "defs.h" | |
1ad03bde | 37 | #include "arch-utils.h" |
c906108c | 38 | |
0f71a2f6 JM |
39 | #if GDB_MULTI_ARCH |
40 | #include "gdbcmd.h" | |
adf40b2e | 41 | #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */ |
0f71a2f6 | 42 | #else |
7a292a7a SS |
43 | /* Just include everything in sight so that the every old definition |
44 | of macro is visible. */ | |
45 | #include "gdb_string.h" | |
46 | #include <ctype.h> | |
47 | #include "symtab.h" | |
48 | #include "frame.h" | |
49 | #include "inferior.h" | |
50 | #include "breakpoint.h" | |
03f2053f | 51 | #include "gdb_wait.h" |
7a292a7a SS |
52 | #include "gdbcore.h" |
53 | #include "gdbcmd.h" | |
54 | #include "target.h" | |
55 | #include "gdbthread.h" | |
56 | #include "annotate.h" | |
57 | #include "symfile.h" /* for overlay functions */ | |
fd0407d6 | 58 | #include "value.h" /* For old tm.h/nm.h macros. */ |
0f71a2f6 | 59 | #endif |
7a292a7a | 60 | #include "symcat.h" |
c906108c | 61 | |
f0d4cc9e | 62 | #include "floatformat.h" |
c906108c | 63 | |
95160752 | 64 | #include "gdb_assert.h" |
b66d6d2e | 65 | #include "gdb_string.h" |
67c2c32c | 66 | #include "gdb-events.h" |
b59ff9d5 | 67 | #include "reggroups.h" |
4be87837 | 68 | #include "osabi.h" |
95160752 | 69 | |
104c1213 JM |
70 | /* Static function declarations */ |
71 | ||
72 | static void verify_gdbarch (struct gdbarch *gdbarch); | |
b3cc3077 | 73 | static void alloc_gdbarch_data (struct gdbarch *); |
95160752 | 74 | static void free_gdbarch_data (struct gdbarch *); |
104c1213 | 75 | static void init_gdbarch_swap (struct gdbarch *); |
40af4b0c | 76 | static void clear_gdbarch_swap (struct gdbarch *); |
104c1213 JM |
77 | static void swapout_gdbarch_swap (struct gdbarch *); |
78 | static void swapin_gdbarch_swap (struct gdbarch *); | |
79 | ||
0f71a2f6 JM |
80 | /* Non-zero if we want to trace architecture code. */ |
81 | ||
82 | #ifndef GDBARCH_DEBUG | |
83 | #define GDBARCH_DEBUG 0 | |
84 | #endif | |
85 | int gdbarch_debug = GDBARCH_DEBUG; | |
86 | ||
87 | ||
88 | /* Maintain the struct gdbarch object */ | |
89 | ||
90 | struct gdbarch | |
adf40b2e | 91 | { |
76860b5f AC |
92 | /* Has this architecture been fully initialized? */ |
93 | int initialized_p; | |
adf40b2e JM |
94 | /* basic architectural information */ |
95 | const struct bfd_arch_info * bfd_arch_info; | |
96 | int byte_order; | |
4be87837 | 97 | enum gdb_osabi osabi; |
0f71a2f6 | 98 | |
adf40b2e JM |
99 | /* target specific vector. */ |
100 | struct gdbarch_tdep *tdep; | |
4b9b3959 | 101 | gdbarch_dump_tdep_ftype *dump_tdep; |
0f71a2f6 | 102 | |
adf40b2e | 103 | /* per-architecture data-pointers */ |
95160752 | 104 | unsigned nr_data; |
adf40b2e | 105 | void **data; |
0f71a2f6 | 106 | |
adf40b2e JM |
107 | /* per-architecture swap-regions */ |
108 | struct gdbarch_swap *swap; | |
0f71a2f6 | 109 | |
adf40b2e | 110 | /* Multi-arch values. |
0f71a2f6 | 111 | |
adf40b2e | 112 | When extending this structure you must: |
0f71a2f6 | 113 | |
adf40b2e | 114 | Add the field below. |
0f71a2f6 | 115 | |
adf40b2e JM |
116 | Declare set/get functions and define the corresponding |
117 | macro in gdbarch.h. | |
0f71a2f6 | 118 | |
adf40b2e JM |
119 | gdbarch_alloc(): If zero/NULL is not a suitable default, |
120 | initialize the new field. | |
0f71a2f6 | 121 | |
adf40b2e JM |
122 | verify_gdbarch(): Confirm that the target updated the field |
123 | correctly. | |
0f71a2f6 | 124 | |
7e73cedf | 125 | gdbarch_dump(): Add a fprintf_unfiltered call so that the new |
adf40b2e | 126 | field is dumped out |
0f71a2f6 | 127 | |
c0e8c252 | 128 | ``startup_gdbarch()'': Append an initial value to the static |
adf40b2e | 129 | variable (base values on the host's c-type system). |
0f71a2f6 | 130 | |
adf40b2e JM |
131 | get_gdbarch(): Implement the set/get functions (probably using |
132 | the macro's as shortcuts). | |
0f71a2f6 JM |
133 | |
134 | */ | |
135 | ||
adf40b2e JM |
136 | int short_bit; |
137 | int int_bit; | |
138 | int long_bit; | |
139 | int long_long_bit; | |
140 | int float_bit; | |
141 | int double_bit; | |
142 | int long_double_bit; | |
66b43ecb | 143 | int ptr_bit; |
52204a0b | 144 | int addr_bit; |
66b43ecb | 145 | int bfd_vma_bit; |
4e409299 | 146 | int char_signed; |
adf40b2e JM |
147 | gdbarch_read_pc_ftype *read_pc; |
148 | gdbarch_write_pc_ftype *write_pc; | |
149 | gdbarch_read_fp_ftype *read_fp; | |
adf40b2e JM |
150 | gdbarch_read_sp_ftype *read_sp; |
151 | gdbarch_write_sp_ftype *write_sp; | |
39d4ef09 | 152 | gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer; |
d8124050 AC |
153 | gdbarch_pseudo_register_read_ftype *pseudo_register_read; |
154 | gdbarch_pseudo_register_write_ftype *pseudo_register_write; | |
adf40b2e | 155 | int num_regs; |
0aba1244 | 156 | int num_pseudo_regs; |
adf40b2e JM |
157 | int sp_regnum; |
158 | int fp_regnum; | |
159 | int pc_regnum; | |
c2169756 | 160 | int ps_regnum; |
60054393 | 161 | int fp0_regnum; |
03863182 | 162 | int npc_regnum; |
88c72b7d AC |
163 | gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum; |
164 | gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum; | |
165 | gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum; | |
166 | gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum; | |
167 | gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum; | |
adf40b2e JM |
168 | gdbarch_register_name_ftype *register_name; |
169 | int register_size; | |
170 | int register_bytes; | |
171 | gdbarch_register_byte_ftype *register_byte; | |
172 | gdbarch_register_raw_size_ftype *register_raw_size; | |
173 | int max_register_raw_size; | |
174 | gdbarch_register_virtual_size_ftype *register_virtual_size; | |
175 | int max_register_virtual_size; | |
176 | gdbarch_register_virtual_type_ftype *register_virtual_type; | |
903ad3a6 | 177 | gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info; |
0ab7a791 | 178 | gdbarch_print_registers_info_ftype *print_registers_info; |
5e74b15c | 179 | gdbarch_print_float_info_ftype *print_float_info; |
e76f1f2e | 180 | gdbarch_print_vector_info_ftype *print_vector_info; |
7c7651b2 | 181 | gdbarch_register_sim_regno_ftype *register_sim_regno; |
2649061d | 182 | gdbarch_register_bytes_ok_ftype *register_bytes_ok; |
01fb7433 AC |
183 | gdbarch_cannot_fetch_register_ftype *cannot_fetch_register; |
184 | gdbarch_cannot_store_register_ftype *cannot_store_register; | |
9df628e0 | 185 | gdbarch_get_longjmp_target_ftype *get_longjmp_target; |
07555a72 | 186 | int deprecated_use_generic_dummy_frames; |
adf40b2e JM |
187 | int call_dummy_location; |
188 | gdbarch_call_dummy_address_ftype *call_dummy_address; | |
189 | CORE_ADDR call_dummy_start_offset; | |
190 | CORE_ADDR call_dummy_breakpoint_offset; | |
191 | int call_dummy_breakpoint_offset_p; | |
192 | int call_dummy_length; | |
ae45cd16 | 193 | gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy; |
adf40b2e JM |
194 | int call_dummy_p; |
195 | LONGEST * call_dummy_words; | |
196 | int sizeof_call_dummy_words; | |
197 | int call_dummy_stack_adjust_p; | |
198 | int call_dummy_stack_adjust; | |
199 | gdbarch_fix_call_dummy_ftype *fix_call_dummy; | |
2ca6c561 | 200 | gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first; |
a5afb99f | 201 | gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc; |
adf40b2e JM |
202 | int believe_pcc_promotion; |
203 | int believe_pcc_promotion_type; | |
204 | gdbarch_get_saved_register_ftype *get_saved_register; | |
205 | gdbarch_register_convertible_ftype *register_convertible; | |
206 | gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual; | |
207 | gdbarch_register_convert_to_raw_ftype *register_convert_to_raw; | |
13d01224 AC |
208 | gdbarch_convert_register_p_ftype *convert_register_p; |
209 | gdbarch_register_to_value_ftype *register_to_value; | |
210 | gdbarch_value_to_register_ftype *value_to_register; | |
4478b372 JB |
211 | gdbarch_pointer_to_address_ftype *pointer_to_address; |
212 | gdbarch_address_to_pointer_ftype *address_to_pointer; | |
fc0c74b1 | 213 | gdbarch_integer_to_address_ftype *integer_to_address; |
71a9f22e | 214 | gdbarch_return_value_on_stack_ftype *return_value_on_stack; |
adf40b2e JM |
215 | gdbarch_push_arguments_ftype *push_arguments; |
216 | gdbarch_push_dummy_frame_ftype *push_dummy_frame; | |
217 | gdbarch_push_return_address_ftype *push_return_address; | |
218 | gdbarch_pop_frame_ftype *pop_frame; | |
adf40b2e | 219 | gdbarch_store_struct_return_ftype *store_struct_return; |
ebba8386 | 220 | gdbarch_extract_return_value_ftype *extract_return_value; |
adf40b2e | 221 | gdbarch_store_return_value_ftype *store_return_value; |
ebba8386 AC |
222 | gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value; |
223 | gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value; | |
049ee0e4 | 224 | gdbarch_extract_struct_value_address_ftype *extract_struct_value_address; |
26e9b323 | 225 | gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address; |
adf40b2e JM |
226 | gdbarch_use_struct_convention_ftype *use_struct_convention; |
227 | gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs; | |
228 | gdbarch_init_extra_frame_info_ftype *init_extra_frame_info; | |
229 | gdbarch_skip_prologue_ftype *skip_prologue; | |
dad41f9a | 230 | gdbarch_prologue_frameless_p_ftype *prologue_frameless_p; |
adf40b2e JM |
231 | gdbarch_inner_than_ftype *inner_than; |
232 | gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc; | |
917317f4 JM |
233 | gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint; |
234 | gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint; | |
adf40b2e | 235 | CORE_ADDR decr_pc_after_break; |
e02bc4cc | 236 | gdbarch_prepare_to_proceed_ftype *prepare_to_proceed; |
adf40b2e JM |
237 | CORE_ADDR function_start_offset; |
238 | gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address; | |
239 | CORE_ADDR frame_args_skip; | |
240 | gdbarch_frameless_function_invocation_ftype *frameless_function_invocation; | |
241 | gdbarch_frame_chain_ftype *frame_chain; | |
242 | gdbarch_frame_chain_valid_ftype *frame_chain_valid; | |
243 | gdbarch_frame_saved_pc_ftype *frame_saved_pc; | |
244 | gdbarch_frame_args_address_ftype *frame_args_address; | |
245 | gdbarch_frame_locals_address_ftype *frame_locals_address; | |
246 | gdbarch_saved_pc_after_call_ftype *saved_pc_after_call; | |
247 | gdbarch_frame_num_args_ftype *frame_num_args; | |
2ada493a | 248 | gdbarch_stack_align_ftype *stack_align; |
dc604539 | 249 | gdbarch_frame_align_ftype *frame_align; |
1dd4193b | 250 | int extra_stack_alignment_needed; |
d03e67c9 | 251 | gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr; |
d1e3cf49 | 252 | gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos; |
58d5518e | 253 | int parm_boundary; |
f0d4cc9e AC |
254 | const struct floatformat * float_format; |
255 | const struct floatformat * double_format; | |
256 | const struct floatformat * long_double_format; | |
f517ea4e | 257 | gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr; |
875e1767 | 258 | gdbarch_addr_bits_remove_ftype *addr_bits_remove; |
181c1381 | 259 | gdbarch_smash_text_address_ftype *smash_text_address; |
64c4637f | 260 | gdbarch_software_single_step_ftype *software_single_step; |
2bf0cb65 | 261 | gdbarch_print_insn_ftype *print_insn; |
bdcd319a | 262 | gdbarch_skip_trampoline_code_ftype *skip_trampoline_code; |
68e9cc94 | 263 | gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline; |
d50355b6 | 264 | gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline; |
d7bd68ca | 265 | gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp; |
43156d82 MK |
266 | gdbarch_sigtramp_start_ftype *sigtramp_start; |
267 | gdbarch_sigtramp_end_ftype *sigtramp_end; | |
c12260ac | 268 | gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p; |
552c04a7 | 269 | gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments; |
b6af0555 | 270 | gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info; |
a2cf933a EZ |
271 | gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special; |
272 | gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special; | |
5720643c | 273 | const char * name_of_malloc; |
c4ed33b9 | 274 | int cannot_step_breakpoint; |
f74fa174 | 275 | int have_nonsteppable_watchpoint; |
8b2dbe47 KB |
276 | gdbarch_address_class_type_flags_ftype *address_class_type_flags; |
277 | gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name; | |
278 | gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags; | |
b59ff9d5 | 279 | gdbarch_register_reggroup_p_ftype *register_reggroup_p; |
adf40b2e | 280 | }; |
0f71a2f6 JM |
281 | |
282 | ||
283 | /* The default architecture uses host values (for want of a better | |
284 | choice). */ | |
285 | ||
286 | extern const struct bfd_arch_info bfd_default_arch_struct; | |
287 | ||
4b9b3959 AC |
288 | struct gdbarch startup_gdbarch = |
289 | { | |
76860b5f | 290 | 1, /* Always initialized. */ |
0f71a2f6 JM |
291 | /* basic architecture information */ |
292 | &bfd_default_arch_struct, | |
d7449b42 | 293 | BFD_ENDIAN_BIG, |
4be87837 | 294 | GDB_OSABI_UNKNOWN, |
4b9b3959 AC |
295 | /* target specific vector and its dump routine */ |
296 | NULL, NULL, | |
0f71a2f6 JM |
297 | /*per-architecture data-pointers and swap regions */ |
298 | 0, NULL, NULL, | |
299 | /* Multi-arch values */ | |
0f71a2f6 JM |
300 | 8 * sizeof (short), |
301 | 8 * sizeof (int), | |
302 | 8 * sizeof (long), | |
303 | 8 * sizeof (LONGEST), | |
304 | 8 * sizeof (float), | |
305 | 8 * sizeof (double), | |
306 | 8 * sizeof (long double), | |
66b43ecb AC |
307 | 8 * sizeof (void*), |
308 | 8 * sizeof (void*), | |
52204a0b | 309 | 8 * sizeof (void*), |
4e409299 | 310 | 1, |
0f71a2f6 JM |
311 | 0, |
312 | 0, | |
313 | 0, | |
314 | 0, | |
315 | 0, | |
316 | 0, | |
317 | 0, | |
318 | 0, | |
319 | 0, | |
320 | 0, | |
1200cd6e AC |
321 | -1, |
322 | -1, | |
323 | -1, | |
c2169756 | 324 | -1, |
0f71a2f6 JM |
325 | 0, |
326 | 0, | |
327 | 0, | |
328 | 0, | |
329 | 0, | |
330 | 0, | |
331 | 0, | |
332 | 0, | |
333 | 0, | |
334 | 0, | |
a7e3c2ad | 335 | generic_register_byte, |
b2e75d78 | 336 | generic_register_size, |
0f71a2f6 | 337 | 0, |
b2e75d78 | 338 | generic_register_size, |
0f71a2f6 JM |
339 | 0, |
340 | 0, | |
341 | 0, | |
0ab7a791 | 342 | default_print_registers_info, |
23e3a7ac | 343 | 0, |
0f71a2f6 | 344 | 0, |
b9a8e3bf | 345 | 0, |
7355ddba | 346 | 0, |
03863182 AC |
347 | 0, |
348 | 0, | |
60054393 | 349 | 0, |
0aba1244 | 350 | 0, |
666e11c5 | 351 | 0, |
7c7651b2 | 352 | 0, |
88c72b7d AC |
353 | 0, |
354 | 0, | |
355 | 0, | |
356 | 0, | |
ae45cd16 | 357 | generic_pc_in_call_dummy, |
2649061d | 358 | 0, |
61a0eb5b AC |
359 | 0, |
360 | 0, | |
10312cc4 AC |
361 | 0, |
362 | 0, | |
01fb7433 AC |
363 | 0, |
364 | 0, | |
39d4ef09 | 365 | 0, |
5e74b15c | 366 | 0, |
9df628e0 | 367 | 0, |
e4b415d9 | 368 | 0, |
0f71a2f6 JM |
369 | 0, |
370 | 0, | |
371 | 0, | |
372 | 0, | |
373 | 0, | |
374 | 0, | |
375 | 0, | |
376 | 0, | |
377 | 0, | |
378 | 0, | |
379 | 0, | |
380 | 0, | |
381 | 0, | |
382 | 0, | |
383 | 0, | |
384 | 0, | |
385 | 0, | |
386 | 0, | |
387 | 0, | |
388 | 0, | |
389 | 0, | |
390 | 0, | |
391 | 0, | |
392 | 0, | |
393 | 0, | |
394 | 0, | |
395 | 0, | |
396 | 0, | |
397 | 0, | |
398 | 0, | |
399 | 0, | |
400 | 0, | |
401 | 0, | |
402 | 0, | |
403 | 0, | |
917317f4 JM |
404 | 0, |
405 | 0, | |
4478b372 JB |
406 | 0, |
407 | 0, | |
71a9f22e | 408 | 0, |
2ada493a | 409 | 0, |
d03e67c9 | 410 | 0, |
dad41f9a | 411 | 0, |
d1e3cf49 | 412 | 0, |
f0d4cc9e AC |
413 | 0, |
414 | 0, | |
415 | 0, | |
7f1b2585 EZ |
416 | 0, |
417 | 0, | |
bdcd319a | 418 | 0, |
2bf0cb65 | 419 | 0, |
fc0c74b1 | 420 | 0, |
68e9cc94 | 421 | 0, |
181c1381 | 422 | 0, |
d7bd68ca | 423 | 0, |
13d01224 AC |
424 | 0, |
425 | 0, | |
426 | 0, | |
e76f1f2e | 427 | 0, |
d50355b6 | 428 | 0, |
ebba8386 | 429 | 0, |
43156d82 MK |
430 | 0, |
431 | 0, | |
a72293e2 | 432 | generic_in_function_epilogue_p, |
552c04a7 | 433 | construct_inferior_arguments, |
b6af0555 | 434 | 0, |
a2cf933a EZ |
435 | 0, |
436 | 0, | |
5720643c | 437 | "malloc", |
c4ed33b9 | 438 | 0, |
967c0d83 | 439 | 0, |
8b2dbe47 KB |
440 | 0, |
441 | 0, | |
442 | 0, | |
b59ff9d5 | 443 | default_register_reggroup_p, |
c0e8c252 | 444 | /* startup_gdbarch() */ |
0f71a2f6 | 445 | }; |
4b9b3959 | 446 | |
c0e8c252 | 447 | struct gdbarch *current_gdbarch = &startup_gdbarch; |
0f71a2f6 | 448 | |
ceaa8edf JB |
449 | /* Do any initialization needed for a non-multiarch configuration |
450 | after the _initialize_MODULE functions have been run. */ | |
451 | void | |
5ae5f592 | 452 | initialize_non_multiarch (void) |
ceaa8edf JB |
453 | { |
454 | alloc_gdbarch_data (&startup_gdbarch); | |
40af4b0c AC |
455 | /* Ensure that all swap areas are zeroed so that they again think |
456 | they are starting from scratch. */ | |
457 | clear_gdbarch_swap (&startup_gdbarch); | |
6c1e5d11 | 458 | init_gdbarch_swap (&startup_gdbarch); |
ceaa8edf JB |
459 | } |
460 | ||
0f71a2f6 | 461 | |
66b43ecb | 462 | /* Create a new ``struct gdbarch'' based on information provided by |
0f71a2f6 JM |
463 | ``struct gdbarch_info''. */ |
464 | ||
465 | struct gdbarch * | |
104c1213 JM |
466 | gdbarch_alloc (const struct gdbarch_info *info, |
467 | struct gdbarch_tdep *tdep) | |
0f71a2f6 | 468 | { |
85de9627 AC |
469 | /* NOTE: The new architecture variable is named ``current_gdbarch'' |
470 | so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to | |
471 | the current local architecture and not the previous global | |
472 | architecture. This ensures that the new architectures initial | |
473 | values are not influenced by the previous architecture. Once | |
474 | everything is parameterised with gdbarch, this will go away. */ | |
475 | struct gdbarch *current_gdbarch = XMALLOC (struct gdbarch); | |
476 | memset (current_gdbarch, 0, sizeof (*current_gdbarch)); | |
0f71a2f6 | 477 | |
85de9627 | 478 | alloc_gdbarch_data (current_gdbarch); |
b3cc3077 | 479 | |
85de9627 | 480 | current_gdbarch->tdep = tdep; |
0f71a2f6 | 481 | |
85de9627 AC |
482 | current_gdbarch->bfd_arch_info = info->bfd_arch_info; |
483 | current_gdbarch->byte_order = info->byte_order; | |
4be87837 | 484 | current_gdbarch->osabi = info->osabi; |
0f71a2f6 JM |
485 | |
486 | /* Force the explicit initialization of these. */ | |
85de9627 AC |
487 | current_gdbarch->short_bit = 2*TARGET_CHAR_BIT; |
488 | current_gdbarch->int_bit = 4*TARGET_CHAR_BIT; | |
489 | current_gdbarch->long_bit = 4*TARGET_CHAR_BIT; | |
490 | current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT; | |
491 | current_gdbarch->float_bit = 4*TARGET_CHAR_BIT; | |
492 | current_gdbarch->double_bit = 8*TARGET_CHAR_BIT; | |
17ef5d92 | 493 | current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT; |
85de9627 AC |
494 | current_gdbarch->ptr_bit = TARGET_INT_BIT; |
495 | current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address; | |
4e409299 | 496 | current_gdbarch->char_signed = -1; |
85de9627 AC |
497 | current_gdbarch->read_pc = generic_target_read_pc; |
498 | current_gdbarch->write_pc = generic_target_write_pc; | |
499 | current_gdbarch->read_fp = generic_target_read_fp; | |
85de9627 AC |
500 | current_gdbarch->read_sp = generic_target_read_sp; |
501 | current_gdbarch->write_sp = generic_target_write_sp; | |
502 | current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer; | |
503 | current_gdbarch->num_regs = -1; | |
504 | current_gdbarch->sp_regnum = -1; | |
505 | current_gdbarch->fp_regnum = -1; | |
506 | current_gdbarch->pc_regnum = -1; | |
c2169756 | 507 | current_gdbarch->ps_regnum = -1; |
85de9627 AC |
508 | current_gdbarch->fp0_regnum = -1; |
509 | current_gdbarch->npc_regnum = -1; | |
85de9627 AC |
510 | current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum; |
511 | current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum; | |
512 | current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum; | |
513 | current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum; | |
514 | current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum; | |
515 | current_gdbarch->register_name = legacy_register_name; | |
516 | current_gdbarch->register_size = -1; | |
517 | current_gdbarch->register_bytes = -1; | |
a7e3c2ad | 518 | current_gdbarch->register_byte = generic_register_byte; |
b2e75d78 | 519 | current_gdbarch->register_raw_size = generic_register_size; |
85de9627 | 520 | current_gdbarch->max_register_raw_size = -1; |
b2e75d78 | 521 | current_gdbarch->register_virtual_size = generic_register_size; |
85de9627 | 522 | current_gdbarch->max_register_virtual_size = -1; |
0ab7a791 | 523 | current_gdbarch->print_registers_info = default_print_registers_info; |
8238d0bf | 524 | current_gdbarch->register_sim_regno = legacy_register_sim_regno; |
85de9627 AC |
525 | current_gdbarch->cannot_fetch_register = cannot_register_not; |
526 | current_gdbarch->cannot_store_register = cannot_register_not; | |
07555a72 | 527 | current_gdbarch->deprecated_use_generic_dummy_frames = 1; |
b99fa2d2 | 528 | current_gdbarch->call_dummy_location = AT_ENTRY_POINT; |
85de9627 AC |
529 | current_gdbarch->call_dummy_start_offset = -1; |
530 | current_gdbarch->call_dummy_breakpoint_offset = -1; | |
531 | current_gdbarch->call_dummy_breakpoint_offset_p = -1; | |
532 | current_gdbarch->call_dummy_length = -1; | |
ae45cd16 | 533 | current_gdbarch->deprecated_pc_in_call_dummy = generic_pc_in_call_dummy; |
85de9627 AC |
534 | current_gdbarch->call_dummy_p = -1; |
535 | current_gdbarch->call_dummy_words = legacy_call_dummy_words; | |
536 | current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words; | |
537 | current_gdbarch->call_dummy_stack_adjust_p = -1; | |
85de9627 | 538 | current_gdbarch->register_convertible = generic_register_convertible_not; |
13d01224 AC |
539 | current_gdbarch->convert_register_p = legacy_convert_register_p; |
540 | current_gdbarch->register_to_value = legacy_register_to_value; | |
541 | current_gdbarch->value_to_register = legacy_value_to_register; | |
85de9627 AC |
542 | current_gdbarch->pointer_to_address = unsigned_pointer_to_address; |
543 | current_gdbarch->address_to_pointer = unsigned_address_to_pointer; | |
544 | current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not; | |
6e6d6484 | 545 | current_gdbarch->push_arguments = default_push_arguments; |
ebba8386 AC |
546 | current_gdbarch->extract_return_value = legacy_extract_return_value; |
547 | current_gdbarch->store_return_value = legacy_store_return_value; | |
56f12751 | 548 | current_gdbarch->use_struct_convention = generic_use_struct_convention; |
85de9627 AC |
549 | current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p; |
550 | current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc; | |
551 | current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint; | |
552 | current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint; | |
553 | current_gdbarch->decr_pc_after_break = -1; | |
554 | current_gdbarch->prepare_to_proceed = default_prepare_to_proceed; | |
555 | current_gdbarch->function_start_offset = -1; | |
556 | current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address; | |
557 | current_gdbarch->frame_args_skip = -1; | |
558 | current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not; | |
7d6a26a7 AC |
559 | current_gdbarch->frame_args_address = get_frame_base; |
560 | current_gdbarch->frame_locals_address = get_frame_base; | |
85de9627 AC |
561 | current_gdbarch->extra_stack_alignment_needed = 1; |
562 | current_gdbarch->convert_from_func_ptr_addr = core_addr_identity; | |
563 | current_gdbarch->addr_bits_remove = core_addr_identity; | |
181c1381 | 564 | current_gdbarch->smash_text_address = core_addr_identity; |
85de9627 AC |
565 | current_gdbarch->print_insn = legacy_print_insn; |
566 | current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code; | |
68e9cc94 | 567 | current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline; |
d50355b6 | 568 | current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline; |
d7bd68ca | 569 | current_gdbarch->pc_in_sigtramp = legacy_pc_in_sigtramp; |
c12260ac | 570 | current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p; |
552c04a7 | 571 | current_gdbarch->construct_inferior_arguments = construct_inferior_arguments; |
a2cf933a EZ |
572 | current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special; |
573 | current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special; | |
5720643c | 574 | current_gdbarch->name_of_malloc = "malloc"; |
b59ff9d5 | 575 | current_gdbarch->register_reggroup_p = default_register_reggroup_p; |
0f71a2f6 JM |
576 | /* gdbarch_alloc() */ |
577 | ||
85de9627 | 578 | return current_gdbarch; |
0f71a2f6 JM |
579 | } |
580 | ||
581 | ||
058f20d5 JB |
582 | /* Free a gdbarch struct. This should never happen in normal |
583 | operation --- once you've created a gdbarch, you keep it around. | |
584 | However, if an architecture's init function encounters an error | |
585 | building the structure, it may need to clean up a partially | |
586 | constructed gdbarch. */ | |
4b9b3959 | 587 | |
058f20d5 JB |
588 | void |
589 | gdbarch_free (struct gdbarch *arch) | |
590 | { | |
95160752 AC |
591 | gdb_assert (arch != NULL); |
592 | free_gdbarch_data (arch); | |
338d7c5c | 593 | xfree (arch); |
058f20d5 JB |
594 | } |
595 | ||
596 | ||
0f71a2f6 JM |
597 | /* Ensure that all values in a GDBARCH are reasonable. */ |
598 | ||
0f71a2f6 | 599 | static void |
104c1213 | 600 | verify_gdbarch (struct gdbarch *gdbarch) |
0f71a2f6 | 601 | { |
f16a1923 AC |
602 | struct ui_file *log; |
603 | struct cleanup *cleanups; | |
604 | long dummy; | |
605 | char *buf; | |
0f71a2f6 | 606 | /* Only perform sanity checks on a multi-arch target. */ |
6166d547 | 607 | if (!GDB_MULTI_ARCH) |
0f71a2f6 | 608 | return; |
f16a1923 AC |
609 | log = mem_fileopen (); |
610 | cleanups = make_cleanup_ui_file_delete (log); | |
0f71a2f6 | 611 | /* fundamental */ |
428721aa | 612 | if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN) |
f16a1923 | 613 | fprintf_unfiltered (log, "\n\tbyte-order"); |
0f71a2f6 | 614 | if (gdbarch->bfd_arch_info == NULL) |
f16a1923 | 615 | fprintf_unfiltered (log, "\n\tbfd_arch_info"); |
0f71a2f6 | 616 | /* Check those that need to be defined for the given multi-arch level. */ |
66b43ecb AC |
617 | /* Skip verify of short_bit, invalid_p == 0 */ |
618 | /* Skip verify of int_bit, invalid_p == 0 */ | |
619 | /* Skip verify of long_bit, invalid_p == 0 */ | |
620 | /* Skip verify of long_long_bit, invalid_p == 0 */ | |
621 | /* Skip verify of float_bit, invalid_p == 0 */ | |
622 | /* Skip verify of double_bit, invalid_p == 0 */ | |
623 | /* Skip verify of long_double_bit, invalid_p == 0 */ | |
624 | /* Skip verify of ptr_bit, invalid_p == 0 */ | |
52204a0b DT |
625 | if (gdbarch->addr_bit == 0) |
626 | gdbarch->addr_bit = TARGET_PTR_BIT; | |
c0e8c252 | 627 | /* Skip verify of bfd_vma_bit, invalid_p == 0 */ |
4e409299 JB |
628 | if (gdbarch->char_signed == -1) |
629 | gdbarch->char_signed = 1; | |
be8dfb87 AC |
630 | /* Skip verify of read_pc, invalid_p == 0 */ |
631 | /* Skip verify of write_pc, invalid_p == 0 */ | |
632 | /* Skip verify of read_fp, invalid_p == 0 */ | |
be8dfb87 AC |
633 | /* Skip verify of read_sp, invalid_p == 0 */ |
634 | /* Skip verify of write_sp, invalid_p == 0 */ | |
39d4ef09 | 635 | /* Skip verify of virtual_frame_pointer, invalid_p == 0 */ |
d8124050 AC |
636 | /* Skip verify of pseudo_register_read, has predicate */ |
637 | /* Skip verify of pseudo_register_write, has predicate */ | |
50248794 | 638 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 639 | && (gdbarch->num_regs == -1)) |
f16a1923 | 640 | fprintf_unfiltered (log, "\n\tnum_regs"); |
0aba1244 | 641 | /* Skip verify of num_pseudo_regs, invalid_p == 0 */ |
1200cd6e AC |
642 | /* Skip verify of sp_regnum, invalid_p == 0 */ |
643 | /* Skip verify of fp_regnum, invalid_p == 0 */ | |
644 | /* Skip verify of pc_regnum, invalid_p == 0 */ | |
c2169756 | 645 | /* Skip verify of ps_regnum, invalid_p == 0 */ |
60054393 | 646 | /* Skip verify of fp0_regnum, invalid_p == 0 */ |
03863182 | 647 | /* Skip verify of npc_regnum, invalid_p == 0 */ |
88c72b7d AC |
648 | /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */ |
649 | /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */ | |
650 | /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */ | |
651 | /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */ | |
652 | /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */ | |
c0e8c252 | 653 | /* Skip verify of register_name, invalid_p == 0 */ |
50248794 | 654 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 655 | && (gdbarch->register_size == -1)) |
f16a1923 | 656 | fprintf_unfiltered (log, "\n\tregister_size"); |
50248794 | 657 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 658 | && (gdbarch->register_bytes == -1)) |
f16a1923 | 659 | fprintf_unfiltered (log, "\n\tregister_bytes"); |
a7e3c2ad | 660 | /* Skip verify of register_byte, invalid_p == 0 */ |
b2e75d78 | 661 | /* Skip verify of register_raw_size, invalid_p == 0 */ |
50248794 | 662 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 663 | && (gdbarch->max_register_raw_size == -1)) |
f16a1923 | 664 | fprintf_unfiltered (log, "\n\tmax_register_raw_size"); |
b2e75d78 | 665 | /* Skip verify of register_virtual_size, invalid_p == 0 */ |
50248794 | 666 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 667 | && (gdbarch->max_register_virtual_size == -1)) |
f16a1923 | 668 | fprintf_unfiltered (log, "\n\tmax_register_virtual_size"); |
50248794 | 669 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 670 | && (gdbarch->register_virtual_type == 0)) |
f16a1923 | 671 | fprintf_unfiltered (log, "\n\tregister_virtual_type"); |
903ad3a6 | 672 | /* Skip verify of deprecated_do_registers_info, has predicate */ |
0ab7a791 | 673 | /* Skip verify of print_registers_info, invalid_p == 0 */ |
23e3a7ac | 674 | /* Skip verify of print_float_info, has predicate */ |
e76f1f2e | 675 | /* Skip verify of print_vector_info, has predicate */ |
7c7651b2 | 676 | /* Skip verify of register_sim_regno, invalid_p == 0 */ |
2649061d | 677 | /* Skip verify of register_bytes_ok, has predicate */ |
01fb7433 AC |
678 | /* Skip verify of cannot_fetch_register, invalid_p == 0 */ |
679 | /* Skip verify of cannot_store_register, invalid_p == 0 */ | |
9df628e0 | 680 | /* Skip verify of get_longjmp_target, has predicate */ |
07555a72 | 681 | /* Skip verify of deprecated_use_generic_dummy_frames, invalid_p == 0 */ |
b99fa2d2 | 682 | /* Skip verify of call_dummy_location, invalid_p == 0 */ |
50248794 | 683 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 684 | && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0)) |
f16a1923 | 685 | fprintf_unfiltered (log, "\n\tcall_dummy_address"); |
50248794 | 686 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 687 | && (gdbarch->call_dummy_start_offset == -1)) |
f16a1923 | 688 | fprintf_unfiltered (log, "\n\tcall_dummy_start_offset"); |
50248794 | 689 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
83e6b173 | 690 | && (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1)) |
f16a1923 | 691 | fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset"); |
50248794 | 692 | if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 693 | && (gdbarch->call_dummy_breakpoint_offset_p == -1)) |
f16a1923 | 694 | fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset_p"); |
50248794 | 695 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 696 | && (gdbarch->call_dummy_length == -1)) |
f16a1923 | 697 | fprintf_unfiltered (log, "\n\tcall_dummy_length"); |
ae45cd16 | 698 | /* Skip verify of deprecated_pc_in_call_dummy, has predicate */ |
50248794 | 699 | if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 700 | && (gdbarch->call_dummy_p == -1)) |
f16a1923 | 701 | fprintf_unfiltered (log, "\n\tcall_dummy_p"); |
c0e8c252 AC |
702 | /* Skip verify of call_dummy_words, invalid_p == 0 */ |
703 | /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */ | |
50248794 | 704 | if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 705 | && (gdbarch->call_dummy_stack_adjust_p == -1)) |
f16a1923 | 706 | fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust_p"); |
50248794 | 707 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 708 | && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)) |
f16a1923 | 709 | fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust"); |
50248794 | 710 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 711 | && (gdbarch->fix_call_dummy == 0)) |
f16a1923 | 712 | fprintf_unfiltered (log, "\n\tfix_call_dummy"); |
2ca6c561 | 713 | /* Skip verify of deprecated_init_frame_pc_first, has predicate */ |
a5afb99f | 714 | /* Skip verify of deprecated_init_frame_pc, has predicate */ |
a216a322 | 715 | /* Skip verify of get_saved_register, has predicate */ |
c0e8c252 AC |
716 | /* Skip verify of register_convertible, invalid_p == 0 */ |
717 | /* Skip verify of register_convert_to_virtual, invalid_p == 0 */ | |
718 | /* Skip verify of register_convert_to_raw, invalid_p == 0 */ | |
13d01224 AC |
719 | /* Skip verify of convert_register_p, invalid_p == 0 */ |
720 | /* Skip verify of register_to_value, invalid_p == 0 */ | |
721 | /* Skip verify of value_to_register, invalid_p == 0 */ | |
4478b372 JB |
722 | /* Skip verify of pointer_to_address, invalid_p == 0 */ |
723 | /* Skip verify of address_to_pointer, invalid_p == 0 */ | |
fc0c74b1 | 724 | /* Skip verify of integer_to_address, has predicate */ |
71a9f22e | 725 | /* Skip verify of return_value_on_stack, invalid_p == 0 */ |
6e6d6484 | 726 | /* Skip verify of push_arguments, invalid_p == 0 */ |
50248794 | 727 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 728 | && (gdbarch->push_dummy_frame == 0)) |
f16a1923 | 729 | fprintf_unfiltered (log, "\n\tpush_dummy_frame"); |
69a0d5f4 | 730 | /* Skip verify of push_return_address, has predicate */ |
dedc2a2b | 731 | /* Skip verify of pop_frame, has predicate */ |
50248794 | 732 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 733 | && (gdbarch->store_struct_return == 0)) |
f16a1923 | 734 | fprintf_unfiltered (log, "\n\tstore_struct_return"); |
ebba8386 AC |
735 | /* Skip verify of extract_return_value, invalid_p == 0 */ |
736 | /* Skip verify of store_return_value, invalid_p == 0 */ | |
049ee0e4 | 737 | /* Skip verify of extract_struct_value_address, has predicate */ |
26e9b323 | 738 | /* Skip verify of deprecated_extract_struct_value_address, has predicate */ |
56f12751 | 739 | /* Skip verify of use_struct_convention, invalid_p == 0 */ |
8f871025 | 740 | /* Skip verify of frame_init_saved_regs, has predicate */ |
5fdff426 | 741 | /* Skip verify of init_extra_frame_info, has predicate */ |
50248794 | 742 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 743 | && (gdbarch->skip_prologue == 0)) |
f16a1923 | 744 | fprintf_unfiltered (log, "\n\tskip_prologue"); |
dad41f9a | 745 | /* Skip verify of prologue_frameless_p, invalid_p == 0 */ |
50248794 | 746 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 747 | && (gdbarch->inner_than == 0)) |
f16a1923 | 748 | fprintf_unfiltered (log, "\n\tinner_than"); |
c0e8c252 AC |
749 | /* Skip verify of breakpoint_from_pc, invalid_p == 0 */ |
750 | /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */ | |
751 | /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */ | |
50248794 | 752 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 753 | && (gdbarch->decr_pc_after_break == -1)) |
f16a1923 | 754 | fprintf_unfiltered (log, "\n\tdecr_pc_after_break"); |
e02bc4cc | 755 | /* Skip verify of prepare_to_proceed, invalid_p == 0 */ |
50248794 | 756 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 757 | && (gdbarch->function_start_offset == -1)) |
f16a1923 | 758 | fprintf_unfiltered (log, "\n\tfunction_start_offset"); |
c0e8c252 | 759 | /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */ |
50248794 | 760 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 761 | && (gdbarch->frame_args_skip == -1)) |
f16a1923 | 762 | fprintf_unfiltered (log, "\n\tframe_args_skip"); |
c0e8c252 | 763 | /* Skip verify of frameless_function_invocation, invalid_p == 0 */ |
d62d1979 | 764 | /* Skip verify of frame_chain, has predicate */ |
51603483 | 765 | /* Skip verify of frame_chain_valid, has predicate */ |
d62d1979 | 766 | /* Skip verify of frame_saved_pc, has predicate */ |
f4ded5b1 AC |
767 | /* Skip verify of frame_args_address, invalid_p == 0 */ |
768 | /* Skip verify of frame_locals_address, invalid_p == 0 */ | |
50248794 | 769 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 770 | && (gdbarch->saved_pc_after_call == 0)) |
f16a1923 | 771 | fprintf_unfiltered (log, "\n\tsaved_pc_after_call"); |
50248794 | 772 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
0f71a2f6 | 773 | && (gdbarch->frame_num_args == 0)) |
f16a1923 | 774 | fprintf_unfiltered (log, "\n\tframe_num_args"); |
2ada493a | 775 | /* Skip verify of stack_align, has predicate */ |
dc604539 | 776 | /* Skip verify of frame_align, has predicate */ |
1dd4193b | 777 | /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */ |
d03e67c9 | 778 | /* Skip verify of reg_struct_has_addr, has predicate */ |
d1e3cf49 | 779 | /* Skip verify of save_dummy_frame_tos, has predicate */ |
f0d4cc9e AC |
780 | if (gdbarch->float_format == 0) |
781 | gdbarch->float_format = default_float_format (gdbarch); | |
782 | if (gdbarch->double_format == 0) | |
783 | gdbarch->double_format = default_double_format (gdbarch); | |
784 | if (gdbarch->long_double_format == 0) | |
2fa5c1e0 | 785 | gdbarch->long_double_format = default_double_format (gdbarch); |
f517ea4e | 786 | /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */ |
875e1767 | 787 | /* Skip verify of addr_bits_remove, invalid_p == 0 */ |
181c1381 | 788 | /* Skip verify of smash_text_address, invalid_p == 0 */ |
64c4637f | 789 | /* Skip verify of software_single_step, has predicate */ |
2bf0cb65 | 790 | /* Skip verify of print_insn, invalid_p == 0 */ |
bdcd319a | 791 | /* Skip verify of skip_trampoline_code, invalid_p == 0 */ |
68e9cc94 | 792 | /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */ |
d50355b6 | 793 | /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */ |
d7bd68ca | 794 | /* Skip verify of pc_in_sigtramp, invalid_p == 0 */ |
43156d82 | 795 | /* Skip verify of sigtramp_start, has predicate */ |
e76cff22 | 796 | /* Skip verify of sigtramp_end, has predicate */ |
c12260ac | 797 | /* Skip verify of in_function_epilogue_p, invalid_p == 0 */ |
552c04a7 | 798 | /* Skip verify of construct_inferior_arguments, invalid_p == 0 */ |
b6af0555 | 799 | /* Skip verify of dwarf2_build_frame_info, has predicate */ |
a2cf933a EZ |
800 | /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */ |
801 | /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */ | |
5720643c | 802 | /* Skip verify of name_of_malloc, invalid_p == 0 */ |
c4ed33b9 | 803 | /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */ |
f74fa174 | 804 | /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */ |
8b2dbe47 KB |
805 | /* Skip verify of address_class_type_flags, has predicate */ |
806 | /* Skip verify of address_class_type_flags_to_name, has predicate */ | |
807 | /* Skip verify of address_class_name_to_type_flags, has predicate */ | |
7e20f3fb | 808 | /* Skip verify of register_reggroup_p, invalid_p == 0 */ |
f16a1923 AC |
809 | buf = ui_file_xstrdup (log, &dummy); |
810 | make_cleanup (xfree, buf); | |
811 | if (strlen (buf) > 0) | |
812 | internal_error (__FILE__, __LINE__, | |
813 | "verify_gdbarch: the following are invalid ...%s", | |
814 | buf); | |
815 | do_cleanups (cleanups); | |
0f71a2f6 JM |
816 | } |
817 | ||
818 | ||
819 | /* Print out the details of the current architecture. */ | |
820 | ||
4b9b3959 AC |
821 | /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it |
822 | just happens to match the global variable ``current_gdbarch''. That | |
823 | way macros refering to that variable get the local and not the global | |
824 | version - ulgh. Once everything is parameterised with gdbarch, this | |
825 | will go away. */ | |
826 | ||
0f71a2f6 | 827 | void |
4b9b3959 | 828 | gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) |
0f71a2f6 | 829 | { |
4b9b3959 AC |
830 | fprintf_unfiltered (file, |
831 | "gdbarch_dump: GDB_MULTI_ARCH = %d\n", | |
832 | GDB_MULTI_ARCH); | |
1e9f55d0 AC |
833 | if (GDB_MULTI_ARCH) |
834 | fprintf_unfiltered (file, | |
835 | "gdbarch_dump: gdbarch_frame_align_p() = %d\n", | |
836 | gdbarch_frame_align_p (current_gdbarch)); | |
dc604539 AC |
837 | if (GDB_MULTI_ARCH) |
838 | fprintf_unfiltered (file, | |
839 | "gdbarch_dump: frame_align = 0x%08lx\n", | |
840 | (long) current_gdbarch->frame_align); | |
c12260ac CV |
841 | if (GDB_MULTI_ARCH) |
842 | fprintf_unfiltered (file, | |
5e74b15c RE |
843 | "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n", |
844 | (long) current_gdbarch->in_function_epilogue_p); | |
b59ff9d5 AC |
845 | if (GDB_MULTI_ARCH) |
846 | fprintf_unfiltered (file, | |
847 | "gdbarch_dump: register_reggroup_p = 0x%08lx\n", | |
848 | (long) current_gdbarch->register_reggroup_p); | |
1e9f55d0 AC |
849 | if (GDB_MULTI_ARCH) |
850 | fprintf_unfiltered (file, | |
851 | "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n", | |
852 | gdbarch_pseudo_register_read_p (current_gdbarch)); | |
5e74b15c RE |
853 | if (GDB_MULTI_ARCH) |
854 | fprintf_unfiltered (file, | |
d8124050 AC |
855 | "gdbarch_dump: pseudo_register_read = 0x%08lx\n", |
856 | (long) current_gdbarch->pseudo_register_read); | |
1e9f55d0 AC |
857 | if (GDB_MULTI_ARCH) |
858 | fprintf_unfiltered (file, | |
859 | "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n", | |
860 | gdbarch_pseudo_register_write_p (current_gdbarch)); | |
5e74b15c RE |
861 | if (GDB_MULTI_ARCH) |
862 | fprintf_unfiltered (file, | |
d8124050 AC |
863 | "gdbarch_dump: pseudo_register_write = 0x%08lx\n", |
864 | (long) current_gdbarch->pseudo_register_write); | |
1e9f55d0 AC |
865 | if (GDB_MULTI_ARCH) |
866 | fprintf_unfiltered (file, | |
867 | "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n", | |
868 | gdbarch_address_class_name_to_type_flags_p (current_gdbarch)); | |
8b2dbe47 KB |
869 | if (GDB_MULTI_ARCH) |
870 | fprintf_unfiltered (file, | |
5f11f355 AC |
871 | "gdbarch_dump: address_class_name_to_type_flags = 0x%08lx\n", |
872 | (long) current_gdbarch->address_class_name_to_type_flags); | |
1e9f55d0 AC |
873 | #ifdef ADDRESS_CLASS_TYPE_FLAGS_P |
874 | fprintf_unfiltered (file, | |
875 | "gdbarch_dump: %s # %s\n", | |
876 | "ADDRESS_CLASS_TYPE_FLAGS_P()", | |
877 | XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ())); | |
878 | fprintf_unfiltered (file, | |
879 | "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS_P() = %d\n", | |
880 | ADDRESS_CLASS_TYPE_FLAGS_P ()); | |
881 | #endif | |
8b2dbe47 KB |
882 | #ifdef ADDRESS_CLASS_TYPE_FLAGS |
883 | fprintf_unfiltered (file, | |
884 | "gdbarch_dump: %s # %s\n", | |
885 | "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)", | |
886 | XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class))); | |
887 | if (GDB_MULTI_ARCH) | |
888 | fprintf_unfiltered (file, | |
6cbda714 | 889 | "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS = <0x%08lx>\n", |
8b2dbe47 KB |
890 | (long) current_gdbarch->address_class_type_flags |
891 | /*ADDRESS_CLASS_TYPE_FLAGS ()*/); | |
892 | #endif | |
1e9f55d0 AC |
893 | if (GDB_MULTI_ARCH) |
894 | fprintf_unfiltered (file, | |
895 | "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n", | |
896 | gdbarch_address_class_type_flags_to_name_p (current_gdbarch)); | |
8b2dbe47 KB |
897 | if (GDB_MULTI_ARCH) |
898 | fprintf_unfiltered (file, | |
5f11f355 AC |
899 | "gdbarch_dump: address_class_type_flags_to_name = 0x%08lx\n", |
900 | (long) current_gdbarch->address_class_type_flags_to_name); | |
08e45a40 AC |
901 | #ifdef ADDRESS_TO_POINTER |
902 | #if GDB_MULTI_ARCH | |
903 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 | 904 | fprintf_unfiltered (file, |
08e45a40 AC |
905 | "gdbarch_dump: %s # %s\n", |
906 | "ADDRESS_TO_POINTER(type, buf, addr)", | |
907 | XSTRING (ADDRESS_TO_POINTER (type, buf, addr))); | |
4b9b3959 | 908 | #endif |
08e45a40 AC |
909 | if (GDB_MULTI_ARCH) |
910 | fprintf_unfiltered (file, | |
6cbda714 | 911 | "gdbarch_dump: ADDRESS_TO_POINTER = <0x%08lx>\n", |
08e45a40 AC |
912 | (long) current_gdbarch->address_to_pointer |
913 | /*ADDRESS_TO_POINTER ()*/); | |
4b9b3959 | 914 | #endif |
5e74b15c RE |
915 | #ifdef ADDR_BITS_REMOVE |
916 | fprintf_unfiltered (file, | |
917 | "gdbarch_dump: %s # %s\n", | |
918 | "ADDR_BITS_REMOVE(addr)", | |
919 | XSTRING (ADDR_BITS_REMOVE (addr))); | |
920 | if (GDB_MULTI_ARCH) | |
921 | fprintf_unfiltered (file, | |
6cbda714 | 922 | "gdbarch_dump: ADDR_BITS_REMOVE = <0x%08lx>\n", |
5e74b15c RE |
923 | (long) current_gdbarch->addr_bits_remove |
924 | /*ADDR_BITS_REMOVE ()*/); | |
925 | #endif | |
08e45a40 | 926 | #ifdef BELIEVE_PCC_PROMOTION |
4b9b3959 | 927 | fprintf_unfiltered (file, |
08e45a40 AC |
928 | "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n", |
929 | XSTRING (BELIEVE_PCC_PROMOTION)); | |
930 | fprintf_unfiltered (file, | |
06b25f14 AC |
931 | "gdbarch_dump: BELIEVE_PCC_PROMOTION = %d\n", |
932 | BELIEVE_PCC_PROMOTION); | |
4b9b3959 | 933 | #endif |
08e45a40 | 934 | #ifdef BELIEVE_PCC_PROMOTION_TYPE |
4b9b3959 | 935 | fprintf_unfiltered (file, |
08e45a40 AC |
936 | "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n", |
937 | XSTRING (BELIEVE_PCC_PROMOTION_TYPE)); | |
938 | fprintf_unfiltered (file, | |
06b25f14 AC |
939 | "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %d\n", |
940 | BELIEVE_PCC_PROMOTION_TYPE); | |
4b9b3959 | 941 | #endif |
08e45a40 | 942 | #ifdef BREAKPOINT_FROM_PC |
4b9b3959 | 943 | fprintf_unfiltered (file, |
08e45a40 AC |
944 | "gdbarch_dump: %s # %s\n", |
945 | "BREAKPOINT_FROM_PC(pcptr, lenptr)", | |
946 | XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr))); | |
947 | if (GDB_MULTI_ARCH) | |
948 | fprintf_unfiltered (file, | |
6cbda714 | 949 | "gdbarch_dump: BREAKPOINT_FROM_PC = <0x%08lx>\n", |
08e45a40 AC |
950 | (long) current_gdbarch->breakpoint_from_pc |
951 | /*BREAKPOINT_FROM_PC ()*/); | |
4b9b3959 | 952 | #endif |
08e45a40 | 953 | #ifdef CALL_DUMMY_ADDRESS |
4b9b3959 | 954 | fprintf_unfiltered (file, |
08e45a40 AC |
955 | "gdbarch_dump: %s # %s\n", |
956 | "CALL_DUMMY_ADDRESS()", | |
957 | XSTRING (CALL_DUMMY_ADDRESS ())); | |
958 | if (GDB_MULTI_ARCH) | |
959 | fprintf_unfiltered (file, | |
6cbda714 | 960 | "gdbarch_dump: CALL_DUMMY_ADDRESS = <0x%08lx>\n", |
08e45a40 AC |
961 | (long) current_gdbarch->call_dummy_address |
962 | /*CALL_DUMMY_ADDRESS ()*/); | |
4b9b3959 | 963 | #endif |
08e45a40 | 964 | #ifdef CALL_DUMMY_BREAKPOINT_OFFSET |
4b9b3959 | 965 | fprintf_unfiltered (file, |
08e45a40 AC |
966 | "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n", |
967 | XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET)); | |
968 | if (CALL_DUMMY_BREAKPOINT_OFFSET_P) | |
969 | fprintf_unfiltered (file, | |
970 | "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n", | |
971 | (long) CALL_DUMMY_BREAKPOINT_OFFSET); | |
4b9b3959 | 972 | #endif |
08e45a40 | 973 | #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P |
4b9b3959 | 974 | fprintf_unfiltered (file, |
08e45a40 AC |
975 | "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P # %s\n", |
976 | XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET_P)); | |
977 | fprintf_unfiltered (file, | |
06b25f14 AC |
978 | "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P = %d\n", |
979 | CALL_DUMMY_BREAKPOINT_OFFSET_P); | |
4b9b3959 | 980 | #endif |
08e45a40 | 981 | #ifdef CALL_DUMMY_LENGTH |
66b43ecb | 982 | fprintf_unfiltered (file, |
08e45a40 AC |
983 | "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n", |
984 | XSTRING (CALL_DUMMY_LENGTH)); | |
73c1f219 | 985 | if (gdbarch->call_dummy_length >= 0) |
08e45a40 | 986 | fprintf_unfiltered (file, |
06b25f14 AC |
987 | "gdbarch_dump: CALL_DUMMY_LENGTH = %d\n", |
988 | CALL_DUMMY_LENGTH); | |
66b43ecb | 989 | #endif |
08e45a40 | 990 | #ifdef CALL_DUMMY_LOCATION |
52204a0b | 991 | fprintf_unfiltered (file, |
08e45a40 AC |
992 | "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n", |
993 | XSTRING (CALL_DUMMY_LOCATION)); | |
994 | fprintf_unfiltered (file, | |
06b25f14 AC |
995 | "gdbarch_dump: CALL_DUMMY_LOCATION = %d\n", |
996 | CALL_DUMMY_LOCATION); | |
52204a0b | 997 | #endif |
08e45a40 | 998 | #ifdef CALL_DUMMY_P |
66b43ecb | 999 | fprintf_unfiltered (file, |
08e45a40 AC |
1000 | "gdbarch_dump: CALL_DUMMY_P # %s\n", |
1001 | XSTRING (CALL_DUMMY_P)); | |
1002 | fprintf_unfiltered (file, | |
06b25f14 AC |
1003 | "gdbarch_dump: CALL_DUMMY_P = %d\n", |
1004 | CALL_DUMMY_P); | |
66b43ecb | 1005 | #endif |
08e45a40 | 1006 | #ifdef CALL_DUMMY_STACK_ADJUST |
4b9b3959 | 1007 | fprintf_unfiltered (file, |
08e45a40 AC |
1008 | "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n", |
1009 | XSTRING (CALL_DUMMY_STACK_ADJUST)); | |
1010 | if (CALL_DUMMY_STACK_ADJUST_P) | |
1011 | fprintf_unfiltered (file, | |
1012 | "gdbarch_dump: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n", | |
1013 | (long) CALL_DUMMY_STACK_ADJUST); | |
4b9b3959 | 1014 | #endif |
08e45a40 | 1015 | #ifdef CALL_DUMMY_STACK_ADJUST_P |
4b9b3959 | 1016 | fprintf_unfiltered (file, |
08e45a40 AC |
1017 | "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P # %s\n", |
1018 | XSTRING (CALL_DUMMY_STACK_ADJUST_P)); | |
1019 | fprintf_unfiltered (file, | |
1020 | "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n", | |
1021 | (long) CALL_DUMMY_STACK_ADJUST_P); | |
4b9b3959 | 1022 | #endif |
08e45a40 | 1023 | #ifdef CALL_DUMMY_START_OFFSET |
4b9b3959 | 1024 | fprintf_unfiltered (file, |
08e45a40 AC |
1025 | "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n", |
1026 | XSTRING (CALL_DUMMY_START_OFFSET)); | |
1027 | fprintf_unfiltered (file, | |
1028 | "gdbarch_dump: CALL_DUMMY_START_OFFSET = 0x%08lx\n", | |
1029 | (long) CALL_DUMMY_START_OFFSET); | |
4b9b3959 | 1030 | #endif |
08e45a40 | 1031 | #ifdef CALL_DUMMY_WORDS |
4b9b3959 | 1032 | fprintf_unfiltered (file, |
08e45a40 AC |
1033 | "gdbarch_dump: CALL_DUMMY_WORDS # %s\n", |
1034 | XSTRING (CALL_DUMMY_WORDS)); | |
1035 | fprintf_unfiltered (file, | |
1036 | "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n", | |
1037 | (long) CALL_DUMMY_WORDS); | |
4b9b3959 | 1038 | #endif |
08e45a40 | 1039 | #ifdef CANNOT_FETCH_REGISTER |
4b9b3959 AC |
1040 | fprintf_unfiltered (file, |
1041 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1042 | "CANNOT_FETCH_REGISTER(regnum)", |
1043 | XSTRING (CANNOT_FETCH_REGISTER (regnum))); | |
1044 | if (GDB_MULTI_ARCH) | |
1045 | fprintf_unfiltered (file, | |
6cbda714 | 1046 | "gdbarch_dump: CANNOT_FETCH_REGISTER = <0x%08lx>\n", |
08e45a40 AC |
1047 | (long) current_gdbarch->cannot_fetch_register |
1048 | /*CANNOT_FETCH_REGISTER ()*/); | |
4b9b3959 | 1049 | #endif |
c4ed33b9 AC |
1050 | #ifdef CANNOT_STEP_BREAKPOINT |
1051 | fprintf_unfiltered (file, | |
1052 | "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n", | |
1053 | XSTRING (CANNOT_STEP_BREAKPOINT)); | |
1054 | fprintf_unfiltered (file, | |
1055 | "gdbarch_dump: CANNOT_STEP_BREAKPOINT = %d\n", | |
1056 | CANNOT_STEP_BREAKPOINT); | |
1057 | #endif | |
08e45a40 | 1058 | #ifdef CANNOT_STORE_REGISTER |
4b9b3959 AC |
1059 | fprintf_unfiltered (file, |
1060 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1061 | "CANNOT_STORE_REGISTER(regnum)", |
1062 | XSTRING (CANNOT_STORE_REGISTER (regnum))); | |
1063 | if (GDB_MULTI_ARCH) | |
1064 | fprintf_unfiltered (file, | |
6cbda714 | 1065 | "gdbarch_dump: CANNOT_STORE_REGISTER = <0x%08lx>\n", |
08e45a40 AC |
1066 | (long) current_gdbarch->cannot_store_register |
1067 | /*CANNOT_STORE_REGISTER ()*/); | |
4b9b3959 | 1068 | #endif |
a2cf933a EZ |
1069 | #ifdef COFF_MAKE_MSYMBOL_SPECIAL |
1070 | #if GDB_MULTI_ARCH | |
1071 | /* Macro might contain `[{}]' when not multi-arch */ | |
1072 | fprintf_unfiltered (file, | |
1073 | "gdbarch_dump: %s # %s\n", | |
1074 | "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)", | |
1075 | XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym))); | |
1076 | #endif | |
1077 | if (GDB_MULTI_ARCH) | |
1078 | fprintf_unfiltered (file, | |
6cbda714 | 1079 | "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n", |
a2cf933a EZ |
1080 | (long) current_gdbarch->coff_make_msymbol_special |
1081 | /*COFF_MAKE_MSYMBOL_SPECIAL ()*/); | |
4b9b3959 | 1082 | #endif |
552c04a7 TT |
1083 | if (GDB_MULTI_ARCH) |
1084 | fprintf_unfiltered (file, | |
1085 | "gdbarch_dump: construct_inferior_arguments = 0x%08lx\n", | |
1086 | (long) current_gdbarch->construct_inferior_arguments); | |
08e45a40 | 1087 | #ifdef CONVERT_FROM_FUNC_PTR_ADDR |
39d4ef09 AC |
1088 | fprintf_unfiltered (file, |
1089 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1090 | "CONVERT_FROM_FUNC_PTR_ADDR(addr)", |
1091 | XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr))); | |
1092 | if (GDB_MULTI_ARCH) | |
1093 | fprintf_unfiltered (file, | |
6cbda714 | 1094 | "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = <0x%08lx>\n", |
08e45a40 AC |
1095 | (long) current_gdbarch->convert_from_func_ptr_addr |
1096 | /*CONVERT_FROM_FUNC_PTR_ADDR ()*/); | |
39d4ef09 | 1097 | #endif |
13d01224 AC |
1098 | #ifdef CONVERT_REGISTER_P |
1099 | fprintf_unfiltered (file, | |
1100 | "gdbarch_dump: %s # %s\n", | |
1101 | "CONVERT_REGISTER_P(regnum)", | |
1102 | XSTRING (CONVERT_REGISTER_P (regnum))); | |
1103 | if (GDB_MULTI_ARCH) | |
1104 | fprintf_unfiltered (file, | |
6cbda714 | 1105 | "gdbarch_dump: CONVERT_REGISTER_P = <0x%08lx>\n", |
13d01224 AC |
1106 | (long) current_gdbarch->convert_register_p |
1107 | /*CONVERT_REGISTER_P ()*/); | |
1108 | #endif | |
08e45a40 | 1109 | #ifdef DECR_PC_AFTER_BREAK |
4b9b3959 | 1110 | fprintf_unfiltered (file, |
08e45a40 AC |
1111 | "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n", |
1112 | XSTRING (DECR_PC_AFTER_BREAK)); | |
0aba1244 | 1113 | fprintf_unfiltered (file, |
08e45a40 AC |
1114 | "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n", |
1115 | (long) DECR_PC_AFTER_BREAK); | |
0aba1244 | 1116 | #endif |
1e9f55d0 AC |
1117 | #ifdef DEPRECATED_DO_REGISTERS_INFO_P |
1118 | fprintf_unfiltered (file, | |
1119 | "gdbarch_dump: %s # %s\n", | |
1120 | "DEPRECATED_DO_REGISTERS_INFO_P()", | |
1121 | XSTRING (DEPRECATED_DO_REGISTERS_INFO_P ())); | |
1122 | fprintf_unfiltered (file, | |
1123 | "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO_P() = %d\n", | |
1124 | DEPRECATED_DO_REGISTERS_INFO_P ()); | |
1125 | #endif | |
903ad3a6 AC |
1126 | #ifdef DEPRECATED_DO_REGISTERS_INFO |
1127 | #if GDB_MULTI_ARCH | |
1128 | /* Macro might contain `[{}]' when not multi-arch */ | |
1129 | fprintf_unfiltered (file, | |
1130 | "gdbarch_dump: %s # %s\n", | |
1131 | "DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs)", | |
1132 | XSTRING (DEPRECATED_DO_REGISTERS_INFO (reg_nr, fpregs))); | |
1133 | #endif | |
1134 | if (GDB_MULTI_ARCH) | |
1135 | fprintf_unfiltered (file, | |
6cbda714 | 1136 | "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO = <0x%08lx>\n", |
903ad3a6 AC |
1137 | (long) current_gdbarch->deprecated_do_registers_info |
1138 | /*DEPRECATED_DO_REGISTERS_INFO ()*/); | |
1139 | #endif | |
26e9b323 AC |
1140 | #ifdef DEPRECATED_EXTRACT_RETURN_VALUE |
1141 | #if GDB_MULTI_ARCH | |
1142 | /* Macro might contain `[{}]' when not multi-arch */ | |
1143 | fprintf_unfiltered (file, | |
1144 | "gdbarch_dump: %s # %s\n", | |
1145 | "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)", | |
1146 | XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf))); | |
1147 | #endif | |
1148 | if (GDB_MULTI_ARCH) | |
1149 | fprintf_unfiltered (file, | |
6cbda714 | 1150 | "gdbarch_dump: DEPRECATED_EXTRACT_RETURN_VALUE = <0x%08lx>\n", |
26e9b323 AC |
1151 | (long) current_gdbarch->deprecated_extract_return_value |
1152 | /*DEPRECATED_EXTRACT_RETURN_VALUE ()*/); | |
1153 | #endif | |
1e9f55d0 AC |
1154 | #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P |
1155 | fprintf_unfiltered (file, | |
1156 | "gdbarch_dump: %s # %s\n", | |
1157 | "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()", | |
1158 | XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())); | |
1159 | fprintf_unfiltered (file, | |
1160 | "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() = %d\n", | |
1161 | DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()); | |
1162 | #endif | |
26e9b323 AC |
1163 | #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS |
1164 | fprintf_unfiltered (file, | |
1165 | "gdbarch_dump: %s # %s\n", | |
1166 | "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)", | |
1167 | XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regbuf))); | |
1168 | if (GDB_MULTI_ARCH) | |
1169 | fprintf_unfiltered (file, | |
6cbda714 | 1170 | "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n", |
26e9b323 AC |
1171 | (long) current_gdbarch->deprecated_extract_struct_value_address |
1172 | /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/); | |
1173 | #endif | |
a5afb99f AC |
1174 | #ifdef DEPRECATED_INIT_FRAME_PC_P |
1175 | fprintf_unfiltered (file, | |
1176 | "gdbarch_dump: %s # %s\n", | |
1177 | "DEPRECATED_INIT_FRAME_PC_P()", | |
1178 | XSTRING (DEPRECATED_INIT_FRAME_PC_P ())); | |
1179 | fprintf_unfiltered (file, | |
1180 | "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_P() = %d\n", | |
1181 | DEPRECATED_INIT_FRAME_PC_P ()); | |
1182 | #endif | |
1183 | #ifdef DEPRECATED_INIT_FRAME_PC | |
1184 | fprintf_unfiltered (file, | |
1185 | "gdbarch_dump: %s # %s\n", | |
1186 | "DEPRECATED_INIT_FRAME_PC(fromleaf, prev)", | |
1187 | XSTRING (DEPRECATED_INIT_FRAME_PC (fromleaf, prev))); | |
1188 | if (GDB_MULTI_ARCH) | |
1189 | fprintf_unfiltered (file, | |
1190 | "gdbarch_dump: DEPRECATED_INIT_FRAME_PC = <0x%08lx>\n", | |
1191 | (long) current_gdbarch->deprecated_init_frame_pc | |
1192 | /*DEPRECATED_INIT_FRAME_PC ()*/); | |
1193 | #endif | |
2ca6c561 AC |
1194 | #ifdef DEPRECATED_INIT_FRAME_PC_FIRST_P |
1195 | fprintf_unfiltered (file, | |
1196 | "gdbarch_dump: %s # %s\n", | |
1197 | "DEPRECATED_INIT_FRAME_PC_FIRST_P()", | |
1198 | XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST_P ())); | |
1199 | fprintf_unfiltered (file, | |
1200 | "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST_P() = %d\n", | |
1201 | DEPRECATED_INIT_FRAME_PC_FIRST_P ()); | |
1202 | #endif | |
1203 | #ifdef DEPRECATED_INIT_FRAME_PC_FIRST | |
2ca6c561 AC |
1204 | fprintf_unfiltered (file, |
1205 | "gdbarch_dump: %s # %s\n", | |
1206 | "DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev)", | |
1207 | XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev))); | |
2ca6c561 AC |
1208 | if (GDB_MULTI_ARCH) |
1209 | fprintf_unfiltered (file, | |
6cbda714 | 1210 | "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST = <0x%08lx>\n", |
2ca6c561 AC |
1211 | (long) current_gdbarch->deprecated_init_frame_pc_first |
1212 | /*DEPRECATED_INIT_FRAME_PC_FIRST ()*/); | |
1213 | #endif | |
1e9f55d0 AC |
1214 | #ifdef DEPRECATED_PC_IN_CALL_DUMMY_P |
1215 | fprintf_unfiltered (file, | |
1216 | "gdbarch_dump: %s # %s\n", | |
1217 | "DEPRECATED_PC_IN_CALL_DUMMY_P()", | |
1218 | XSTRING (DEPRECATED_PC_IN_CALL_DUMMY_P ())); | |
1219 | fprintf_unfiltered (file, | |
1220 | "gdbarch_dump: DEPRECATED_PC_IN_CALL_DUMMY_P() = %d\n", | |
1221 | DEPRECATED_PC_IN_CALL_DUMMY_P ()); | |
1222 | #endif | |
ae45cd16 AC |
1223 | #ifdef DEPRECATED_PC_IN_CALL_DUMMY |
1224 | fprintf_unfiltered (file, | |
1225 | "gdbarch_dump: %s # %s\n", | |
1226 | "DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address)", | |
1227 | XSTRING (DEPRECATED_PC_IN_CALL_DUMMY (pc, sp, frame_address))); | |
1228 | if (GDB_MULTI_ARCH) | |
1229 | fprintf_unfiltered (file, | |
6cbda714 | 1230 | "gdbarch_dump: DEPRECATED_PC_IN_CALL_DUMMY = <0x%08lx>\n", |
ae45cd16 AC |
1231 | (long) current_gdbarch->deprecated_pc_in_call_dummy |
1232 | /*DEPRECATED_PC_IN_CALL_DUMMY ()*/); | |
1233 | #endif | |
ebba8386 AC |
1234 | #ifdef DEPRECATED_STORE_RETURN_VALUE |
1235 | #if GDB_MULTI_ARCH | |
1236 | /* Macro might contain `[{}]' when not multi-arch */ | |
1237 | fprintf_unfiltered (file, | |
1238 | "gdbarch_dump: %s # %s\n", | |
1239 | "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)", | |
1240 | XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf))); | |
1241 | #endif | |
1242 | if (GDB_MULTI_ARCH) | |
1243 | fprintf_unfiltered (file, | |
6cbda714 | 1244 | "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = <0x%08lx>\n", |
ebba8386 AC |
1245 | (long) current_gdbarch->deprecated_store_return_value |
1246 | /*DEPRECATED_STORE_RETURN_VALUE ()*/); | |
1247 | #endif | |
07555a72 AC |
1248 | #ifdef DEPRECATED_USE_GENERIC_DUMMY_FRAMES |
1249 | fprintf_unfiltered (file, | |
1250 | "gdbarch_dump: DEPRECATED_USE_GENERIC_DUMMY_FRAMES # %s\n", | |
1251 | XSTRING (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)); | |
1252 | fprintf_unfiltered (file, | |
1253 | "gdbarch_dump: DEPRECATED_USE_GENERIC_DUMMY_FRAMES = %d\n", | |
1254 | DEPRECATED_USE_GENERIC_DUMMY_FRAMES); | |
1255 | #endif | |
1e9f55d0 AC |
1256 | #ifdef DWARF2_BUILD_FRAME_INFO_P |
1257 | fprintf_unfiltered (file, | |
1258 | "gdbarch_dump: %s # %s\n", | |
1259 | "DWARF2_BUILD_FRAME_INFO_P()", | |
1260 | XSTRING (DWARF2_BUILD_FRAME_INFO_P ())); | |
1261 | fprintf_unfiltered (file, | |
1262 | "gdbarch_dump: DWARF2_BUILD_FRAME_INFO_P() = %d\n", | |
1263 | DWARF2_BUILD_FRAME_INFO_P ()); | |
1264 | #endif | |
b6af0555 JS |
1265 | #ifdef DWARF2_BUILD_FRAME_INFO |
1266 | #if GDB_MULTI_ARCH | |
1267 | /* Macro might contain `[{}]' when not multi-arch */ | |
1268 | fprintf_unfiltered (file, | |
1269 | "gdbarch_dump: %s # %s\n", | |
1270 | "DWARF2_BUILD_FRAME_INFO(objfile)", | |
1271 | XSTRING (DWARF2_BUILD_FRAME_INFO (objfile))); | |
1272 | #endif | |
1273 | if (GDB_MULTI_ARCH) | |
1274 | fprintf_unfiltered (file, | |
6cbda714 | 1275 | "gdbarch_dump: DWARF2_BUILD_FRAME_INFO = <0x%08lx>\n", |
b6af0555 JS |
1276 | (long) current_gdbarch->dwarf2_build_frame_info |
1277 | /*DWARF2_BUILD_FRAME_INFO ()*/); | |
1278 | #endif | |
08e45a40 | 1279 | #ifdef DWARF2_REG_TO_REGNUM |
4b9b3959 | 1280 | fprintf_unfiltered (file, |
08e45a40 AC |
1281 | "gdbarch_dump: %s # %s\n", |
1282 | "DWARF2_REG_TO_REGNUM(dwarf2_regnr)", | |
1283 | XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr))); | |
1284 | if (GDB_MULTI_ARCH) | |
1285 | fprintf_unfiltered (file, | |
6cbda714 | 1286 | "gdbarch_dump: DWARF2_REG_TO_REGNUM = <0x%08lx>\n", |
08e45a40 AC |
1287 | (long) current_gdbarch->dwarf2_reg_to_regnum |
1288 | /*DWARF2_REG_TO_REGNUM ()*/); | |
4b9b3959 | 1289 | #endif |
08e45a40 | 1290 | #ifdef DWARF_REG_TO_REGNUM |
88c72b7d AC |
1291 | fprintf_unfiltered (file, |
1292 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1293 | "DWARF_REG_TO_REGNUM(dwarf_regnr)", |
1294 | XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr))); | |
1295 | if (GDB_MULTI_ARCH) | |
1296 | fprintf_unfiltered (file, | |
6cbda714 | 1297 | "gdbarch_dump: DWARF_REG_TO_REGNUM = <0x%08lx>\n", |
08e45a40 AC |
1298 | (long) current_gdbarch->dwarf_reg_to_regnum |
1299 | /*DWARF_REG_TO_REGNUM ()*/); | |
88c72b7d AC |
1300 | #endif |
1301 | #ifdef ECOFF_REG_TO_REGNUM | |
1302 | fprintf_unfiltered (file, | |
1303 | "gdbarch_dump: %s # %s\n", | |
1304 | "ECOFF_REG_TO_REGNUM(ecoff_regnr)", | |
1305 | XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr))); | |
08e45a40 AC |
1306 | if (GDB_MULTI_ARCH) |
1307 | fprintf_unfiltered (file, | |
6cbda714 | 1308 | "gdbarch_dump: ECOFF_REG_TO_REGNUM = <0x%08lx>\n", |
08e45a40 AC |
1309 | (long) current_gdbarch->ecoff_reg_to_regnum |
1310 | /*ECOFF_REG_TO_REGNUM ()*/); | |
88c72b7d | 1311 | #endif |
a2cf933a EZ |
1312 | #ifdef ELF_MAKE_MSYMBOL_SPECIAL |
1313 | #if GDB_MULTI_ARCH | |
1314 | /* Macro might contain `[{}]' when not multi-arch */ | |
1315 | fprintf_unfiltered (file, | |
1316 | "gdbarch_dump: %s # %s\n", | |
1317 | "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)", | |
1318 | XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym))); | |
1319 | #endif | |
1320 | if (GDB_MULTI_ARCH) | |
1321 | fprintf_unfiltered (file, | |
6cbda714 | 1322 | "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n", |
a2cf933a EZ |
1323 | (long) current_gdbarch->elf_make_msymbol_special |
1324 | /*ELF_MAKE_MSYMBOL_SPECIAL ()*/); | |
1325 | #endif | |
049ee0e4 AC |
1326 | #ifdef EXTRACT_RETURN_VALUE |
1327 | #if GDB_MULTI_ARCH | |
1328 | /* Macro might contain `[{}]' when not multi-arch */ | |
1329 | fprintf_unfiltered (file, | |
1330 | "gdbarch_dump: %s # %s\n", | |
1331 | "EXTRACT_RETURN_VALUE(type, regcache, valbuf)", | |
1332 | XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf))); | |
1333 | #endif | |
1334 | if (GDB_MULTI_ARCH) | |
1335 | fprintf_unfiltered (file, | |
6cbda714 | 1336 | "gdbarch_dump: EXTRACT_RETURN_VALUE = <0x%08lx>\n", |
049ee0e4 AC |
1337 | (long) current_gdbarch->extract_return_value |
1338 | /*EXTRACT_RETURN_VALUE ()*/); | |
1339 | #endif | |
1e9f55d0 AC |
1340 | #ifdef EXTRACT_STRUCT_VALUE_ADDRESS_P |
1341 | fprintf_unfiltered (file, | |
1342 | "gdbarch_dump: %s # %s\n", | |
1343 | "EXTRACT_STRUCT_VALUE_ADDRESS_P()", | |
1344 | XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS_P ())); | |
1345 | fprintf_unfiltered (file, | |
1346 | "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS_P() = %d\n", | |
1347 | EXTRACT_STRUCT_VALUE_ADDRESS_P ()); | |
1348 | #endif | |
049ee0e4 AC |
1349 | #ifdef EXTRACT_STRUCT_VALUE_ADDRESS |
1350 | fprintf_unfiltered (file, | |
1351 | "gdbarch_dump: %s # %s\n", | |
1352 | "EXTRACT_STRUCT_VALUE_ADDRESS(regcache)", | |
1353 | XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regcache))); | |
1354 | if (GDB_MULTI_ARCH) | |
1355 | fprintf_unfiltered (file, | |
6cbda714 | 1356 | "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n", |
049ee0e4 AC |
1357 | (long) current_gdbarch->extract_struct_value_address |
1358 | /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/); | |
1359 | #endif | |
08e45a40 AC |
1360 | #ifdef EXTRA_STACK_ALIGNMENT_NEEDED |
1361 | fprintf_unfiltered (file, | |
1362 | "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n", | |
1363 | XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED)); | |
1364 | fprintf_unfiltered (file, | |
06b25f14 AC |
1365 | "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %d\n", |
1366 | EXTRA_STACK_ALIGNMENT_NEEDED); | |
08e45a40 | 1367 | #endif |
08e45a40 AC |
1368 | #ifdef FIX_CALL_DUMMY |
1369 | #if GDB_MULTI_ARCH | |
1370 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1371 | fprintf_unfiltered (file, |
1372 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1373 | "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)", |
1374 | XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p))); | |
4b9b3959 | 1375 | #endif |
08e45a40 AC |
1376 | if (GDB_MULTI_ARCH) |
1377 | fprintf_unfiltered (file, | |
6cbda714 | 1378 | "gdbarch_dump: FIX_CALL_DUMMY = <0x%08lx>\n", |
08e45a40 AC |
1379 | (long) current_gdbarch->fix_call_dummy |
1380 | /*FIX_CALL_DUMMY ()*/); | |
1381 | #endif | |
1382 | #ifdef FP0_REGNUM | |
4b9b3959 | 1383 | fprintf_unfiltered (file, |
08e45a40 AC |
1384 | "gdbarch_dump: FP0_REGNUM # %s\n", |
1385 | XSTRING (FP0_REGNUM)); | |
1386 | fprintf_unfiltered (file, | |
06b25f14 AC |
1387 | "gdbarch_dump: FP0_REGNUM = %d\n", |
1388 | FP0_REGNUM); | |
4b9b3959 | 1389 | #endif |
08e45a40 | 1390 | #ifdef FP_REGNUM |
4b9b3959 | 1391 | fprintf_unfiltered (file, |
08e45a40 AC |
1392 | "gdbarch_dump: FP_REGNUM # %s\n", |
1393 | XSTRING (FP_REGNUM)); | |
1394 | fprintf_unfiltered (file, | |
06b25f14 AC |
1395 | "gdbarch_dump: FP_REGNUM = %d\n", |
1396 | FP_REGNUM); | |
4b9b3959 | 1397 | #endif |
5e74b15c RE |
1398 | #ifdef FRAMELESS_FUNCTION_INVOCATION |
1399 | fprintf_unfiltered (file, | |
1400 | "gdbarch_dump: %s # %s\n", | |
1401 | "FRAMELESS_FUNCTION_INVOCATION(fi)", | |
1402 | XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi))); | |
1403 | if (GDB_MULTI_ARCH) | |
1404 | fprintf_unfiltered (file, | |
6cbda714 | 1405 | "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = <0x%08lx>\n", |
5e74b15c RE |
1406 | (long) current_gdbarch->frameless_function_invocation |
1407 | /*FRAMELESS_FUNCTION_INVOCATION ()*/); | |
1408 | #endif | |
08e45a40 | 1409 | #ifdef FRAME_ARGS_ADDRESS |
4b9b3959 AC |
1410 | fprintf_unfiltered (file, |
1411 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1412 | "FRAME_ARGS_ADDRESS(fi)", |
1413 | XSTRING (FRAME_ARGS_ADDRESS (fi))); | |
1414 | if (GDB_MULTI_ARCH) | |
1415 | fprintf_unfiltered (file, | |
6cbda714 | 1416 | "gdbarch_dump: FRAME_ARGS_ADDRESS = <0x%08lx>\n", |
08e45a40 AC |
1417 | (long) current_gdbarch->frame_args_address |
1418 | /*FRAME_ARGS_ADDRESS ()*/); | |
4b9b3959 | 1419 | #endif |
08e45a40 | 1420 | #ifdef FRAME_ARGS_SKIP |
4b9b3959 | 1421 | fprintf_unfiltered (file, |
08e45a40 AC |
1422 | "gdbarch_dump: FRAME_ARGS_SKIP # %s\n", |
1423 | XSTRING (FRAME_ARGS_SKIP)); | |
4b9b3959 | 1424 | fprintf_unfiltered (file, |
08e45a40 AC |
1425 | "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n", |
1426 | (long) FRAME_ARGS_SKIP); | |
4b9b3959 | 1427 | #endif |
d62d1979 AC |
1428 | #ifdef FRAME_CHAIN_P |
1429 | fprintf_unfiltered (file, | |
1430 | "gdbarch_dump: %s # %s\n", | |
1431 | "FRAME_CHAIN_P()", | |
1432 | XSTRING (FRAME_CHAIN_P ())); | |
1433 | fprintf_unfiltered (file, | |
1434 | "gdbarch_dump: FRAME_CHAIN_P() = %d\n", | |
1435 | FRAME_CHAIN_P ()); | |
1436 | #endif | |
08e45a40 | 1437 | #ifdef FRAME_CHAIN |
4b9b3959 | 1438 | fprintf_unfiltered (file, |
08e45a40 AC |
1439 | "gdbarch_dump: %s # %s\n", |
1440 | "FRAME_CHAIN(frame)", | |
1441 | XSTRING (FRAME_CHAIN (frame))); | |
1442 | if (GDB_MULTI_ARCH) | |
1443 | fprintf_unfiltered (file, | |
6cbda714 | 1444 | "gdbarch_dump: FRAME_CHAIN = <0x%08lx>\n", |
08e45a40 AC |
1445 | (long) current_gdbarch->frame_chain |
1446 | /*FRAME_CHAIN ()*/); | |
4b9b3959 | 1447 | #endif |
51603483 DJ |
1448 | #ifdef FRAME_CHAIN_VALID_P |
1449 | fprintf_unfiltered (file, | |
1450 | "gdbarch_dump: %s # %s\n", | |
1451 | "FRAME_CHAIN_VALID_P()", | |
1452 | XSTRING (FRAME_CHAIN_VALID_P ())); | |
1453 | fprintf_unfiltered (file, | |
1454 | "gdbarch_dump: FRAME_CHAIN_VALID_P() = %d\n", | |
1455 | FRAME_CHAIN_VALID_P ()); | |
1456 | #endif | |
08e45a40 | 1457 | #ifdef FRAME_CHAIN_VALID |
4b9b3959 AC |
1458 | fprintf_unfiltered (file, |
1459 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1460 | "FRAME_CHAIN_VALID(chain, thisframe)", |
1461 | XSTRING (FRAME_CHAIN_VALID (chain, thisframe))); | |
1462 | if (GDB_MULTI_ARCH) | |
1463 | fprintf_unfiltered (file, | |
6cbda714 | 1464 | "gdbarch_dump: FRAME_CHAIN_VALID = <0x%08lx>\n", |
08e45a40 AC |
1465 | (long) current_gdbarch->frame_chain_valid |
1466 | /*FRAME_CHAIN_VALID ()*/); | |
4b9b3959 | 1467 | #endif |
8f871025 AC |
1468 | #ifdef FRAME_INIT_SAVED_REGS_P |
1469 | fprintf_unfiltered (file, | |
1470 | "gdbarch_dump: %s # %s\n", | |
1471 | "FRAME_INIT_SAVED_REGS_P()", | |
1472 | XSTRING (FRAME_INIT_SAVED_REGS_P ())); | |
1473 | fprintf_unfiltered (file, | |
1474 | "gdbarch_dump: FRAME_INIT_SAVED_REGS_P() = %d\n", | |
1475 | FRAME_INIT_SAVED_REGS_P ()); | |
1476 | #endif | |
08e45a40 AC |
1477 | #ifdef FRAME_INIT_SAVED_REGS |
1478 | #if GDB_MULTI_ARCH | |
666e11c5 EZ |
1479 | /* Macro might contain `[{}]' when not multi-arch */ |
1480 | fprintf_unfiltered (file, | |
1481 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1482 | "FRAME_INIT_SAVED_REGS(frame)", |
1483 | XSTRING (FRAME_INIT_SAVED_REGS (frame))); | |
666e11c5 | 1484 | #endif |
08e45a40 AC |
1485 | if (GDB_MULTI_ARCH) |
1486 | fprintf_unfiltered (file, | |
6cbda714 | 1487 | "gdbarch_dump: FRAME_INIT_SAVED_REGS = <0x%08lx>\n", |
08e45a40 AC |
1488 | (long) current_gdbarch->frame_init_saved_regs |
1489 | /*FRAME_INIT_SAVED_REGS ()*/); | |
7c7651b2 | 1490 | #endif |
08e45a40 | 1491 | #ifdef FRAME_LOCALS_ADDRESS |
2649061d AC |
1492 | fprintf_unfiltered (file, |
1493 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1494 | "FRAME_LOCALS_ADDRESS(fi)", |
1495 | XSTRING (FRAME_LOCALS_ADDRESS (fi))); | |
1496 | if (GDB_MULTI_ARCH) | |
1497 | fprintf_unfiltered (file, | |
6cbda714 | 1498 | "gdbarch_dump: FRAME_LOCALS_ADDRESS = <0x%08lx>\n", |
08e45a40 AC |
1499 | (long) current_gdbarch->frame_locals_address |
1500 | /*FRAME_LOCALS_ADDRESS ()*/); | |
2649061d | 1501 | #endif |
08e45a40 | 1502 | #ifdef FRAME_NUM_ARGS |
01fb7433 AC |
1503 | fprintf_unfiltered (file, |
1504 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1505 | "FRAME_NUM_ARGS(frame)", |
1506 | XSTRING (FRAME_NUM_ARGS (frame))); | |
1507 | if (GDB_MULTI_ARCH) | |
1508 | fprintf_unfiltered (file, | |
6cbda714 | 1509 | "gdbarch_dump: FRAME_NUM_ARGS = <0x%08lx>\n", |
08e45a40 AC |
1510 | (long) current_gdbarch->frame_num_args |
1511 | /*FRAME_NUM_ARGS ()*/); | |
01fb7433 | 1512 | #endif |
d62d1979 AC |
1513 | #ifdef FRAME_SAVED_PC_P |
1514 | fprintf_unfiltered (file, | |
1515 | "gdbarch_dump: %s # %s\n", | |
1516 | "FRAME_SAVED_PC_P()", | |
1517 | XSTRING (FRAME_SAVED_PC_P ())); | |
1518 | fprintf_unfiltered (file, | |
1519 | "gdbarch_dump: FRAME_SAVED_PC_P() = %d\n", | |
1520 | FRAME_SAVED_PC_P ()); | |
1521 | #endif | |
08e45a40 | 1522 | #ifdef FRAME_SAVED_PC |
01fb7433 AC |
1523 | fprintf_unfiltered (file, |
1524 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1525 | "FRAME_SAVED_PC(fi)", |
1526 | XSTRING (FRAME_SAVED_PC (fi))); | |
1527 | if (GDB_MULTI_ARCH) | |
1528 | fprintf_unfiltered (file, | |
6cbda714 | 1529 | "gdbarch_dump: FRAME_SAVED_PC = <0x%08lx>\n", |
08e45a40 AC |
1530 | (long) current_gdbarch->frame_saved_pc |
1531 | /*FRAME_SAVED_PC ()*/); | |
01fb7433 | 1532 | #endif |
08e45a40 | 1533 | #ifdef FUNCTION_START_OFFSET |
4b9b3959 | 1534 | fprintf_unfiltered (file, |
08e45a40 AC |
1535 | "gdbarch_dump: FUNCTION_START_OFFSET # %s\n", |
1536 | XSTRING (FUNCTION_START_OFFSET)); | |
4b9b3959 | 1537 | fprintf_unfiltered (file, |
08e45a40 AC |
1538 | "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n", |
1539 | (long) FUNCTION_START_OFFSET); | |
4b9b3959 | 1540 | #endif |
1e9f55d0 AC |
1541 | #ifdef GET_LONGJMP_TARGET_P |
1542 | fprintf_unfiltered (file, | |
1543 | "gdbarch_dump: %s # %s\n", | |
1544 | "GET_LONGJMP_TARGET_P()", | |
1545 | XSTRING (GET_LONGJMP_TARGET_P ())); | |
1546 | fprintf_unfiltered (file, | |
1547 | "gdbarch_dump: GET_LONGJMP_TARGET_P() = %d\n", | |
1548 | GET_LONGJMP_TARGET_P ()); | |
1549 | #endif | |
9df628e0 RE |
1550 | #ifdef GET_LONGJMP_TARGET |
1551 | fprintf_unfiltered (file, | |
1552 | "gdbarch_dump: %s # %s\n", | |
1553 | "GET_LONGJMP_TARGET(pc)", | |
1554 | XSTRING (GET_LONGJMP_TARGET (pc))); | |
1555 | if (GDB_MULTI_ARCH) | |
1556 | fprintf_unfiltered (file, | |
6cbda714 | 1557 | "gdbarch_dump: GET_LONGJMP_TARGET = <0x%08lx>\n", |
9df628e0 RE |
1558 | (long) current_gdbarch->get_longjmp_target |
1559 | /*GET_LONGJMP_TARGET ()*/); | |
1560 | #endif | |
1e9f55d0 AC |
1561 | #ifdef GET_SAVED_REGISTER_P |
1562 | fprintf_unfiltered (file, | |
1563 | "gdbarch_dump: %s # %s\n", | |
1564 | "GET_SAVED_REGISTER_P()", | |
1565 | XSTRING (GET_SAVED_REGISTER_P ())); | |
1566 | fprintf_unfiltered (file, | |
1567 | "gdbarch_dump: GET_SAVED_REGISTER_P() = %d\n", | |
1568 | GET_SAVED_REGISTER_P ()); | |
1569 | #endif | |
08e45a40 AC |
1570 | #ifdef GET_SAVED_REGISTER |
1571 | #if GDB_MULTI_ARCH | |
1572 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1573 | fprintf_unfiltered (file, |
1574 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1575 | "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)", |
1576 | XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval))); | |
4b9b3959 | 1577 | #endif |
08e45a40 AC |
1578 | if (GDB_MULTI_ARCH) |
1579 | fprintf_unfiltered (file, | |
6cbda714 | 1580 | "gdbarch_dump: GET_SAVED_REGISTER = <0x%08lx>\n", |
08e45a40 AC |
1581 | (long) current_gdbarch->get_saved_register |
1582 | /*GET_SAVED_REGISTER ()*/); | |
4b9b3959 | 1583 | #endif |
967c0d83 | 1584 | #ifdef HAVE_NONSTEPPABLE_WATCHPOINT |
f74fa174 | 1585 | fprintf_unfiltered (file, |
967c0d83 MM |
1586 | "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n", |
1587 | XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT)); | |
f74fa174 | 1588 | fprintf_unfiltered (file, |
967c0d83 MM |
1589 | "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT = %d\n", |
1590 | HAVE_NONSTEPPABLE_WATCHPOINT); | |
f74fa174 | 1591 | #endif |
1e9f55d0 AC |
1592 | #ifdef INIT_EXTRA_FRAME_INFO_P |
1593 | fprintf_unfiltered (file, | |
1594 | "gdbarch_dump: %s # %s\n", | |
1595 | "INIT_EXTRA_FRAME_INFO_P()", | |
1596 | XSTRING (INIT_EXTRA_FRAME_INFO_P ())); | |
1597 | fprintf_unfiltered (file, | |
1598 | "gdbarch_dump: INIT_EXTRA_FRAME_INFO_P() = %d\n", | |
1599 | INIT_EXTRA_FRAME_INFO_P ()); | |
1600 | #endif | |
08e45a40 AC |
1601 | #ifdef INIT_EXTRA_FRAME_INFO |
1602 | #if GDB_MULTI_ARCH | |
1603 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1604 | fprintf_unfiltered (file, |
1605 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1606 | "INIT_EXTRA_FRAME_INFO(fromleaf, frame)", |
1607 | XSTRING (INIT_EXTRA_FRAME_INFO (fromleaf, frame))); | |
4b9b3959 | 1608 | #endif |
08e45a40 AC |
1609 | if (GDB_MULTI_ARCH) |
1610 | fprintf_unfiltered (file, | |
6cbda714 | 1611 | "gdbarch_dump: INIT_EXTRA_FRAME_INFO = <0x%08lx>\n", |
08e45a40 AC |
1612 | (long) current_gdbarch->init_extra_frame_info |
1613 | /*INIT_EXTRA_FRAME_INFO ()*/); | |
4b9b3959 | 1614 | #endif |
08e45a40 | 1615 | #ifdef INNER_THAN |
10312cc4 AC |
1616 | fprintf_unfiltered (file, |
1617 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1618 | "INNER_THAN(lhs, rhs)", |
1619 | XSTRING (INNER_THAN (lhs, rhs))); | |
1620 | if (GDB_MULTI_ARCH) | |
1621 | fprintf_unfiltered (file, | |
6cbda714 | 1622 | "gdbarch_dump: INNER_THAN = <0x%08lx>\n", |
08e45a40 AC |
1623 | (long) current_gdbarch->inner_than |
1624 | /*INNER_THAN ()*/); | |
10312cc4 | 1625 | #endif |
1e9f55d0 AC |
1626 | #ifdef INTEGER_TO_ADDRESS_P |
1627 | fprintf_unfiltered (file, | |
1628 | "gdbarch_dump: %s # %s\n", | |
1629 | "INTEGER_TO_ADDRESS_P()", | |
1630 | XSTRING (INTEGER_TO_ADDRESS_P ())); | |
1631 | fprintf_unfiltered (file, | |
1632 | "gdbarch_dump: INTEGER_TO_ADDRESS_P() = %d\n", | |
1633 | INTEGER_TO_ADDRESS_P ()); | |
1634 | #endif | |
fc0c74b1 AC |
1635 | #ifdef INTEGER_TO_ADDRESS |
1636 | fprintf_unfiltered (file, | |
1637 | "gdbarch_dump: %s # %s\n", | |
1638 | "INTEGER_TO_ADDRESS(type, buf)", | |
1639 | XSTRING (INTEGER_TO_ADDRESS (type, buf))); | |
1640 | if (GDB_MULTI_ARCH) | |
1641 | fprintf_unfiltered (file, | |
6cbda714 | 1642 | "gdbarch_dump: INTEGER_TO_ADDRESS = <0x%08lx>\n", |
fc0c74b1 AC |
1643 | (long) current_gdbarch->integer_to_address |
1644 | /*INTEGER_TO_ADDRESS ()*/); | |
1645 | #endif | |
5e74b15c RE |
1646 | #ifdef IN_SOLIB_CALL_TRAMPOLINE |
1647 | fprintf_unfiltered (file, | |
1648 | "gdbarch_dump: %s # %s\n", | |
1649 | "IN_SOLIB_CALL_TRAMPOLINE(pc, name)", | |
1650 | XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name))); | |
68e9cc94 CV |
1651 | if (GDB_MULTI_ARCH) |
1652 | fprintf_unfiltered (file, | |
6cbda714 | 1653 | "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = <0x%08lx>\n", |
5e74b15c RE |
1654 | (long) current_gdbarch->in_solib_call_trampoline |
1655 | /*IN_SOLIB_CALL_TRAMPOLINE ()*/); | |
1656 | #endif | |
d50355b6 MS |
1657 | #ifdef IN_SOLIB_RETURN_TRAMPOLINE |
1658 | fprintf_unfiltered (file, | |
1659 | "gdbarch_dump: %s # %s\n", | |
1660 | "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)", | |
1661 | XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name))); | |
1662 | if (GDB_MULTI_ARCH) | |
1663 | fprintf_unfiltered (file, | |
6cbda714 | 1664 | "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = <0x%08lx>\n", |
d50355b6 MS |
1665 | (long) current_gdbarch->in_solib_return_trampoline |
1666 | /*IN_SOLIB_RETURN_TRAMPOLINE ()*/); | |
1667 | #endif | |
08e45a40 | 1668 | #ifdef MAX_REGISTER_RAW_SIZE |
4b9b3959 | 1669 | fprintf_unfiltered (file, |
08e45a40 AC |
1670 | "gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n", |
1671 | XSTRING (MAX_REGISTER_RAW_SIZE)); | |
1672 | fprintf_unfiltered (file, | |
06b25f14 AC |
1673 | "gdbarch_dump: MAX_REGISTER_RAW_SIZE = %d\n", |
1674 | MAX_REGISTER_RAW_SIZE); | |
4b9b3959 | 1675 | #endif |
08e45a40 | 1676 | #ifdef MAX_REGISTER_VIRTUAL_SIZE |
4b9b3959 | 1677 | fprintf_unfiltered (file, |
08e45a40 AC |
1678 | "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE # %s\n", |
1679 | XSTRING (MAX_REGISTER_VIRTUAL_SIZE)); | |
1680 | fprintf_unfiltered (file, | |
06b25f14 AC |
1681 | "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE = %d\n", |
1682 | MAX_REGISTER_VIRTUAL_SIZE); | |
4b9b3959 | 1683 | #endif |
08e45a40 | 1684 | #ifdef MEMORY_INSERT_BREAKPOINT |
4b9b3959 AC |
1685 | fprintf_unfiltered (file, |
1686 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1687 | "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)", |
1688 | XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache))); | |
1689 | if (GDB_MULTI_ARCH) | |
1690 | fprintf_unfiltered (file, | |
6cbda714 | 1691 | "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = <0x%08lx>\n", |
08e45a40 AC |
1692 | (long) current_gdbarch->memory_insert_breakpoint |
1693 | /*MEMORY_INSERT_BREAKPOINT ()*/); | |
4b9b3959 | 1694 | #endif |
08e45a40 | 1695 | #ifdef MEMORY_REMOVE_BREAKPOINT |
4b9b3959 AC |
1696 | fprintf_unfiltered (file, |
1697 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1698 | "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)", |
1699 | XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache))); | |
1700 | if (GDB_MULTI_ARCH) | |
1701 | fprintf_unfiltered (file, | |
6cbda714 | 1702 | "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = <0x%08lx>\n", |
08e45a40 AC |
1703 | (long) current_gdbarch->memory_remove_breakpoint |
1704 | /*MEMORY_REMOVE_BREAKPOINT ()*/); | |
4b9b3959 | 1705 | #endif |
5720643c JB |
1706 | #ifdef NAME_OF_MALLOC |
1707 | fprintf_unfiltered (file, | |
1708 | "gdbarch_dump: NAME_OF_MALLOC # %s\n", | |
1709 | XSTRING (NAME_OF_MALLOC)); | |
1710 | fprintf_unfiltered (file, | |
31deffe5 AC |
1711 | "gdbarch_dump: NAME_OF_MALLOC = %s\n", |
1712 | NAME_OF_MALLOC); | |
5720643c | 1713 | #endif |
08e45a40 | 1714 | #ifdef NPC_REGNUM |
4b9b3959 | 1715 | fprintf_unfiltered (file, |
08e45a40 AC |
1716 | "gdbarch_dump: NPC_REGNUM # %s\n", |
1717 | XSTRING (NPC_REGNUM)); | |
1718 | fprintf_unfiltered (file, | |
06b25f14 AC |
1719 | "gdbarch_dump: NPC_REGNUM = %d\n", |
1720 | NPC_REGNUM); | |
4b9b3959 | 1721 | #endif |
08e45a40 | 1722 | #ifdef NUM_PSEUDO_REGS |
4b9b3959 | 1723 | fprintf_unfiltered (file, |
08e45a40 AC |
1724 | "gdbarch_dump: NUM_PSEUDO_REGS # %s\n", |
1725 | XSTRING (NUM_PSEUDO_REGS)); | |
1726 | fprintf_unfiltered (file, | |
06b25f14 AC |
1727 | "gdbarch_dump: NUM_PSEUDO_REGS = %d\n", |
1728 | NUM_PSEUDO_REGS); | |
4b9b3959 | 1729 | #endif |
08e45a40 | 1730 | #ifdef NUM_REGS |
7f1b2585 | 1731 | fprintf_unfiltered (file, |
08e45a40 AC |
1732 | "gdbarch_dump: NUM_REGS # %s\n", |
1733 | XSTRING (NUM_REGS)); | |
1734 | fprintf_unfiltered (file, | |
06b25f14 AC |
1735 | "gdbarch_dump: NUM_REGS = %d\n", |
1736 | NUM_REGS); | |
7f1b2585 | 1737 | #endif |
08e45a40 AC |
1738 | #ifdef PARM_BOUNDARY |
1739 | fprintf_unfiltered (file, | |
1740 | "gdbarch_dump: PARM_BOUNDARY # %s\n", | |
1741 | XSTRING (PARM_BOUNDARY)); | |
1742 | fprintf_unfiltered (file, | |
06b25f14 AC |
1743 | "gdbarch_dump: PARM_BOUNDARY = %d\n", |
1744 | PARM_BOUNDARY); | |
08e45a40 | 1745 | #endif |
d7bd68ca AC |
1746 | #ifdef PC_IN_SIGTRAMP |
1747 | fprintf_unfiltered (file, | |
1748 | "gdbarch_dump: %s # %s\n", | |
1749 | "PC_IN_SIGTRAMP(pc, name)", | |
1750 | XSTRING (PC_IN_SIGTRAMP (pc, name))); | |
1751 | if (GDB_MULTI_ARCH) | |
1752 | fprintf_unfiltered (file, | |
6cbda714 | 1753 | "gdbarch_dump: PC_IN_SIGTRAMP = <0x%08lx>\n", |
d7bd68ca AC |
1754 | (long) current_gdbarch->pc_in_sigtramp |
1755 | /*PC_IN_SIGTRAMP ()*/); | |
1756 | #endif | |
08e45a40 AC |
1757 | #ifdef PC_REGNUM |
1758 | fprintf_unfiltered (file, | |
1759 | "gdbarch_dump: PC_REGNUM # %s\n", | |
1760 | XSTRING (PC_REGNUM)); | |
1761 | fprintf_unfiltered (file, | |
06b25f14 AC |
1762 | "gdbarch_dump: PC_REGNUM = %d\n", |
1763 | PC_REGNUM); | |
7f1b2585 | 1764 | #endif |
4b9b3959 AC |
1765 | #ifdef POINTER_TO_ADDRESS |
1766 | fprintf_unfiltered (file, | |
1767 | "gdbarch_dump: %s # %s\n", | |
1768 | "POINTER_TO_ADDRESS(type, buf)", | |
1769 | XSTRING (POINTER_TO_ADDRESS (type, buf))); | |
08e45a40 AC |
1770 | if (GDB_MULTI_ARCH) |
1771 | fprintf_unfiltered (file, | |
6cbda714 | 1772 | "gdbarch_dump: POINTER_TO_ADDRESS = <0x%08lx>\n", |
08e45a40 AC |
1773 | (long) current_gdbarch->pointer_to_address |
1774 | /*POINTER_TO_ADDRESS ()*/); | |
4b9b3959 | 1775 | #endif |
dedc2a2b AC |
1776 | #ifdef POP_FRAME_P |
1777 | fprintf_unfiltered (file, | |
1778 | "gdbarch_dump: %s # %s\n", | |
1779 | "POP_FRAME_P()", | |
1780 | XSTRING (POP_FRAME_P ())); | |
1781 | fprintf_unfiltered (file, | |
1782 | "gdbarch_dump: POP_FRAME_P() = %d\n", | |
1783 | POP_FRAME_P ()); | |
1784 | #endif | |
08e45a40 AC |
1785 | #ifdef POP_FRAME |
1786 | #if GDB_MULTI_ARCH | |
63e69063 | 1787 | /* Macro might contain `[{}]' when not multi-arch */ |
4b9b3959 AC |
1788 | fprintf_unfiltered (file, |
1789 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1790 | "POP_FRAME(-)", |
1791 | XSTRING (POP_FRAME (-))); | |
4b9b3959 | 1792 | #endif |
08e45a40 AC |
1793 | if (GDB_MULTI_ARCH) |
1794 | fprintf_unfiltered (file, | |
6cbda714 | 1795 | "gdbarch_dump: POP_FRAME = <0x%08lx>\n", |
08e45a40 AC |
1796 | (long) current_gdbarch->pop_frame |
1797 | /*POP_FRAME ()*/); | |
1798 | #endif | |
1799 | #ifdef PREPARE_TO_PROCEED | |
4b9b3959 AC |
1800 | fprintf_unfiltered (file, |
1801 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1802 | "PREPARE_TO_PROCEED(select_it)", |
1803 | XSTRING (PREPARE_TO_PROCEED (select_it))); | |
1804 | if (GDB_MULTI_ARCH) | |
1805 | fprintf_unfiltered (file, | |
6cbda714 | 1806 | "gdbarch_dump: PREPARE_TO_PROCEED = <0x%08lx>\n", |
08e45a40 AC |
1807 | (long) current_gdbarch->prepare_to_proceed |
1808 | /*PREPARE_TO_PROCEED ()*/); | |
5e74b15c | 1809 | #endif |
1e9f55d0 AC |
1810 | if (GDB_MULTI_ARCH) |
1811 | fprintf_unfiltered (file, | |
1812 | "gdbarch_dump: gdbarch_print_float_info_p() = %d\n", | |
1813 | gdbarch_print_float_info_p (current_gdbarch)); | |
5e74b15c RE |
1814 | if (GDB_MULTI_ARCH) |
1815 | fprintf_unfiltered (file, | |
d855c300 AC |
1816 | "gdbarch_dump: print_float_info = 0x%08lx\n", |
1817 | (long) current_gdbarch->print_float_info); | |
0ab7a791 AC |
1818 | if (GDB_MULTI_ARCH) |
1819 | fprintf_unfiltered (file, | |
1820 | "gdbarch_dump: print_registers_info = 0x%08lx\n", | |
1821 | (long) current_gdbarch->print_registers_info); | |
1e9f55d0 AC |
1822 | if (GDB_MULTI_ARCH) |
1823 | fprintf_unfiltered (file, | |
1824 | "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n", | |
1825 | gdbarch_print_vector_info_p (current_gdbarch)); | |
e76f1f2e AC |
1826 | if (GDB_MULTI_ARCH) |
1827 | fprintf_unfiltered (file, | |
1828 | "gdbarch_dump: print_vector_info = 0x%08lx\n", | |
1829 | (long) current_gdbarch->print_vector_info); | |
08e45a40 | 1830 | #ifdef PROLOGUE_FRAMELESS_P |
4b9b3959 AC |
1831 | fprintf_unfiltered (file, |
1832 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1833 | "PROLOGUE_FRAMELESS_P(ip)", |
1834 | XSTRING (PROLOGUE_FRAMELESS_P (ip))); | |
1835 | if (GDB_MULTI_ARCH) | |
1836 | fprintf_unfiltered (file, | |
6cbda714 | 1837 | "gdbarch_dump: PROLOGUE_FRAMELESS_P = <0x%08lx>\n", |
08e45a40 AC |
1838 | (long) current_gdbarch->prologue_frameless_p |
1839 | /*PROLOGUE_FRAMELESS_P ()*/); | |
4b9b3959 | 1840 | #endif |
c2169756 AC |
1841 | #ifdef PS_REGNUM |
1842 | fprintf_unfiltered (file, | |
1843 | "gdbarch_dump: PS_REGNUM # %s\n", | |
1844 | XSTRING (PS_REGNUM)); | |
1845 | fprintf_unfiltered (file, | |
1846 | "gdbarch_dump: PS_REGNUM = %d\n", | |
1847 | PS_REGNUM); | |
1848 | #endif | |
4b9b3959 AC |
1849 | #ifdef PUSH_ARGUMENTS |
1850 | fprintf_unfiltered (file, | |
1851 | "gdbarch_dump: %s # %s\n", | |
1852 | "PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)", | |
1853 | XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr))); | |
08e45a40 AC |
1854 | if (GDB_MULTI_ARCH) |
1855 | fprintf_unfiltered (file, | |
6cbda714 | 1856 | "gdbarch_dump: PUSH_ARGUMENTS = <0x%08lx>\n", |
08e45a40 AC |
1857 | (long) current_gdbarch->push_arguments |
1858 | /*PUSH_ARGUMENTS ()*/); | |
4b9b3959 | 1859 | #endif |
08e45a40 AC |
1860 | #ifdef PUSH_DUMMY_FRAME |
1861 | #if GDB_MULTI_ARCH | |
63e69063 | 1862 | /* Macro might contain `[{}]' when not multi-arch */ |
4b9b3959 AC |
1863 | fprintf_unfiltered (file, |
1864 | "gdbarch_dump: %s # %s\n", | |
1865 | "PUSH_DUMMY_FRAME(-)", | |
1866 | XSTRING (PUSH_DUMMY_FRAME (-))); | |
08e45a40 AC |
1867 | #endif |
1868 | if (GDB_MULTI_ARCH) | |
1869 | fprintf_unfiltered (file, | |
6cbda714 | 1870 | "gdbarch_dump: PUSH_DUMMY_FRAME = <0x%08lx>\n", |
08e45a40 AC |
1871 | (long) current_gdbarch->push_dummy_frame |
1872 | /*PUSH_DUMMY_FRAME ()*/); | |
4b9b3959 | 1873 | #endif |
1e9f55d0 AC |
1874 | #ifdef PUSH_RETURN_ADDRESS_P |
1875 | fprintf_unfiltered (file, | |
1876 | "gdbarch_dump: %s # %s\n", | |
1877 | "PUSH_RETURN_ADDRESS_P()", | |
1878 | XSTRING (PUSH_RETURN_ADDRESS_P ())); | |
1879 | fprintf_unfiltered (file, | |
1880 | "gdbarch_dump: PUSH_RETURN_ADDRESS_P() = %d\n", | |
1881 | PUSH_RETURN_ADDRESS_P ()); | |
1882 | #endif | |
4b9b3959 AC |
1883 | #ifdef PUSH_RETURN_ADDRESS |
1884 | fprintf_unfiltered (file, | |
1885 | "gdbarch_dump: %s # %s\n", | |
1886 | "PUSH_RETURN_ADDRESS(pc, sp)", | |
1887 | XSTRING (PUSH_RETURN_ADDRESS (pc, sp))); | |
08e45a40 AC |
1888 | if (GDB_MULTI_ARCH) |
1889 | fprintf_unfiltered (file, | |
6cbda714 | 1890 | "gdbarch_dump: PUSH_RETURN_ADDRESS = <0x%08lx>\n", |
08e45a40 AC |
1891 | (long) current_gdbarch->push_return_address |
1892 | /*PUSH_RETURN_ADDRESS ()*/); | |
4b9b3959 | 1893 | #endif |
08e45a40 | 1894 | #ifdef REGISTER_BYTE |
4b9b3959 AC |
1895 | fprintf_unfiltered (file, |
1896 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1897 | "REGISTER_BYTE(reg_nr)", |
1898 | XSTRING (REGISTER_BYTE (reg_nr))); | |
1899 | if (GDB_MULTI_ARCH) | |
1900 | fprintf_unfiltered (file, | |
6cbda714 | 1901 | "gdbarch_dump: REGISTER_BYTE = <0x%08lx>\n", |
08e45a40 AC |
1902 | (long) current_gdbarch->register_byte |
1903 | /*REGISTER_BYTE ()*/); | |
4b9b3959 | 1904 | #endif |
08e45a40 | 1905 | #ifdef REGISTER_BYTES |
4b9b3959 | 1906 | fprintf_unfiltered (file, |
08e45a40 AC |
1907 | "gdbarch_dump: REGISTER_BYTES # %s\n", |
1908 | XSTRING (REGISTER_BYTES)); | |
4b9b3959 | 1909 | fprintf_unfiltered (file, |
06b25f14 AC |
1910 | "gdbarch_dump: REGISTER_BYTES = %d\n", |
1911 | REGISTER_BYTES); | |
4b9b3959 | 1912 | #endif |
1e9f55d0 AC |
1913 | #ifdef REGISTER_BYTES_OK_P |
1914 | fprintf_unfiltered (file, | |
1915 | "gdbarch_dump: %s # %s\n", | |
1916 | "REGISTER_BYTES_OK_P()", | |
1917 | XSTRING (REGISTER_BYTES_OK_P ())); | |
1918 | fprintf_unfiltered (file, | |
1919 | "gdbarch_dump: REGISTER_BYTES_OK_P() = %d\n", | |
1920 | REGISTER_BYTES_OK_P ()); | |
1921 | #endif | |
08e45a40 | 1922 | #ifdef REGISTER_BYTES_OK |
4b9b3959 AC |
1923 | fprintf_unfiltered (file, |
1924 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1925 | "REGISTER_BYTES_OK(nr_bytes)", |
1926 | XSTRING (REGISTER_BYTES_OK (nr_bytes))); | |
1927 | if (GDB_MULTI_ARCH) | |
1928 | fprintf_unfiltered (file, | |
6cbda714 | 1929 | "gdbarch_dump: REGISTER_BYTES_OK = <0x%08lx>\n", |
08e45a40 AC |
1930 | (long) current_gdbarch->register_bytes_ok |
1931 | /*REGISTER_BYTES_OK ()*/); | |
4b9b3959 | 1932 | #endif |
08e45a40 | 1933 | #ifdef REGISTER_CONVERTIBLE |
4b9b3959 AC |
1934 | fprintf_unfiltered (file, |
1935 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1936 | "REGISTER_CONVERTIBLE(nr)", |
1937 | XSTRING (REGISTER_CONVERTIBLE (nr))); | |
1938 | if (GDB_MULTI_ARCH) | |
1939 | fprintf_unfiltered (file, | |
6cbda714 | 1940 | "gdbarch_dump: REGISTER_CONVERTIBLE = <0x%08lx>\n", |
08e45a40 AC |
1941 | (long) current_gdbarch->register_convertible |
1942 | /*REGISTER_CONVERTIBLE ()*/); | |
4b9b3959 | 1943 | #endif |
08e45a40 AC |
1944 | #ifdef REGISTER_CONVERT_TO_RAW |
1945 | #if GDB_MULTI_ARCH | |
63e69063 | 1946 | /* Macro might contain `[{}]' when not multi-arch */ |
4b9b3959 AC |
1947 | fprintf_unfiltered (file, |
1948 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1949 | "REGISTER_CONVERT_TO_RAW(type, regnum, from, to)", |
1950 | XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to))); | |
1951 | #endif | |
1952 | if (GDB_MULTI_ARCH) | |
1953 | fprintf_unfiltered (file, | |
6cbda714 | 1954 | "gdbarch_dump: REGISTER_CONVERT_TO_RAW = <0x%08lx>\n", |
08e45a40 AC |
1955 | (long) current_gdbarch->register_convert_to_raw |
1956 | /*REGISTER_CONVERT_TO_RAW ()*/); | |
4b9b3959 | 1957 | #endif |
08e45a40 AC |
1958 | #ifdef REGISTER_CONVERT_TO_VIRTUAL |
1959 | #if GDB_MULTI_ARCH | |
63e69063 | 1960 | /* Macro might contain `[{}]' when not multi-arch */ |
4b9b3959 AC |
1961 | fprintf_unfiltered (file, |
1962 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1963 | "REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)", |
1964 | XSTRING (REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to))); | |
4b9b3959 | 1965 | #endif |
08e45a40 AC |
1966 | if (GDB_MULTI_ARCH) |
1967 | fprintf_unfiltered (file, | |
6cbda714 | 1968 | "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = <0x%08lx>\n", |
08e45a40 AC |
1969 | (long) current_gdbarch->register_convert_to_virtual |
1970 | /*REGISTER_CONVERT_TO_VIRTUAL ()*/); | |
4b9b3959 | 1971 | #endif |
08e45a40 | 1972 | #ifdef REGISTER_NAME |
4b9b3959 AC |
1973 | fprintf_unfiltered (file, |
1974 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1975 | "REGISTER_NAME(regnr)", |
1976 | XSTRING (REGISTER_NAME (regnr))); | |
1977 | if (GDB_MULTI_ARCH) | |
1978 | fprintf_unfiltered (file, | |
6cbda714 | 1979 | "gdbarch_dump: REGISTER_NAME = <0x%08lx>\n", |
08e45a40 AC |
1980 | (long) current_gdbarch->register_name |
1981 | /*REGISTER_NAME ()*/); | |
4b9b3959 | 1982 | #endif |
08e45a40 | 1983 | #ifdef REGISTER_RAW_SIZE |
4b9b3959 AC |
1984 | fprintf_unfiltered (file, |
1985 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1986 | "REGISTER_RAW_SIZE(reg_nr)", |
1987 | XSTRING (REGISTER_RAW_SIZE (reg_nr))); | |
1988 | if (GDB_MULTI_ARCH) | |
1989 | fprintf_unfiltered (file, | |
6cbda714 | 1990 | "gdbarch_dump: REGISTER_RAW_SIZE = <0x%08lx>\n", |
08e45a40 AC |
1991 | (long) current_gdbarch->register_raw_size |
1992 | /*REGISTER_RAW_SIZE ()*/); | |
4b9b3959 | 1993 | #endif |
08e45a40 | 1994 | #ifdef REGISTER_SIM_REGNO |
4b9b3959 AC |
1995 | fprintf_unfiltered (file, |
1996 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1997 | "REGISTER_SIM_REGNO(reg_nr)", |
1998 | XSTRING (REGISTER_SIM_REGNO (reg_nr))); | |
1999 | if (GDB_MULTI_ARCH) | |
2000 | fprintf_unfiltered (file, | |
6cbda714 | 2001 | "gdbarch_dump: REGISTER_SIM_REGNO = <0x%08lx>\n", |
08e45a40 AC |
2002 | (long) current_gdbarch->register_sim_regno |
2003 | /*REGISTER_SIM_REGNO ()*/); | |
4b9b3959 | 2004 | #endif |
08e45a40 | 2005 | #ifdef REGISTER_SIZE |
4b9b3959 | 2006 | fprintf_unfiltered (file, |
08e45a40 AC |
2007 | "gdbarch_dump: REGISTER_SIZE # %s\n", |
2008 | XSTRING (REGISTER_SIZE)); | |
4b9b3959 | 2009 | fprintf_unfiltered (file, |
06b25f14 AC |
2010 | "gdbarch_dump: REGISTER_SIZE = %d\n", |
2011 | REGISTER_SIZE); | |
4b9b3959 | 2012 | #endif |
13d01224 AC |
2013 | #ifdef REGISTER_TO_VALUE |
2014 | #if GDB_MULTI_ARCH | |
2015 | /* Macro might contain `[{}]' when not multi-arch */ | |
2016 | fprintf_unfiltered (file, | |
2017 | "gdbarch_dump: %s # %s\n", | |
2018 | "REGISTER_TO_VALUE(regnum, type, from, to)", | |
2019 | XSTRING (REGISTER_TO_VALUE (regnum, type, from, to))); | |
2020 | #endif | |
2021 | if (GDB_MULTI_ARCH) | |
2022 | fprintf_unfiltered (file, | |
6cbda714 | 2023 | "gdbarch_dump: REGISTER_TO_VALUE = <0x%08lx>\n", |
13d01224 AC |
2024 | (long) current_gdbarch->register_to_value |
2025 | /*REGISTER_TO_VALUE ()*/); | |
2026 | #endif | |
08e45a40 | 2027 | #ifdef REGISTER_VIRTUAL_SIZE |
4b9b3959 | 2028 | fprintf_unfiltered (file, |
08e45a40 AC |
2029 | "gdbarch_dump: %s # %s\n", |
2030 | "REGISTER_VIRTUAL_SIZE(reg_nr)", | |
2031 | XSTRING (REGISTER_VIRTUAL_SIZE (reg_nr))); | |
2032 | if (GDB_MULTI_ARCH) | |
2033 | fprintf_unfiltered (file, | |
6cbda714 | 2034 | "gdbarch_dump: REGISTER_VIRTUAL_SIZE = <0x%08lx>\n", |
08e45a40 AC |
2035 | (long) current_gdbarch->register_virtual_size |
2036 | /*REGISTER_VIRTUAL_SIZE ()*/); | |
4b9b3959 | 2037 | #endif |
08e45a40 | 2038 | #ifdef REGISTER_VIRTUAL_TYPE |
e02bc4cc DS |
2039 | fprintf_unfiltered (file, |
2040 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
2041 | "REGISTER_VIRTUAL_TYPE(reg_nr)", |
2042 | XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr))); | |
2043 | if (GDB_MULTI_ARCH) | |
2044 | fprintf_unfiltered (file, | |
6cbda714 | 2045 | "gdbarch_dump: REGISTER_VIRTUAL_TYPE = <0x%08lx>\n", |
08e45a40 AC |
2046 | (long) current_gdbarch->register_virtual_type |
2047 | /*REGISTER_VIRTUAL_TYPE ()*/); | |
e02bc4cc | 2048 | #endif |
1e9f55d0 AC |
2049 | #ifdef REG_STRUCT_HAS_ADDR_P |
2050 | fprintf_unfiltered (file, | |
2051 | "gdbarch_dump: %s # %s\n", | |
2052 | "REG_STRUCT_HAS_ADDR_P()", | |
2053 | XSTRING (REG_STRUCT_HAS_ADDR_P ())); | |
2054 | fprintf_unfiltered (file, | |
2055 | "gdbarch_dump: REG_STRUCT_HAS_ADDR_P() = %d\n", | |
2056 | REG_STRUCT_HAS_ADDR_P ()); | |
2057 | #endif | |
08e45a40 | 2058 | #ifdef REG_STRUCT_HAS_ADDR |
4b9b3959 | 2059 | fprintf_unfiltered (file, |
08e45a40 AC |
2060 | "gdbarch_dump: %s # %s\n", |
2061 | "REG_STRUCT_HAS_ADDR(gcc_p, type)", | |
2062 | XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type))); | |
2063 | if (GDB_MULTI_ARCH) | |
2064 | fprintf_unfiltered (file, | |
6cbda714 | 2065 | "gdbarch_dump: REG_STRUCT_HAS_ADDR = <0x%08lx>\n", |
08e45a40 AC |
2066 | (long) current_gdbarch->reg_struct_has_addr |
2067 | /*REG_STRUCT_HAS_ADDR ()*/); | |
4b9b3959 | 2068 | #endif |
08e45a40 AC |
2069 | #ifdef REMOTE_TRANSLATE_XFER_ADDRESS |
2070 | #if GDB_MULTI_ARCH | |
63e69063 | 2071 | /* Macro might contain `[{}]' when not multi-arch */ |
4b9b3959 AC |
2072 | fprintf_unfiltered (file, |
2073 | "gdbarch_dump: %s # %s\n", | |
2074 | "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)", | |
2075 | XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len))); | |
2076 | #endif | |
08e45a40 AC |
2077 | if (GDB_MULTI_ARCH) |
2078 | fprintf_unfiltered (file, | |
6cbda714 | 2079 | "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = <0x%08lx>\n", |
08e45a40 AC |
2080 | (long) current_gdbarch->remote_translate_xfer_address |
2081 | /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/); | |
4b9b3959 | 2082 | #endif |
08e45a40 | 2083 | #ifdef RETURN_VALUE_ON_STACK |
4b9b3959 AC |
2084 | fprintf_unfiltered (file, |
2085 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
2086 | "RETURN_VALUE_ON_STACK(type)", |
2087 | XSTRING (RETURN_VALUE_ON_STACK (type))); | |
2088 | if (GDB_MULTI_ARCH) | |
2089 | fprintf_unfiltered (file, | |
6cbda714 | 2090 | "gdbarch_dump: RETURN_VALUE_ON_STACK = <0x%08lx>\n", |
08e45a40 AC |
2091 | (long) current_gdbarch->return_value_on_stack |
2092 | /*RETURN_VALUE_ON_STACK ()*/); | |
4b9b3959 | 2093 | #endif |
08e45a40 | 2094 | #ifdef SAVED_PC_AFTER_CALL |
4b9b3959 AC |
2095 | fprintf_unfiltered (file, |
2096 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
2097 | "SAVED_PC_AFTER_CALL(frame)", |
2098 | XSTRING (SAVED_PC_AFTER_CALL (frame))); | |
2099 | if (GDB_MULTI_ARCH) | |
2100 | fprintf_unfiltered (file, | |
6cbda714 | 2101 | "gdbarch_dump: SAVED_PC_AFTER_CALL = <0x%08lx>\n", |
08e45a40 AC |
2102 | (long) current_gdbarch->saved_pc_after_call |
2103 | /*SAVED_PC_AFTER_CALL ()*/); | |
4b9b3959 | 2104 | #endif |
1e9f55d0 AC |
2105 | #ifdef SAVE_DUMMY_FRAME_TOS_P |
2106 | fprintf_unfiltered (file, | |
2107 | "gdbarch_dump: %s # %s\n", | |
2108 | "SAVE_DUMMY_FRAME_TOS_P()", | |
2109 | XSTRING (SAVE_DUMMY_FRAME_TOS_P ())); | |
2110 | fprintf_unfiltered (file, | |
2111 | "gdbarch_dump: SAVE_DUMMY_FRAME_TOS_P() = %d\n", | |
2112 | SAVE_DUMMY_FRAME_TOS_P ()); | |
2113 | #endif | |
08e45a40 AC |
2114 | #ifdef SAVE_DUMMY_FRAME_TOS |
2115 | #if GDB_MULTI_ARCH | |
2116 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
2117 | fprintf_unfiltered (file, |
2118 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
2119 | "SAVE_DUMMY_FRAME_TOS(sp)", |
2120 | XSTRING (SAVE_DUMMY_FRAME_TOS (sp))); | |
4b9b3959 | 2121 | #endif |
08e45a40 AC |
2122 | if (GDB_MULTI_ARCH) |
2123 | fprintf_unfiltered (file, | |
6cbda714 | 2124 | "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = <0x%08lx>\n", |
08e45a40 AC |
2125 | (long) current_gdbarch->save_dummy_frame_tos |
2126 | /*SAVE_DUMMY_FRAME_TOS ()*/); | |
4b9b3959 | 2127 | #endif |
08e45a40 | 2128 | #ifdef SDB_REG_TO_REGNUM |
4b9b3959 AC |
2129 | fprintf_unfiltered (file, |
2130 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
2131 | "SDB_REG_TO_REGNUM(sdb_regnr)", |
2132 | XSTRING (SDB_REG_TO_REGNUM (sdb_regnr))); | |
2133 | if (GDB_MULTI_ARCH) | |
2134 | fprintf_unfiltered (file, | |
6cbda714 | 2135 | "gdbarch_dump: SDB_REG_TO_REGNUM = <0x%08lx>\n", |
08e45a40 AC |
2136 | (long) current_gdbarch->sdb_reg_to_regnum |
2137 | /*SDB_REG_TO_REGNUM ()*/); | |
4b9b3959 | 2138 | #endif |
1e9f55d0 AC |
2139 | #ifdef SIGTRAMP_END_P |
2140 | fprintf_unfiltered (file, | |
2141 | "gdbarch_dump: %s # %s\n", | |
2142 | "SIGTRAMP_END_P()", | |
2143 | XSTRING (SIGTRAMP_END_P ())); | |
2144 | fprintf_unfiltered (file, | |
2145 | "gdbarch_dump: SIGTRAMP_END_P() = %d\n", | |
2146 | SIGTRAMP_END_P ()); | |
2147 | #endif | |
43156d82 MK |
2148 | #ifdef SIGTRAMP_END |
2149 | fprintf_unfiltered (file, | |
2150 | "gdbarch_dump: %s # %s\n", | |
2151 | "SIGTRAMP_END(pc)", | |
2152 | XSTRING (SIGTRAMP_END (pc))); | |
2153 | if (GDB_MULTI_ARCH) | |
2154 | fprintf_unfiltered (file, | |
6cbda714 | 2155 | "gdbarch_dump: SIGTRAMP_END = <0x%08lx>\n", |
43156d82 MK |
2156 | (long) current_gdbarch->sigtramp_end |
2157 | /*SIGTRAMP_END ()*/); | |
2158 | #endif | |
1e9f55d0 AC |
2159 | #ifdef SIGTRAMP_START_P |
2160 | fprintf_unfiltered (file, | |
2161 | "gdbarch_dump: %s # %s\n", | |
2162 | "SIGTRAMP_START_P()", | |
2163 | XSTRING (SIGTRAMP_START_P ())); | |
2164 | fprintf_unfiltered (file, | |
2165 | "gdbarch_dump: SIGTRAMP_START_P() = %d\n", | |
2166 | SIGTRAMP_START_P ()); | |
2167 | #endif | |
43156d82 MK |
2168 | #ifdef SIGTRAMP_START |
2169 | fprintf_unfiltered (file, | |
2170 | "gdbarch_dump: %s # %s\n", | |
2171 | "SIGTRAMP_START(pc)", | |
2172 | XSTRING (SIGTRAMP_START (pc))); | |
2173 | if (GDB_MULTI_ARCH) | |
2174 | fprintf_unfiltered (file, | |
6cbda714 | 2175 | "gdbarch_dump: SIGTRAMP_START = <0x%08lx>\n", |
43156d82 MK |
2176 | (long) current_gdbarch->sigtramp_start |
2177 | /*SIGTRAMP_START ()*/); | |
2178 | #endif | |
08e45a40 | 2179 | #ifdef SIZEOF_CALL_DUMMY_WORDS |
4b9b3959 | 2180 | fprintf_unfiltered (file, |
08e45a40 AC |
2181 | "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n", |
2182 | XSTRING (SIZEOF_CALL_DUMMY_WORDS)); | |
2183 | fprintf_unfiltered (file, | |
2184 | "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n", | |
2185 | (long) SIZEOF_CALL_DUMMY_WORDS); | |
4b9b3959 | 2186 | #endif |
08e45a40 | 2187 | #ifdef SKIP_PROLOGUE |
4b9b3959 AC |
2188 | fprintf_unfiltered (file, |
2189 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
2190 | "SKIP_PROLOGUE(ip)", |
2191 | XSTRING (SKIP_PROLOGUE (ip))); | |
2192 | if (GDB_MULTI_ARCH) | |
2193 | fprintf_unfiltered (file, | |
6cbda714 | 2194 | "gdbarch_dump: SKIP_PROLOGUE = <0x%08lx>\n", |
08e45a40 AC |
2195 | (long) current_gdbarch->skip_prologue |
2196 | /*SKIP_PROLOGUE ()*/); | |
4b9b3959 | 2197 | #endif |
08e45a40 | 2198 | #ifdef SKIP_TRAMPOLINE_CODE |
4b9b3959 AC |
2199 | fprintf_unfiltered (file, |
2200 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
2201 | "SKIP_TRAMPOLINE_CODE(pc)", |
2202 | XSTRING (SKIP_TRAMPOLINE_CODE (pc))); | |
2203 | if (GDB_MULTI_ARCH) | |
2204 | fprintf_unfiltered (file, | |
6cbda714 | 2205 | "gdbarch_dump: SKIP_TRAMPOLINE_CODE = <0x%08lx>\n", |
08e45a40 AC |
2206 | (long) current_gdbarch->skip_trampoline_code |
2207 | /*SKIP_TRAMPOLINE_CODE ()*/); | |
4b9b3959 | 2208 | #endif |
181c1381 RE |
2209 | #ifdef SMASH_TEXT_ADDRESS |
2210 | fprintf_unfiltered (file, | |
2211 | "gdbarch_dump: %s # %s\n", | |
2212 | "SMASH_TEXT_ADDRESS(addr)", | |
2213 | XSTRING (SMASH_TEXT_ADDRESS (addr))); | |
2214 | if (GDB_MULTI_ARCH) | |
2215 | fprintf_unfiltered (file, | |
6cbda714 | 2216 | "gdbarch_dump: SMASH_TEXT_ADDRESS = <0x%08lx>\n", |
181c1381 RE |
2217 | (long) current_gdbarch->smash_text_address |
2218 | /*SMASH_TEXT_ADDRESS ()*/); | |
2219 | #endif | |
1e9f55d0 AC |
2220 | #ifdef SOFTWARE_SINGLE_STEP_P |
2221 | fprintf_unfiltered (file, | |
2222 | "gdbarch_dump: %s # %s\n", | |
2223 | "SOFTWARE_SINGLE_STEP_P()", | |
2224 | XSTRING (SOFTWARE_SINGLE_STEP_P ())); | |
2225 | fprintf_unfiltered (file, | |
2226 | "gdbarch_dump: SOFTWARE_SINGLE_STEP_P() = %d\n", | |
2227 | SOFTWARE_SINGLE_STEP_P ()); | |
2228 | #endif | |
08e45a40 AC |
2229 | #ifdef SOFTWARE_SINGLE_STEP |
2230 | #if GDB_MULTI_ARCH | |
2231 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
2232 | fprintf_unfiltered (file, |
2233 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
2234 | "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)", |
2235 | XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p))); | |
4b9b3959 | 2236 | #endif |
08e45a40 AC |
2237 | if (GDB_MULTI_ARCH) |
2238 | fprintf_unfiltered (file, | |
6cbda714 | 2239 | "gdbarch_dump: SOFTWARE_SINGLE_STEP = <0x%08lx>\n", |
08e45a40 AC |
2240 | (long) current_gdbarch->software_single_step |
2241 | /*SOFTWARE_SINGLE_STEP ()*/); | |
2242 | #endif | |
2243 | #ifdef SP_REGNUM | |
1dd4193b | 2244 | fprintf_unfiltered (file, |
08e45a40 AC |
2245 | "gdbarch_dump: SP_REGNUM # %s\n", |
2246 | XSTRING (SP_REGNUM)); | |
2247 | fprintf_unfiltered (file, | |
06b25f14 AC |
2248 | "gdbarch_dump: SP_REGNUM = %d\n", |
2249 | SP_REGNUM); | |
1dd4193b | 2250 | #endif |
08e45a40 | 2251 | #ifdef STAB_REG_TO_REGNUM |
4b9b3959 AC |
2252 | fprintf_unfiltered (file, |
2253 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
2254 | "STAB_REG_TO_REGNUM(stab_regnr)", |
2255 | XSTRING (STAB_REG_TO_REGNUM (stab_regnr))); | |
2256 | if (GDB_MULTI_ARCH) | |
2257 | fprintf_unfiltered (file, | |
6cbda714 | 2258 | "gdbarch_dump: STAB_REG_TO_REGNUM = <0x%08lx>\n", |
08e45a40 AC |
2259 | (long) current_gdbarch->stab_reg_to_regnum |
2260 | /*STAB_REG_TO_REGNUM ()*/); | |
4b9b3959 | 2261 | #endif |
1e9f55d0 AC |
2262 | #ifdef STACK_ALIGN_P |
2263 | fprintf_unfiltered (file, | |
2264 | "gdbarch_dump: %s # %s\n", | |
2265 | "STACK_ALIGN_P()", | |
2266 | XSTRING (STACK_ALIGN_P ())); | |
2267 | fprintf_unfiltered (file, | |
2268 | "gdbarch_dump: STACK_ALIGN_P() = %d\n", | |
2269 | STACK_ALIGN_P ()); | |
2270 | #endif | |
08e45a40 | 2271 | #ifdef STACK_ALIGN |
4b9b3959 AC |
2272 | fprintf_unfiltered (file, |
2273 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
2274 | "STACK_ALIGN(sp)", |
2275 | XSTRING (STACK_ALIGN (sp))); | |
2276 | if (GDB_MULTI_ARCH) | |
2277 | fprintf_unfiltered (file, | |
6cbda714 | 2278 | "gdbarch_dump: STACK_ALIGN = <0x%08lx>\n", |
08e45a40 AC |
2279 | (long) current_gdbarch->stack_align |
2280 | /*STACK_ALIGN ()*/); | |
4b9b3959 | 2281 | #endif |
08e45a40 AC |
2282 | #ifdef STORE_RETURN_VALUE |
2283 | #if GDB_MULTI_ARCH | |
2284 | /* Macro might contain `[{}]' when not multi-arch */ | |
f517ea4e PS |
2285 | fprintf_unfiltered (file, |
2286 | "gdbarch_dump: %s # %s\n", | |
ebba8386 AC |
2287 | "STORE_RETURN_VALUE(type, regcache, valbuf)", |
2288 | XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf))); | |
f517ea4e | 2289 | #endif |
08e45a40 AC |
2290 | if (GDB_MULTI_ARCH) |
2291 | fprintf_unfiltered (file, | |
6cbda714 | 2292 | "gdbarch_dump: STORE_RETURN_VALUE = <0x%08lx>\n", |
08e45a40 AC |
2293 | (long) current_gdbarch->store_return_value |
2294 | /*STORE_RETURN_VALUE ()*/); | |
875e1767 | 2295 | #endif |
08e45a40 AC |
2296 | #ifdef STORE_STRUCT_RETURN |
2297 | #if GDB_MULTI_ARCH | |
64c4637f AC |
2298 | /* Macro might contain `[{}]' when not multi-arch */ |
2299 | fprintf_unfiltered (file, | |
2300 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
2301 | "STORE_STRUCT_RETURN(addr, sp)", |
2302 | XSTRING (STORE_STRUCT_RETURN (addr, sp))); | |
64c4637f | 2303 | #endif |
08e45a40 AC |
2304 | if (GDB_MULTI_ARCH) |
2305 | fprintf_unfiltered (file, | |
6cbda714 | 2306 | "gdbarch_dump: STORE_STRUCT_RETURN = <0x%08lx>\n", |
08e45a40 AC |
2307 | (long) current_gdbarch->store_struct_return |
2308 | /*STORE_STRUCT_RETURN ()*/); | |
2bf0cb65 | 2309 | #endif |
08e45a40 | 2310 | #ifdef TARGET_ADDR_BIT |
bdcd319a | 2311 | fprintf_unfiltered (file, |
08e45a40 AC |
2312 | "gdbarch_dump: TARGET_ADDR_BIT # %s\n", |
2313 | XSTRING (TARGET_ADDR_BIT)); | |
2314 | fprintf_unfiltered (file, | |
06b25f14 AC |
2315 | "gdbarch_dump: TARGET_ADDR_BIT = %d\n", |
2316 | TARGET_ADDR_BIT); | |
bdcd319a | 2317 | #endif |
381323f4 | 2318 | #ifdef TARGET_ARCHITECTURE |
08e45a40 AC |
2319 | fprintf_unfiltered (file, |
2320 | "gdbarch_dump: TARGET_ARCHITECTURE # %s\n", | |
2321 | XSTRING (TARGET_ARCHITECTURE)); | |
0f71a2f6 | 2322 | if (TARGET_ARCHITECTURE != NULL) |
4b9b3959 AC |
2323 | fprintf_unfiltered (file, |
2324 | "gdbarch_dump: TARGET_ARCHITECTURE = %s\n", | |
adf40b2e | 2325 | TARGET_ARCHITECTURE->printable_name); |
381323f4 | 2326 | #endif |
08e45a40 AC |
2327 | #ifdef TARGET_BFD_VMA_BIT |
2328 | fprintf_unfiltered (file, | |
2329 | "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n", | |
2330 | XSTRING (TARGET_BFD_VMA_BIT)); | |
2331 | fprintf_unfiltered (file, | |
06b25f14 AC |
2332 | "gdbarch_dump: TARGET_BFD_VMA_BIT = %d\n", |
2333 | TARGET_BFD_VMA_BIT); | |
08e45a40 | 2334 | #endif |
381323f4 | 2335 | #ifdef TARGET_BYTE_ORDER |
08e45a40 AC |
2336 | fprintf_unfiltered (file, |
2337 | "gdbarch_dump: TARGET_BYTE_ORDER # %s\n", | |
2338 | XSTRING (TARGET_BYTE_ORDER)); | |
4b9b3959 AC |
2339 | fprintf_unfiltered (file, |
2340 | "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n", | |
adf40b2e | 2341 | (long) TARGET_BYTE_ORDER); |
381323f4 | 2342 | #endif |
4e409299 JB |
2343 | #ifdef TARGET_CHAR_SIGNED |
2344 | fprintf_unfiltered (file, | |
2345 | "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n", | |
2346 | XSTRING (TARGET_CHAR_SIGNED)); | |
2347 | fprintf_unfiltered (file, | |
06b25f14 AC |
2348 | "gdbarch_dump: TARGET_CHAR_SIGNED = %d\n", |
2349 | TARGET_CHAR_SIGNED); | |
4e409299 | 2350 | #endif |
08e45a40 | 2351 | #ifdef TARGET_DOUBLE_BIT |
4b9b3959 | 2352 | fprintf_unfiltered (file, |
08e45a40 AC |
2353 | "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n", |
2354 | XSTRING (TARGET_DOUBLE_BIT)); | |
4b9b3959 | 2355 | fprintf_unfiltered (file, |
06b25f14 AC |
2356 | "gdbarch_dump: TARGET_DOUBLE_BIT = %d\n", |
2357 | TARGET_DOUBLE_BIT); | |
381323f4 | 2358 | #endif |
08e45a40 | 2359 | #ifdef TARGET_DOUBLE_FORMAT |
4b9b3959 | 2360 | fprintf_unfiltered (file, |
08e45a40 AC |
2361 | "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n", |
2362 | XSTRING (TARGET_DOUBLE_FORMAT)); | |
4b9b3959 | 2363 | fprintf_unfiltered (file, |
f09cffaa | 2364 | "gdbarch_dump: TARGET_DOUBLE_FORMAT = %s\n", |
52f87c51 | 2365 | (TARGET_DOUBLE_FORMAT)->name); |
381323f4 AC |
2366 | #endif |
2367 | #ifdef TARGET_FLOAT_BIT | |
08e45a40 AC |
2368 | fprintf_unfiltered (file, |
2369 | "gdbarch_dump: TARGET_FLOAT_BIT # %s\n", | |
2370 | XSTRING (TARGET_FLOAT_BIT)); | |
4b9b3959 | 2371 | fprintf_unfiltered (file, |
06b25f14 AC |
2372 | "gdbarch_dump: TARGET_FLOAT_BIT = %d\n", |
2373 | TARGET_FLOAT_BIT); | |
381323f4 | 2374 | #endif |
08e45a40 | 2375 | #ifdef TARGET_FLOAT_FORMAT |
4b9b3959 | 2376 | fprintf_unfiltered (file, |
08e45a40 AC |
2377 | "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n", |
2378 | XSTRING (TARGET_FLOAT_FORMAT)); | |
2379 | fprintf_unfiltered (file, | |
f09cffaa | 2380 | "gdbarch_dump: TARGET_FLOAT_FORMAT = %s\n", |
52f87c51 | 2381 | (TARGET_FLOAT_FORMAT)->name); |
08e45a40 AC |
2382 | #endif |
2383 | #ifdef TARGET_INT_BIT | |
2384 | fprintf_unfiltered (file, | |
2385 | "gdbarch_dump: TARGET_INT_BIT # %s\n", | |
2386 | XSTRING (TARGET_INT_BIT)); | |
2387 | fprintf_unfiltered (file, | |
06b25f14 AC |
2388 | "gdbarch_dump: TARGET_INT_BIT = %d\n", |
2389 | TARGET_INT_BIT); | |
08e45a40 AC |
2390 | #endif |
2391 | #ifdef TARGET_LONG_BIT | |
2392 | fprintf_unfiltered (file, | |
2393 | "gdbarch_dump: TARGET_LONG_BIT # %s\n", | |
2394 | XSTRING (TARGET_LONG_BIT)); | |
2395 | fprintf_unfiltered (file, | |
06b25f14 AC |
2396 | "gdbarch_dump: TARGET_LONG_BIT = %d\n", |
2397 | TARGET_LONG_BIT); | |
381323f4 AC |
2398 | #endif |
2399 | #ifdef TARGET_LONG_DOUBLE_BIT | |
08e45a40 AC |
2400 | fprintf_unfiltered (file, |
2401 | "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n", | |
2402 | XSTRING (TARGET_LONG_DOUBLE_BIT)); | |
4b9b3959 | 2403 | fprintf_unfiltered (file, |
06b25f14 AC |
2404 | "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %d\n", |
2405 | TARGET_LONG_DOUBLE_BIT); | |
381323f4 | 2406 | #endif |
08e45a40 | 2407 | #ifdef TARGET_LONG_DOUBLE_FORMAT |
66b43ecb | 2408 | fprintf_unfiltered (file, |
08e45a40 AC |
2409 | "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n", |
2410 | XSTRING (TARGET_LONG_DOUBLE_FORMAT)); | |
52204a0b | 2411 | fprintf_unfiltered (file, |
f09cffaa | 2412 | "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %s\n", |
52f87c51 | 2413 | (TARGET_LONG_DOUBLE_FORMAT)->name); |
52204a0b | 2414 | #endif |
08e45a40 | 2415 | #ifdef TARGET_LONG_LONG_BIT |
66b43ecb | 2416 | fprintf_unfiltered (file, |
08e45a40 AC |
2417 | "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n", |
2418 | XSTRING (TARGET_LONG_LONG_BIT)); | |
4b9b3959 | 2419 | fprintf_unfiltered (file, |
06b25f14 AC |
2420 | "gdbarch_dump: TARGET_LONG_LONG_BIT = %d\n", |
2421 | TARGET_LONG_LONG_BIT); | |
381323f4 | 2422 | #endif |
4be87837 DJ |
2423 | #ifdef TARGET_OSABI |
2424 | fprintf_unfiltered (file, | |
2425 | "gdbarch_dump: TARGET_OSABI # %s\n", | |
2426 | XSTRING (TARGET_OSABI)); | |
2427 | fprintf_unfiltered (file, | |
2428 | "gdbarch_dump: TARGET_OSABI = %ld\n", | |
2429 | (long) TARGET_OSABI); | |
2430 | #endif | |
08e45a40 AC |
2431 | #ifdef TARGET_PRINT_INSN |
2432 | fprintf_unfiltered (file, | |
2433 | "gdbarch_dump: %s # %s\n", | |
2434 | "TARGET_PRINT_INSN(vma, info)", | |
2435 | XSTRING (TARGET_PRINT_INSN (vma, info))); | |
4b9b3959 AC |
2436 | if (GDB_MULTI_ARCH) |
2437 | fprintf_unfiltered (file, | |
6cbda714 | 2438 | "gdbarch_dump: TARGET_PRINT_INSN = <0x%08lx>\n", |
08e45a40 AC |
2439 | (long) current_gdbarch->print_insn |
2440 | /*TARGET_PRINT_INSN ()*/); | |
381323f4 | 2441 | #endif |
08e45a40 AC |
2442 | #ifdef TARGET_PTR_BIT |
2443 | fprintf_unfiltered (file, | |
2444 | "gdbarch_dump: TARGET_PTR_BIT # %s\n", | |
2445 | XSTRING (TARGET_PTR_BIT)); | |
2446 | fprintf_unfiltered (file, | |
06b25f14 AC |
2447 | "gdbarch_dump: TARGET_PTR_BIT = %d\n", |
2448 | TARGET_PTR_BIT); | |
381323f4 AC |
2449 | #endif |
2450 | #ifdef TARGET_READ_FP | |
08e45a40 AC |
2451 | fprintf_unfiltered (file, |
2452 | "gdbarch_dump: %s # %s\n", | |
2453 | "TARGET_READ_FP()", | |
2454 | XSTRING (TARGET_READ_FP ())); | |
4b9b3959 AC |
2455 | if (GDB_MULTI_ARCH) |
2456 | fprintf_unfiltered (file, | |
6cbda714 | 2457 | "gdbarch_dump: TARGET_READ_FP = <0x%08lx>\n", |
4b9b3959 AC |
2458 | (long) current_gdbarch->read_fp |
2459 | /*TARGET_READ_FP ()*/); | |
381323f4 | 2460 | #endif |
08e45a40 AC |
2461 | #ifdef TARGET_READ_PC |
2462 | fprintf_unfiltered (file, | |
2463 | "gdbarch_dump: %s # %s\n", | |
2464 | "TARGET_READ_PC(ptid)", | |
2465 | XSTRING (TARGET_READ_PC (ptid))); | |
4b9b3959 AC |
2466 | if (GDB_MULTI_ARCH) |
2467 | fprintf_unfiltered (file, | |
6cbda714 | 2468 | "gdbarch_dump: TARGET_READ_PC = <0x%08lx>\n", |
08e45a40 AC |
2469 | (long) current_gdbarch->read_pc |
2470 | /*TARGET_READ_PC ()*/); | |
381323f4 AC |
2471 | #endif |
2472 | #ifdef TARGET_READ_SP | |
08e45a40 AC |
2473 | fprintf_unfiltered (file, |
2474 | "gdbarch_dump: %s # %s\n", | |
2475 | "TARGET_READ_SP()", | |
2476 | XSTRING (TARGET_READ_SP ())); | |
4b9b3959 AC |
2477 | if (GDB_MULTI_ARCH) |
2478 | fprintf_unfiltered (file, | |
6cbda714 | 2479 | "gdbarch_dump: TARGET_READ_SP = <0x%08lx>\n", |
4b9b3959 AC |
2480 | (long) current_gdbarch->read_sp |
2481 | /*TARGET_READ_SP ()*/); | |
381323f4 | 2482 | #endif |
08e45a40 AC |
2483 | #ifdef TARGET_SHORT_BIT |
2484 | fprintf_unfiltered (file, | |
2485 | "gdbarch_dump: TARGET_SHORT_BIT # %s\n", | |
2486 | XSTRING (TARGET_SHORT_BIT)); | |
2487 | fprintf_unfiltered (file, | |
06b25f14 AC |
2488 | "gdbarch_dump: TARGET_SHORT_BIT = %d\n", |
2489 | TARGET_SHORT_BIT); | |
39d4ef09 AC |
2490 | #endif |
2491 | #ifdef TARGET_VIRTUAL_FRAME_POINTER | |
08e45a40 AC |
2492 | #if GDB_MULTI_ARCH |
2493 | /* Macro might contain `[{}]' when not multi-arch */ | |
2494 | fprintf_unfiltered (file, | |
2495 | "gdbarch_dump: %s # %s\n", | |
2496 | "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)", | |
2497 | XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset))); | |
2498 | #endif | |
39d4ef09 AC |
2499 | if (GDB_MULTI_ARCH) |
2500 | fprintf_unfiltered (file, | |
6cbda714 | 2501 | "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = <0x%08lx>\n", |
39d4ef09 AC |
2502 | (long) current_gdbarch->virtual_frame_pointer |
2503 | /*TARGET_VIRTUAL_FRAME_POINTER ()*/); | |
381323f4 | 2504 | #endif |
08e45a40 AC |
2505 | #ifdef TARGET_WRITE_PC |
2506 | #if GDB_MULTI_ARCH | |
2507 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 | 2508 | fprintf_unfiltered (file, |
08e45a40 AC |
2509 | "gdbarch_dump: %s # %s\n", |
2510 | "TARGET_WRITE_PC(val, ptid)", | |
2511 | XSTRING (TARGET_WRITE_PC (val, ptid))); | |
381323f4 | 2512 | #endif |
4b9b3959 AC |
2513 | if (GDB_MULTI_ARCH) |
2514 | fprintf_unfiltered (file, | |
6cbda714 | 2515 | "gdbarch_dump: TARGET_WRITE_PC = <0x%08lx>\n", |
08e45a40 AC |
2516 | (long) current_gdbarch->write_pc |
2517 | /*TARGET_WRITE_PC ()*/); | |
381323f4 | 2518 | #endif |
08e45a40 AC |
2519 | #ifdef TARGET_WRITE_SP |
2520 | #if GDB_MULTI_ARCH | |
2521 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 | 2522 | fprintf_unfiltered (file, |
08e45a40 AC |
2523 | "gdbarch_dump: %s # %s\n", |
2524 | "TARGET_WRITE_SP(val)", | |
2525 | XSTRING (TARGET_WRITE_SP (val))); | |
01fb7433 | 2526 | #endif |
01fb7433 AC |
2527 | if (GDB_MULTI_ARCH) |
2528 | fprintf_unfiltered (file, | |
6cbda714 | 2529 | "gdbarch_dump: TARGET_WRITE_SP = <0x%08lx>\n", |
08e45a40 AC |
2530 | (long) current_gdbarch->write_sp |
2531 | /*TARGET_WRITE_SP ()*/); | |
01fb7433 | 2532 | #endif |
08e45a40 | 2533 | #ifdef USE_STRUCT_CONVENTION |
4b9b3959 | 2534 | fprintf_unfiltered (file, |
08e45a40 AC |
2535 | "gdbarch_dump: %s # %s\n", |
2536 | "USE_STRUCT_CONVENTION(gcc_p, value_type)", | |
2537 | XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type))); | |
4b9b3959 AC |
2538 | if (GDB_MULTI_ARCH) |
2539 | fprintf_unfiltered (file, | |
6cbda714 | 2540 | "gdbarch_dump: USE_STRUCT_CONVENTION = <0x%08lx>\n", |
4b9b3959 AC |
2541 | (long) current_gdbarch->use_struct_convention |
2542 | /*USE_STRUCT_CONVENTION ()*/); | |
13d01224 AC |
2543 | #endif |
2544 | #ifdef VALUE_TO_REGISTER | |
2545 | #if GDB_MULTI_ARCH | |
2546 | /* Macro might contain `[{}]' when not multi-arch */ | |
2547 | fprintf_unfiltered (file, | |
2548 | "gdbarch_dump: %s # %s\n", | |
2549 | "VALUE_TO_REGISTER(type, regnum, from, to)", | |
2550 | XSTRING (VALUE_TO_REGISTER (type, regnum, from, to))); | |
2551 | #endif | |
2552 | if (GDB_MULTI_ARCH) | |
2553 | fprintf_unfiltered (file, | |
6cbda714 | 2554 | "gdbarch_dump: VALUE_TO_REGISTER = <0x%08lx>\n", |
13d01224 AC |
2555 | (long) current_gdbarch->value_to_register |
2556 | /*VALUE_TO_REGISTER ()*/); | |
381323f4 | 2557 | #endif |
4b9b3959 AC |
2558 | if (current_gdbarch->dump_tdep != NULL) |
2559 | current_gdbarch->dump_tdep (current_gdbarch, file); | |
0f71a2f6 JM |
2560 | } |
2561 | ||
2562 | struct gdbarch_tdep * | |
104c1213 | 2563 | gdbarch_tdep (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2564 | { |
2565 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
2566 | fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n"); |
2567 | return gdbarch->tdep; | |
2568 | } | |
2569 | ||
2570 | ||
2571 | const struct bfd_arch_info * | |
104c1213 | 2572 | gdbarch_bfd_arch_info (struct gdbarch *gdbarch) |
0f71a2f6 | 2573 | { |
8de9bdc4 | 2574 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 2575 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2576 | fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n"); |
2577 | return gdbarch->bfd_arch_info; | |
2578 | } | |
2579 | ||
2580 | int | |
104c1213 | 2581 | gdbarch_byte_order (struct gdbarch *gdbarch) |
0f71a2f6 | 2582 | { |
8de9bdc4 | 2583 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 2584 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2585 | fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n"); |
2586 | return gdbarch->byte_order; | |
2587 | } | |
2588 | ||
4be87837 DJ |
2589 | enum gdb_osabi |
2590 | gdbarch_osabi (struct gdbarch *gdbarch) | |
2591 | { | |
2592 | gdb_assert (gdbarch != NULL); | |
2593 | if (gdbarch_debug >= 2) | |
2594 | fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n"); | |
2595 | return gdbarch->osabi; | |
2596 | } | |
2597 | ||
0f71a2f6 | 2598 | int |
104c1213 | 2599 | gdbarch_short_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2600 | { |
8de9bdc4 | 2601 | gdb_assert (gdbarch != NULL); |
66b43ecb | 2602 | /* Skip verify of short_bit, invalid_p == 0 */ |
0f71a2f6 | 2603 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2604 | fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n"); |
2605 | return gdbarch->short_bit; | |
2606 | } | |
2607 | ||
2608 | void | |
104c1213 JM |
2609 | set_gdbarch_short_bit (struct gdbarch *gdbarch, |
2610 | int short_bit) | |
0f71a2f6 JM |
2611 | { |
2612 | gdbarch->short_bit = short_bit; | |
2613 | } | |
2614 | ||
2615 | int | |
104c1213 | 2616 | gdbarch_int_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2617 | { |
8de9bdc4 | 2618 | gdb_assert (gdbarch != NULL); |
66b43ecb | 2619 | /* Skip verify of int_bit, invalid_p == 0 */ |
0f71a2f6 | 2620 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2621 | fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n"); |
2622 | return gdbarch->int_bit; | |
2623 | } | |
2624 | ||
2625 | void | |
104c1213 JM |
2626 | set_gdbarch_int_bit (struct gdbarch *gdbarch, |
2627 | int int_bit) | |
0f71a2f6 JM |
2628 | { |
2629 | gdbarch->int_bit = int_bit; | |
2630 | } | |
2631 | ||
2632 | int | |
104c1213 | 2633 | gdbarch_long_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2634 | { |
8de9bdc4 | 2635 | gdb_assert (gdbarch != NULL); |
66b43ecb | 2636 | /* Skip verify of long_bit, invalid_p == 0 */ |
0f71a2f6 | 2637 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2638 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n"); |
2639 | return gdbarch->long_bit; | |
2640 | } | |
2641 | ||
2642 | void | |
104c1213 JM |
2643 | set_gdbarch_long_bit (struct gdbarch *gdbarch, |
2644 | int long_bit) | |
0f71a2f6 JM |
2645 | { |
2646 | gdbarch->long_bit = long_bit; | |
2647 | } | |
2648 | ||
2649 | int | |
104c1213 | 2650 | gdbarch_long_long_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2651 | { |
8de9bdc4 | 2652 | gdb_assert (gdbarch != NULL); |
66b43ecb | 2653 | /* Skip verify of long_long_bit, invalid_p == 0 */ |
0f71a2f6 | 2654 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2655 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n"); |
2656 | return gdbarch->long_long_bit; | |
2657 | } | |
2658 | ||
2659 | void | |
104c1213 JM |
2660 | set_gdbarch_long_long_bit (struct gdbarch *gdbarch, |
2661 | int long_long_bit) | |
0f71a2f6 JM |
2662 | { |
2663 | gdbarch->long_long_bit = long_long_bit; | |
2664 | } | |
2665 | ||
2666 | int | |
104c1213 | 2667 | gdbarch_float_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2668 | { |
8de9bdc4 | 2669 | gdb_assert (gdbarch != NULL); |
66b43ecb | 2670 | /* Skip verify of float_bit, invalid_p == 0 */ |
0f71a2f6 | 2671 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2672 | fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n"); |
2673 | return gdbarch->float_bit; | |
2674 | } | |
2675 | ||
2676 | void | |
104c1213 JM |
2677 | set_gdbarch_float_bit (struct gdbarch *gdbarch, |
2678 | int float_bit) | |
0f71a2f6 JM |
2679 | { |
2680 | gdbarch->float_bit = float_bit; | |
2681 | } | |
2682 | ||
2683 | int | |
104c1213 | 2684 | gdbarch_double_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2685 | { |
8de9bdc4 | 2686 | gdb_assert (gdbarch != NULL); |
66b43ecb | 2687 | /* Skip verify of double_bit, invalid_p == 0 */ |
0f71a2f6 | 2688 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2689 | fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n"); |
2690 | return gdbarch->double_bit; | |
2691 | } | |
2692 | ||
2693 | void | |
104c1213 JM |
2694 | set_gdbarch_double_bit (struct gdbarch *gdbarch, |
2695 | int double_bit) | |
0f71a2f6 JM |
2696 | { |
2697 | gdbarch->double_bit = double_bit; | |
2698 | } | |
2699 | ||
2700 | int | |
104c1213 | 2701 | gdbarch_long_double_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2702 | { |
8de9bdc4 | 2703 | gdb_assert (gdbarch != NULL); |
66b43ecb | 2704 | /* Skip verify of long_double_bit, invalid_p == 0 */ |
0f71a2f6 | 2705 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2706 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n"); |
2707 | return gdbarch->long_double_bit; | |
2708 | } | |
2709 | ||
2710 | void | |
104c1213 JM |
2711 | set_gdbarch_long_double_bit (struct gdbarch *gdbarch, |
2712 | int long_double_bit) | |
0f71a2f6 JM |
2713 | { |
2714 | gdbarch->long_double_bit = long_double_bit; | |
2715 | } | |
2716 | ||
66b43ecb AC |
2717 | int |
2718 | gdbarch_ptr_bit (struct gdbarch *gdbarch) | |
2719 | { | |
8de9bdc4 | 2720 | gdb_assert (gdbarch != NULL); |
66b43ecb AC |
2721 | /* Skip verify of ptr_bit, invalid_p == 0 */ |
2722 | if (gdbarch_debug >= 2) | |
2723 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n"); | |
2724 | return gdbarch->ptr_bit; | |
2725 | } | |
2726 | ||
2727 | void | |
2728 | set_gdbarch_ptr_bit (struct gdbarch *gdbarch, | |
2729 | int ptr_bit) | |
2730 | { | |
2731 | gdbarch->ptr_bit = ptr_bit; | |
2732 | } | |
2733 | ||
52204a0b DT |
2734 | int |
2735 | gdbarch_addr_bit (struct gdbarch *gdbarch) | |
2736 | { | |
8de9bdc4 | 2737 | gdb_assert (gdbarch != NULL); |
52204a0b | 2738 | if (gdbarch->addr_bit == 0) |
8e65ff28 AC |
2739 | internal_error (__FILE__, __LINE__, |
2740 | "gdbarch: gdbarch_addr_bit invalid"); | |
52204a0b DT |
2741 | if (gdbarch_debug >= 2) |
2742 | fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n"); | |
2743 | return gdbarch->addr_bit; | |
2744 | } | |
2745 | ||
2746 | void | |
2747 | set_gdbarch_addr_bit (struct gdbarch *gdbarch, | |
2748 | int addr_bit) | |
2749 | { | |
2750 | gdbarch->addr_bit = addr_bit; | |
2751 | } | |
2752 | ||
66b43ecb AC |
2753 | int |
2754 | gdbarch_bfd_vma_bit (struct gdbarch *gdbarch) | |
2755 | { | |
8de9bdc4 | 2756 | gdb_assert (gdbarch != NULL); |
66b43ecb AC |
2757 | /* Skip verify of bfd_vma_bit, invalid_p == 0 */ |
2758 | if (gdbarch_debug >= 2) | |
2759 | fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n"); | |
2760 | return gdbarch->bfd_vma_bit; | |
2761 | } | |
2762 | ||
2763 | void | |
2764 | set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, | |
2765 | int bfd_vma_bit) | |
2766 | { | |
2767 | gdbarch->bfd_vma_bit = bfd_vma_bit; | |
2768 | } | |
2769 | ||
4e409299 JB |
2770 | int |
2771 | gdbarch_char_signed (struct gdbarch *gdbarch) | |
2772 | { | |
8de9bdc4 | 2773 | gdb_assert (gdbarch != NULL); |
4e409299 JB |
2774 | if (gdbarch->char_signed == -1) |
2775 | internal_error (__FILE__, __LINE__, | |
2776 | "gdbarch: gdbarch_char_signed invalid"); | |
2777 | if (gdbarch_debug >= 2) | |
2778 | fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n"); | |
2779 | return gdbarch->char_signed; | |
2780 | } | |
2781 | ||
2782 | void | |
2783 | set_gdbarch_char_signed (struct gdbarch *gdbarch, | |
2784 | int char_signed) | |
2785 | { | |
2786 | gdbarch->char_signed = char_signed; | |
2787 | } | |
2788 | ||
0f71a2f6 | 2789 | CORE_ADDR |
39f77062 | 2790 | gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid) |
0f71a2f6 | 2791 | { |
8de9bdc4 | 2792 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 2793 | if (gdbarch->read_pc == 0) |
8e65ff28 AC |
2794 | internal_error (__FILE__, __LINE__, |
2795 | "gdbarch: gdbarch_read_pc invalid"); | |
0f71a2f6 | 2796 | if (gdbarch_debug >= 2) |
0f71a2f6 | 2797 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n"); |
39f77062 | 2798 | return gdbarch->read_pc (ptid); |
0f71a2f6 JM |
2799 | } |
2800 | ||
2801 | void | |
104c1213 JM |
2802 | set_gdbarch_read_pc (struct gdbarch *gdbarch, |
2803 | gdbarch_read_pc_ftype read_pc) | |
0f71a2f6 JM |
2804 | { |
2805 | gdbarch->read_pc = read_pc; | |
2806 | } | |
2807 | ||
2808 | void | |
39f77062 | 2809 | gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid) |
0f71a2f6 | 2810 | { |
8de9bdc4 | 2811 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 2812 | if (gdbarch->write_pc == 0) |
8e65ff28 AC |
2813 | internal_error (__FILE__, __LINE__, |
2814 | "gdbarch: gdbarch_write_pc invalid"); | |
0f71a2f6 | 2815 | if (gdbarch_debug >= 2) |
0f71a2f6 | 2816 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n"); |
39f77062 | 2817 | gdbarch->write_pc (val, ptid); |
0f71a2f6 JM |
2818 | } |
2819 | ||
2820 | void | |
104c1213 JM |
2821 | set_gdbarch_write_pc (struct gdbarch *gdbarch, |
2822 | gdbarch_write_pc_ftype write_pc) | |
0f71a2f6 JM |
2823 | { |
2824 | gdbarch->write_pc = write_pc; | |
2825 | } | |
2826 | ||
2827 | CORE_ADDR | |
2828 | gdbarch_read_fp (struct gdbarch *gdbarch) | |
2829 | { | |
8de9bdc4 | 2830 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 2831 | if (gdbarch->read_fp == 0) |
8e65ff28 AC |
2832 | internal_error (__FILE__, __LINE__, |
2833 | "gdbarch: gdbarch_read_fp invalid"); | |
0f71a2f6 | 2834 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2835 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n"); |
2836 | return gdbarch->read_fp (); | |
2837 | } | |
2838 | ||
2839 | void | |
104c1213 JM |
2840 | set_gdbarch_read_fp (struct gdbarch *gdbarch, |
2841 | gdbarch_read_fp_ftype read_fp) | |
0f71a2f6 JM |
2842 | { |
2843 | gdbarch->read_fp = read_fp; | |
2844 | } | |
2845 | ||
0f71a2f6 JM |
2846 | CORE_ADDR |
2847 | gdbarch_read_sp (struct gdbarch *gdbarch) | |
2848 | { | |
8de9bdc4 | 2849 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 2850 | if (gdbarch->read_sp == 0) |
8e65ff28 AC |
2851 | internal_error (__FILE__, __LINE__, |
2852 | "gdbarch: gdbarch_read_sp invalid"); | |
0f71a2f6 | 2853 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2854 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n"); |
2855 | return gdbarch->read_sp (); | |
2856 | } | |
2857 | ||
2858 | void | |
104c1213 JM |
2859 | set_gdbarch_read_sp (struct gdbarch *gdbarch, |
2860 | gdbarch_read_sp_ftype read_sp) | |
0f71a2f6 JM |
2861 | { |
2862 | gdbarch->read_sp = read_sp; | |
2863 | } | |
2864 | ||
2865 | void | |
2866 | gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val) | |
2867 | { | |
8de9bdc4 | 2868 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 2869 | if (gdbarch->write_sp == 0) |
8e65ff28 AC |
2870 | internal_error (__FILE__, __LINE__, |
2871 | "gdbarch: gdbarch_write_sp invalid"); | |
0f71a2f6 | 2872 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2873 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n"); |
2874 | gdbarch->write_sp (val); | |
2875 | } | |
2876 | ||
2877 | void | |
104c1213 JM |
2878 | set_gdbarch_write_sp (struct gdbarch *gdbarch, |
2879 | gdbarch_write_sp_ftype write_sp) | |
0f71a2f6 JM |
2880 | { |
2881 | gdbarch->write_sp = write_sp; | |
2882 | } | |
2883 | ||
39d4ef09 AC |
2884 | void |
2885 | gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset) | |
2886 | { | |
8de9bdc4 | 2887 | gdb_assert (gdbarch != NULL); |
39d4ef09 AC |
2888 | if (gdbarch->virtual_frame_pointer == 0) |
2889 | internal_error (__FILE__, __LINE__, | |
2890 | "gdbarch: gdbarch_virtual_frame_pointer invalid"); | |
2891 | if (gdbarch_debug >= 2) | |
2892 | fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n"); | |
2893 | gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset); | |
2894 | } | |
2895 | ||
2896 | void | |
2897 | set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, | |
2898 | gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer) | |
2899 | { | |
2900 | gdbarch->virtual_frame_pointer = virtual_frame_pointer; | |
2901 | } | |
2902 | ||
61a0eb5b | 2903 | int |
d8124050 | 2904 | gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch) |
61a0eb5b | 2905 | { |
8de9bdc4 | 2906 | gdb_assert (gdbarch != NULL); |
d8124050 | 2907 | return gdbarch->pseudo_register_read != 0; |
61a0eb5b AC |
2908 | } |
2909 | ||
2910 | void | |
d8124050 | 2911 | gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf) |
61a0eb5b | 2912 | { |
8de9bdc4 | 2913 | gdb_assert (gdbarch != NULL); |
d8124050 | 2914 | if (gdbarch->pseudo_register_read == 0) |
61a0eb5b | 2915 | internal_error (__FILE__, __LINE__, |
d8124050 | 2916 | "gdbarch: gdbarch_pseudo_register_read invalid"); |
61a0eb5b | 2917 | if (gdbarch_debug >= 2) |
d8124050 AC |
2918 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n"); |
2919 | gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf); | |
61a0eb5b AC |
2920 | } |
2921 | ||
2922 | void | |
d8124050 AC |
2923 | set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, |
2924 | gdbarch_pseudo_register_read_ftype pseudo_register_read) | |
61a0eb5b | 2925 | { |
d8124050 | 2926 | gdbarch->pseudo_register_read = pseudo_register_read; |
61a0eb5b AC |
2927 | } |
2928 | ||
2929 | int | |
d8124050 | 2930 | gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch) |
61a0eb5b | 2931 | { |
8de9bdc4 | 2932 | gdb_assert (gdbarch != NULL); |
d8124050 | 2933 | return gdbarch->pseudo_register_write != 0; |
61a0eb5b AC |
2934 | } |
2935 | ||
2936 | void | |
d8124050 | 2937 | gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf) |
61a0eb5b | 2938 | { |
8de9bdc4 | 2939 | gdb_assert (gdbarch != NULL); |
d8124050 | 2940 | if (gdbarch->pseudo_register_write == 0) |
61a0eb5b | 2941 | internal_error (__FILE__, __LINE__, |
d8124050 | 2942 | "gdbarch: gdbarch_pseudo_register_write invalid"); |
61a0eb5b | 2943 | if (gdbarch_debug >= 2) |
d8124050 AC |
2944 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n"); |
2945 | gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf); | |
61a0eb5b AC |
2946 | } |
2947 | ||
2948 | void | |
d8124050 AC |
2949 | set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, |
2950 | gdbarch_pseudo_register_write_ftype pseudo_register_write) | |
61a0eb5b | 2951 | { |
d8124050 | 2952 | gdbarch->pseudo_register_write = pseudo_register_write; |
61a0eb5b AC |
2953 | } |
2954 | ||
0f71a2f6 | 2955 | int |
104c1213 | 2956 | gdbarch_num_regs (struct gdbarch *gdbarch) |
0f71a2f6 | 2957 | { |
8de9bdc4 | 2958 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 2959 | if (gdbarch->num_regs == -1) |
8e65ff28 AC |
2960 | internal_error (__FILE__, __LINE__, |
2961 | "gdbarch: gdbarch_num_regs invalid"); | |
0f71a2f6 | 2962 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2963 | fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n"); |
2964 | return gdbarch->num_regs; | |
2965 | } | |
2966 | ||
2967 | void | |
104c1213 JM |
2968 | set_gdbarch_num_regs (struct gdbarch *gdbarch, |
2969 | int num_regs) | |
0f71a2f6 JM |
2970 | { |
2971 | gdbarch->num_regs = num_regs; | |
2972 | } | |
2973 | ||
0aba1244 EZ |
2974 | int |
2975 | gdbarch_num_pseudo_regs (struct gdbarch *gdbarch) | |
2976 | { | |
8de9bdc4 | 2977 | gdb_assert (gdbarch != NULL); |
0aba1244 EZ |
2978 | /* Skip verify of num_pseudo_regs, invalid_p == 0 */ |
2979 | if (gdbarch_debug >= 2) | |
2980 | fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n"); | |
2981 | return gdbarch->num_pseudo_regs; | |
2982 | } | |
2983 | ||
2984 | void | |
2985 | set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, | |
2986 | int num_pseudo_regs) | |
2987 | { | |
2988 | gdbarch->num_pseudo_regs = num_pseudo_regs; | |
2989 | } | |
2990 | ||
0f71a2f6 | 2991 | int |
104c1213 | 2992 | gdbarch_sp_regnum (struct gdbarch *gdbarch) |
0f71a2f6 | 2993 | { |
8de9bdc4 | 2994 | gdb_assert (gdbarch != NULL); |
1200cd6e | 2995 | /* Skip verify of sp_regnum, invalid_p == 0 */ |
0f71a2f6 | 2996 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2997 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n"); |
2998 | return gdbarch->sp_regnum; | |
2999 | } | |
3000 | ||
3001 | void | |
104c1213 JM |
3002 | set_gdbarch_sp_regnum (struct gdbarch *gdbarch, |
3003 | int sp_regnum) | |
0f71a2f6 JM |
3004 | { |
3005 | gdbarch->sp_regnum = sp_regnum; | |
3006 | } | |
3007 | ||
3008 | int | |
104c1213 | 3009 | gdbarch_fp_regnum (struct gdbarch *gdbarch) |
0f71a2f6 | 3010 | { |
8de9bdc4 | 3011 | gdb_assert (gdbarch != NULL); |
1200cd6e | 3012 | /* Skip verify of fp_regnum, invalid_p == 0 */ |
0f71a2f6 | 3013 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3014 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n"); |
3015 | return gdbarch->fp_regnum; | |
3016 | } | |
3017 | ||
3018 | void | |
104c1213 JM |
3019 | set_gdbarch_fp_regnum (struct gdbarch *gdbarch, |
3020 | int fp_regnum) | |
0f71a2f6 JM |
3021 | { |
3022 | gdbarch->fp_regnum = fp_regnum; | |
3023 | } | |
3024 | ||
3025 | int | |
104c1213 | 3026 | gdbarch_pc_regnum (struct gdbarch *gdbarch) |
0f71a2f6 | 3027 | { |
8de9bdc4 | 3028 | gdb_assert (gdbarch != NULL); |
1200cd6e | 3029 | /* Skip verify of pc_regnum, invalid_p == 0 */ |
0f71a2f6 | 3030 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3031 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n"); |
3032 | return gdbarch->pc_regnum; | |
3033 | } | |
3034 | ||
3035 | void | |
104c1213 JM |
3036 | set_gdbarch_pc_regnum (struct gdbarch *gdbarch, |
3037 | int pc_regnum) | |
0f71a2f6 JM |
3038 | { |
3039 | gdbarch->pc_regnum = pc_regnum; | |
3040 | } | |
3041 | ||
c2169756 AC |
3042 | int |
3043 | gdbarch_ps_regnum (struct gdbarch *gdbarch) | |
3044 | { | |
8de9bdc4 | 3045 | gdb_assert (gdbarch != NULL); |
c2169756 AC |
3046 | /* Skip verify of ps_regnum, invalid_p == 0 */ |
3047 | if (gdbarch_debug >= 2) | |
3048 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n"); | |
3049 | return gdbarch->ps_regnum; | |
3050 | } | |
3051 | ||
3052 | void | |
3053 | set_gdbarch_ps_regnum (struct gdbarch *gdbarch, | |
3054 | int ps_regnum) | |
3055 | { | |
3056 | gdbarch->ps_regnum = ps_regnum; | |
3057 | } | |
3058 | ||
60054393 MS |
3059 | int |
3060 | gdbarch_fp0_regnum (struct gdbarch *gdbarch) | |
3061 | { | |
8de9bdc4 | 3062 | gdb_assert (gdbarch != NULL); |
60054393 MS |
3063 | /* Skip verify of fp0_regnum, invalid_p == 0 */ |
3064 | if (gdbarch_debug >= 2) | |
3065 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n"); | |
3066 | return gdbarch->fp0_regnum; | |
3067 | } | |
3068 | ||
3069 | void | |
3070 | set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, | |
3071 | int fp0_regnum) | |
3072 | { | |
3073 | gdbarch->fp0_regnum = fp0_regnum; | |
3074 | } | |
3075 | ||
03863182 AC |
3076 | int |
3077 | gdbarch_npc_regnum (struct gdbarch *gdbarch) | |
3078 | { | |
8de9bdc4 | 3079 | gdb_assert (gdbarch != NULL); |
03863182 AC |
3080 | /* Skip verify of npc_regnum, invalid_p == 0 */ |
3081 | if (gdbarch_debug >= 2) | |
3082 | fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n"); | |
3083 | return gdbarch->npc_regnum; | |
3084 | } | |
3085 | ||
3086 | void | |
3087 | set_gdbarch_npc_regnum (struct gdbarch *gdbarch, | |
3088 | int npc_regnum) | |
3089 | { | |
3090 | gdbarch->npc_regnum = npc_regnum; | |
3091 | } | |
3092 | ||
88c72b7d AC |
3093 | int |
3094 | gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr) | |
3095 | { | |
8de9bdc4 | 3096 | gdb_assert (gdbarch != NULL); |
88c72b7d | 3097 | if (gdbarch->stab_reg_to_regnum == 0) |
8e65ff28 AC |
3098 | internal_error (__FILE__, __LINE__, |
3099 | "gdbarch: gdbarch_stab_reg_to_regnum invalid"); | |
88c72b7d AC |
3100 | if (gdbarch_debug >= 2) |
3101 | fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n"); | |
3102 | return gdbarch->stab_reg_to_regnum (stab_regnr); | |
3103 | } | |
3104 | ||
3105 | void | |
3106 | set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, | |
3107 | gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum) | |
3108 | { | |
3109 | gdbarch->stab_reg_to_regnum = stab_reg_to_regnum; | |
3110 | } | |
3111 | ||
3112 | int | |
3113 | gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr) | |
3114 | { | |
8de9bdc4 | 3115 | gdb_assert (gdbarch != NULL); |
88c72b7d | 3116 | if (gdbarch->ecoff_reg_to_regnum == 0) |
8e65ff28 AC |
3117 | internal_error (__FILE__, __LINE__, |
3118 | "gdbarch: gdbarch_ecoff_reg_to_regnum invalid"); | |
88c72b7d AC |
3119 | if (gdbarch_debug >= 2) |
3120 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n"); | |
3121 | return gdbarch->ecoff_reg_to_regnum (ecoff_regnr); | |
3122 | } | |
3123 | ||
3124 | void | |
3125 | set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, | |
3126 | gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum) | |
3127 | { | |
3128 | gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum; | |
3129 | } | |
3130 | ||
3131 | int | |
3132 | gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr) | |
3133 | { | |
8de9bdc4 | 3134 | gdb_assert (gdbarch != NULL); |
88c72b7d | 3135 | if (gdbarch->dwarf_reg_to_regnum == 0) |
8e65ff28 AC |
3136 | internal_error (__FILE__, __LINE__, |
3137 | "gdbarch: gdbarch_dwarf_reg_to_regnum invalid"); | |
88c72b7d AC |
3138 | if (gdbarch_debug >= 2) |
3139 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n"); | |
3140 | return gdbarch->dwarf_reg_to_regnum (dwarf_regnr); | |
3141 | } | |
3142 | ||
3143 | void | |
3144 | set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, | |
3145 | gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum) | |
3146 | { | |
3147 | gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum; | |
3148 | } | |
3149 | ||
3150 | int | |
3151 | gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr) | |
3152 | { | |
8de9bdc4 | 3153 | gdb_assert (gdbarch != NULL); |
88c72b7d | 3154 | if (gdbarch->sdb_reg_to_regnum == 0) |
8e65ff28 AC |
3155 | internal_error (__FILE__, __LINE__, |
3156 | "gdbarch: gdbarch_sdb_reg_to_regnum invalid"); | |
88c72b7d AC |
3157 | if (gdbarch_debug >= 2) |
3158 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n"); | |
3159 | return gdbarch->sdb_reg_to_regnum (sdb_regnr); | |
3160 | } | |
3161 | ||
3162 | void | |
3163 | set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, | |
3164 | gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum) | |
3165 | { | |
3166 | gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum; | |
3167 | } | |
3168 | ||
3169 | int | |
3170 | gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr) | |
3171 | { | |
8de9bdc4 | 3172 | gdb_assert (gdbarch != NULL); |
88c72b7d | 3173 | if (gdbarch->dwarf2_reg_to_regnum == 0) |
8e65ff28 AC |
3174 | internal_error (__FILE__, __LINE__, |
3175 | "gdbarch: gdbarch_dwarf2_reg_to_regnum invalid"); | |
88c72b7d AC |
3176 | if (gdbarch_debug >= 2) |
3177 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n"); | |
3178 | return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr); | |
3179 | } | |
3180 | ||
3181 | void | |
3182 | set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, | |
3183 | gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum) | |
3184 | { | |
3185 | gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum; | |
3186 | } | |
3187 | ||
fa88f677 | 3188 | const char * |
0f71a2f6 JM |
3189 | gdbarch_register_name (struct gdbarch *gdbarch, int regnr) |
3190 | { | |
8de9bdc4 | 3191 | gdb_assert (gdbarch != NULL); |
7be570e7 | 3192 | if (gdbarch->register_name == 0) |
8e65ff28 AC |
3193 | internal_error (__FILE__, __LINE__, |
3194 | "gdbarch: gdbarch_register_name invalid"); | |
0f71a2f6 | 3195 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3196 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n"); |
3197 | return gdbarch->register_name (regnr); | |
3198 | } | |
3199 | ||
3200 | void | |
104c1213 JM |
3201 | set_gdbarch_register_name (struct gdbarch *gdbarch, |
3202 | gdbarch_register_name_ftype register_name) | |
0f71a2f6 JM |
3203 | { |
3204 | gdbarch->register_name = register_name; | |
3205 | } | |
3206 | ||
3207 | int | |
104c1213 | 3208 | gdbarch_register_size (struct gdbarch *gdbarch) |
0f71a2f6 | 3209 | { |
8de9bdc4 | 3210 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3211 | if (gdbarch->register_size == -1) |
8e65ff28 AC |
3212 | internal_error (__FILE__, __LINE__, |
3213 | "gdbarch: gdbarch_register_size invalid"); | |
0f71a2f6 | 3214 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3215 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n"); |
3216 | return gdbarch->register_size; | |
3217 | } | |
3218 | ||
3219 | void | |
104c1213 JM |
3220 | set_gdbarch_register_size (struct gdbarch *gdbarch, |
3221 | int register_size) | |
0f71a2f6 JM |
3222 | { |
3223 | gdbarch->register_size = register_size; | |
3224 | } | |
3225 | ||
3226 | int | |
104c1213 | 3227 | gdbarch_register_bytes (struct gdbarch *gdbarch) |
0f71a2f6 | 3228 | { |
8de9bdc4 | 3229 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3230 | if (gdbarch->register_bytes == -1) |
8e65ff28 AC |
3231 | internal_error (__FILE__, __LINE__, |
3232 | "gdbarch: gdbarch_register_bytes invalid"); | |
0f71a2f6 | 3233 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3234 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n"); |
3235 | return gdbarch->register_bytes; | |
3236 | } | |
3237 | ||
3238 | void | |
104c1213 JM |
3239 | set_gdbarch_register_bytes (struct gdbarch *gdbarch, |
3240 | int register_bytes) | |
0f71a2f6 JM |
3241 | { |
3242 | gdbarch->register_bytes = register_bytes; | |
3243 | } | |
3244 | ||
3245 | int | |
3246 | gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr) | |
3247 | { | |
8de9bdc4 | 3248 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3249 | if (gdbarch->register_byte == 0) |
8e65ff28 AC |
3250 | internal_error (__FILE__, __LINE__, |
3251 | "gdbarch: gdbarch_register_byte invalid"); | |
0f71a2f6 | 3252 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3253 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n"); |
3254 | return gdbarch->register_byte (reg_nr); | |
3255 | } | |
3256 | ||
3257 | void | |
104c1213 JM |
3258 | set_gdbarch_register_byte (struct gdbarch *gdbarch, |
3259 | gdbarch_register_byte_ftype register_byte) | |
0f71a2f6 JM |
3260 | { |
3261 | gdbarch->register_byte = register_byte; | |
3262 | } | |
3263 | ||
3264 | int | |
3265 | gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr) | |
3266 | { | |
8de9bdc4 | 3267 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3268 | if (gdbarch->register_raw_size == 0) |
8e65ff28 AC |
3269 | internal_error (__FILE__, __LINE__, |
3270 | "gdbarch: gdbarch_register_raw_size invalid"); | |
0f71a2f6 | 3271 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3272 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n"); |
3273 | return gdbarch->register_raw_size (reg_nr); | |
3274 | } | |
3275 | ||
3276 | void | |
104c1213 JM |
3277 | set_gdbarch_register_raw_size (struct gdbarch *gdbarch, |
3278 | gdbarch_register_raw_size_ftype register_raw_size) | |
0f71a2f6 JM |
3279 | { |
3280 | gdbarch->register_raw_size = register_raw_size; | |
3281 | } | |
3282 | ||
3283 | int | |
104c1213 | 3284 | gdbarch_max_register_raw_size (struct gdbarch *gdbarch) |
0f71a2f6 | 3285 | { |
8de9bdc4 | 3286 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3287 | if (gdbarch->max_register_raw_size == -1) |
8e65ff28 AC |
3288 | internal_error (__FILE__, __LINE__, |
3289 | "gdbarch: gdbarch_max_register_raw_size invalid"); | |
0f71a2f6 | 3290 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3291 | fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n"); |
3292 | return gdbarch->max_register_raw_size; | |
3293 | } | |
3294 | ||
3295 | void | |
104c1213 JM |
3296 | set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, |
3297 | int max_register_raw_size) | |
0f71a2f6 JM |
3298 | { |
3299 | gdbarch->max_register_raw_size = max_register_raw_size; | |
3300 | } | |
3301 | ||
3302 | int | |
3303 | gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr) | |
3304 | { | |
8de9bdc4 | 3305 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3306 | if (gdbarch->register_virtual_size == 0) |
8e65ff28 AC |
3307 | internal_error (__FILE__, __LINE__, |
3308 | "gdbarch: gdbarch_register_virtual_size invalid"); | |
0f71a2f6 | 3309 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3310 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n"); |
3311 | return gdbarch->register_virtual_size (reg_nr); | |
3312 | } | |
3313 | ||
3314 | void | |
104c1213 JM |
3315 | set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, |
3316 | gdbarch_register_virtual_size_ftype register_virtual_size) | |
0f71a2f6 JM |
3317 | { |
3318 | gdbarch->register_virtual_size = register_virtual_size; | |
3319 | } | |
3320 | ||
3321 | int | |
104c1213 | 3322 | gdbarch_max_register_virtual_size (struct gdbarch *gdbarch) |
0f71a2f6 | 3323 | { |
8de9bdc4 | 3324 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3325 | if (gdbarch->max_register_virtual_size == -1) |
8e65ff28 AC |
3326 | internal_error (__FILE__, __LINE__, |
3327 | "gdbarch: gdbarch_max_register_virtual_size invalid"); | |
0f71a2f6 | 3328 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3329 | fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n"); |
3330 | return gdbarch->max_register_virtual_size; | |
3331 | } | |
3332 | ||
3333 | void | |
104c1213 JM |
3334 | set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, |
3335 | int max_register_virtual_size) | |
0f71a2f6 JM |
3336 | { |
3337 | gdbarch->max_register_virtual_size = max_register_virtual_size; | |
3338 | } | |
3339 | ||
3340 | struct type * | |
3341 | gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr) | |
3342 | { | |
8de9bdc4 | 3343 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3344 | if (gdbarch->register_virtual_type == 0) |
8e65ff28 AC |
3345 | internal_error (__FILE__, __LINE__, |
3346 | "gdbarch: gdbarch_register_virtual_type invalid"); | |
0f71a2f6 | 3347 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3348 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n"); |
3349 | return gdbarch->register_virtual_type (reg_nr); | |
3350 | } | |
3351 | ||
3352 | void | |
104c1213 JM |
3353 | set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, |
3354 | gdbarch_register_virtual_type_ftype register_virtual_type) | |
0f71a2f6 JM |
3355 | { |
3356 | gdbarch->register_virtual_type = register_virtual_type; | |
3357 | } | |
3358 | ||
0ab7a791 | 3359 | int |
903ad3a6 | 3360 | gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch) |
0ab7a791 AC |
3361 | { |
3362 | gdb_assert (gdbarch != NULL); | |
903ad3a6 | 3363 | return gdbarch->deprecated_do_registers_info != 0; |
0ab7a791 AC |
3364 | } |
3365 | ||
666e11c5 | 3366 | void |
903ad3a6 | 3367 | gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs) |
666e11c5 | 3368 | { |
8de9bdc4 | 3369 | gdb_assert (gdbarch != NULL); |
903ad3a6 | 3370 | if (gdbarch->deprecated_do_registers_info == 0) |
8e65ff28 | 3371 | internal_error (__FILE__, __LINE__, |
903ad3a6 | 3372 | "gdbarch: gdbarch_deprecated_do_registers_info invalid"); |
666e11c5 | 3373 | if (gdbarch_debug >= 2) |
903ad3a6 AC |
3374 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_do_registers_info called\n"); |
3375 | gdbarch->deprecated_do_registers_info (reg_nr, fpregs); | |
666e11c5 EZ |
3376 | } |
3377 | ||
3378 | void | |
903ad3a6 AC |
3379 | set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, |
3380 | gdbarch_deprecated_do_registers_info_ftype deprecated_do_registers_info) | |
666e11c5 | 3381 | { |
903ad3a6 | 3382 | gdbarch->deprecated_do_registers_info = deprecated_do_registers_info; |
666e11c5 EZ |
3383 | } |
3384 | ||
0ab7a791 AC |
3385 | void |
3386 | gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all) | |
3387 | { | |
3388 | gdb_assert (gdbarch != NULL); | |
3389 | if (gdbarch->print_registers_info == 0) | |
3390 | internal_error (__FILE__, __LINE__, | |
3391 | "gdbarch: gdbarch_print_registers_info invalid"); | |
3392 | if (gdbarch_debug >= 2) | |
3393 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n"); | |
3394 | gdbarch->print_registers_info (gdbarch, file, frame, regnum, all); | |
3395 | } | |
3396 | ||
3397 | void | |
3398 | set_gdbarch_print_registers_info (struct gdbarch *gdbarch, | |
3399 | gdbarch_print_registers_info_ftype print_registers_info) | |
3400 | { | |
3401 | gdbarch->print_registers_info = print_registers_info; | |
3402 | } | |
3403 | ||
23e3a7ac AC |
3404 | int |
3405 | gdbarch_print_float_info_p (struct gdbarch *gdbarch) | |
3406 | { | |
3407 | gdb_assert (gdbarch != NULL); | |
3408 | return gdbarch->print_float_info != 0; | |
3409 | } | |
3410 | ||
5e74b15c | 3411 | void |
23e3a7ac | 3412 | gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) |
5e74b15c | 3413 | { |
8de9bdc4 | 3414 | gdb_assert (gdbarch != NULL); |
5e74b15c RE |
3415 | if (gdbarch->print_float_info == 0) |
3416 | internal_error (__FILE__, __LINE__, | |
3417 | "gdbarch: gdbarch_print_float_info invalid"); | |
3418 | if (gdbarch_debug >= 2) | |
3419 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n"); | |
23e3a7ac | 3420 | gdbarch->print_float_info (gdbarch, file, frame, args); |
5e74b15c RE |
3421 | } |
3422 | ||
3423 | void | |
3424 | set_gdbarch_print_float_info (struct gdbarch *gdbarch, | |
3425 | gdbarch_print_float_info_ftype print_float_info) | |
3426 | { | |
3427 | gdbarch->print_float_info = print_float_info; | |
3428 | } | |
3429 | ||
e76f1f2e AC |
3430 | int |
3431 | gdbarch_print_vector_info_p (struct gdbarch *gdbarch) | |
3432 | { | |
3433 | gdb_assert (gdbarch != NULL); | |
3434 | return gdbarch->print_vector_info != 0; | |
3435 | } | |
3436 | ||
3437 | void | |
3438 | gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) | |
3439 | { | |
3440 | gdb_assert (gdbarch != NULL); | |
3441 | if (gdbarch->print_vector_info == 0) | |
3442 | internal_error (__FILE__, __LINE__, | |
3443 | "gdbarch: gdbarch_print_vector_info invalid"); | |
3444 | if (gdbarch_debug >= 2) | |
3445 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n"); | |
3446 | gdbarch->print_vector_info (gdbarch, file, frame, args); | |
3447 | } | |
3448 | ||
3449 | void | |
3450 | set_gdbarch_print_vector_info (struct gdbarch *gdbarch, | |
3451 | gdbarch_print_vector_info_ftype print_vector_info) | |
3452 | { | |
3453 | gdbarch->print_vector_info = print_vector_info; | |
3454 | } | |
3455 | ||
7c7651b2 AC |
3456 | int |
3457 | gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr) | |
3458 | { | |
8de9bdc4 | 3459 | gdb_assert (gdbarch != NULL); |
7c7651b2 | 3460 | if (gdbarch->register_sim_regno == 0) |
8e65ff28 AC |
3461 | internal_error (__FILE__, __LINE__, |
3462 | "gdbarch: gdbarch_register_sim_regno invalid"); | |
7c7651b2 AC |
3463 | if (gdbarch_debug >= 2) |
3464 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n"); | |
3465 | return gdbarch->register_sim_regno (reg_nr); | |
3466 | } | |
3467 | ||
3468 | void | |
3469 | set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, | |
3470 | gdbarch_register_sim_regno_ftype register_sim_regno) | |
3471 | { | |
3472 | gdbarch->register_sim_regno = register_sim_regno; | |
3473 | } | |
3474 | ||
2649061d AC |
3475 | int |
3476 | gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch) | |
3477 | { | |
8de9bdc4 | 3478 | gdb_assert (gdbarch != NULL); |
2649061d AC |
3479 | return gdbarch->register_bytes_ok != 0; |
3480 | } | |
3481 | ||
3482 | int | |
3483 | gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes) | |
3484 | { | |
8de9bdc4 | 3485 | gdb_assert (gdbarch != NULL); |
2649061d | 3486 | if (gdbarch->register_bytes_ok == 0) |
8e65ff28 AC |
3487 | internal_error (__FILE__, __LINE__, |
3488 | "gdbarch: gdbarch_register_bytes_ok invalid"); | |
2649061d AC |
3489 | if (gdbarch_debug >= 2) |
3490 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n"); | |
3491 | return gdbarch->register_bytes_ok (nr_bytes); | |
3492 | } | |
3493 | ||
3494 | void | |
3495 | set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, | |
3496 | gdbarch_register_bytes_ok_ftype register_bytes_ok) | |
3497 | { | |
3498 | gdbarch->register_bytes_ok = register_bytes_ok; | |
3499 | } | |
3500 | ||
01fb7433 | 3501 | int |
1622c8f7 | 3502 | gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum) |
01fb7433 | 3503 | { |
8de9bdc4 | 3504 | gdb_assert (gdbarch != NULL); |
01fb7433 AC |
3505 | if (gdbarch->cannot_fetch_register == 0) |
3506 | internal_error (__FILE__, __LINE__, | |
3507 | "gdbarch: gdbarch_cannot_fetch_register invalid"); | |
3508 | if (gdbarch_debug >= 2) | |
3509 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n"); | |
1622c8f7 | 3510 | return gdbarch->cannot_fetch_register (regnum); |
01fb7433 AC |
3511 | } |
3512 | ||
3513 | void | |
3514 | set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, | |
3515 | gdbarch_cannot_fetch_register_ftype cannot_fetch_register) | |
3516 | { | |
3517 | gdbarch->cannot_fetch_register = cannot_fetch_register; | |
3518 | } | |
3519 | ||
3520 | int | |
1622c8f7 | 3521 | gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum) |
01fb7433 | 3522 | { |
8de9bdc4 | 3523 | gdb_assert (gdbarch != NULL); |
01fb7433 AC |
3524 | if (gdbarch->cannot_store_register == 0) |
3525 | internal_error (__FILE__, __LINE__, | |
3526 | "gdbarch: gdbarch_cannot_store_register invalid"); | |
3527 | if (gdbarch_debug >= 2) | |
3528 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n"); | |
1622c8f7 | 3529 | return gdbarch->cannot_store_register (regnum); |
01fb7433 AC |
3530 | } |
3531 | ||
3532 | void | |
3533 | set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, | |
3534 | gdbarch_cannot_store_register_ftype cannot_store_register) | |
3535 | { | |
3536 | gdbarch->cannot_store_register = cannot_store_register; | |
3537 | } | |
3538 | ||
9df628e0 RE |
3539 | int |
3540 | gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch) | |
3541 | { | |
8de9bdc4 | 3542 | gdb_assert (gdbarch != NULL); |
9df628e0 RE |
3543 | return gdbarch->get_longjmp_target != 0; |
3544 | } | |
3545 | ||
3546 | int | |
3547 | gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc) | |
3548 | { | |
8de9bdc4 | 3549 | gdb_assert (gdbarch != NULL); |
9df628e0 RE |
3550 | if (gdbarch->get_longjmp_target == 0) |
3551 | internal_error (__FILE__, __LINE__, | |
3552 | "gdbarch: gdbarch_get_longjmp_target invalid"); | |
3553 | if (gdbarch_debug >= 2) | |
3554 | fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n"); | |
3555 | return gdbarch->get_longjmp_target (pc); | |
3556 | } | |
3557 | ||
3558 | void | |
3559 | set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, | |
3560 | gdbarch_get_longjmp_target_ftype get_longjmp_target) | |
3561 | { | |
3562 | gdbarch->get_longjmp_target = get_longjmp_target; | |
3563 | } | |
3564 | ||
0f71a2f6 | 3565 | int |
07555a72 | 3566 | gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch) |
0f71a2f6 | 3567 | { |
8de9bdc4 | 3568 | gdb_assert (gdbarch != NULL); |
07555a72 | 3569 | /* Skip verify of deprecated_use_generic_dummy_frames, invalid_p == 0 */ |
0f71a2f6 | 3570 | if (gdbarch_debug >= 2) |
07555a72 AC |
3571 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_generic_dummy_frames called\n"); |
3572 | return gdbarch->deprecated_use_generic_dummy_frames; | |
0f71a2f6 JM |
3573 | } |
3574 | ||
3575 | void | |
07555a72 AC |
3576 | set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch, |
3577 | int deprecated_use_generic_dummy_frames) | |
0f71a2f6 | 3578 | { |
07555a72 | 3579 | gdbarch->deprecated_use_generic_dummy_frames = deprecated_use_generic_dummy_frames; |
0f71a2f6 JM |
3580 | } |
3581 | ||
3582 | int | |
104c1213 | 3583 | gdbarch_call_dummy_location (struct gdbarch *gdbarch) |
0f71a2f6 | 3584 | { |
8de9bdc4 | 3585 | gdb_assert (gdbarch != NULL); |
b99fa2d2 | 3586 | /* Skip verify of call_dummy_location, invalid_p == 0 */ |
0f71a2f6 | 3587 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3588 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n"); |
3589 | return gdbarch->call_dummy_location; | |
3590 | } | |
3591 | ||
3592 | void | |
104c1213 JM |
3593 | set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, |
3594 | int call_dummy_location) | |
0f71a2f6 JM |
3595 | { |
3596 | gdbarch->call_dummy_location = call_dummy_location; | |
3597 | } | |
3598 | ||
3599 | CORE_ADDR | |
3600 | gdbarch_call_dummy_address (struct gdbarch *gdbarch) | |
3601 | { | |
8de9bdc4 | 3602 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3603 | if (gdbarch->call_dummy_address == 0) |
8e65ff28 AC |
3604 | internal_error (__FILE__, __LINE__, |
3605 | "gdbarch: gdbarch_call_dummy_address invalid"); | |
0f71a2f6 | 3606 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3607 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n"); |
3608 | return gdbarch->call_dummy_address (); | |
3609 | } | |
3610 | ||
3611 | void | |
104c1213 JM |
3612 | set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, |
3613 | gdbarch_call_dummy_address_ftype call_dummy_address) | |
0f71a2f6 JM |
3614 | { |
3615 | gdbarch->call_dummy_address = call_dummy_address; | |
3616 | } | |
3617 | ||
3618 | CORE_ADDR | |
104c1213 | 3619 | gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch) |
0f71a2f6 | 3620 | { |
8de9bdc4 | 3621 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3622 | if (gdbarch->call_dummy_start_offset == -1) |
8e65ff28 AC |
3623 | internal_error (__FILE__, __LINE__, |
3624 | "gdbarch: gdbarch_call_dummy_start_offset invalid"); | |
0f71a2f6 | 3625 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3626 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n"); |
3627 | return gdbarch->call_dummy_start_offset; | |
3628 | } | |
3629 | ||
3630 | void | |
104c1213 JM |
3631 | set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, |
3632 | CORE_ADDR call_dummy_start_offset) | |
0f71a2f6 JM |
3633 | { |
3634 | gdbarch->call_dummy_start_offset = call_dummy_start_offset; | |
3635 | } | |
3636 | ||
3637 | CORE_ADDR | |
104c1213 | 3638 | gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch) |
0f71a2f6 | 3639 | { |
8de9bdc4 | 3640 | gdb_assert (gdbarch != NULL); |
83e6b173 | 3641 | if (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1) |
8e65ff28 AC |
3642 | internal_error (__FILE__, __LINE__, |
3643 | "gdbarch: gdbarch_call_dummy_breakpoint_offset invalid"); | |
0f71a2f6 | 3644 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3645 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n"); |
3646 | return gdbarch->call_dummy_breakpoint_offset; | |
3647 | } | |
3648 | ||
3649 | void | |
104c1213 JM |
3650 | set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, |
3651 | CORE_ADDR call_dummy_breakpoint_offset) | |
0f71a2f6 JM |
3652 | { |
3653 | gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset; | |
3654 | } | |
3655 | ||
3656 | int | |
104c1213 | 3657 | gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch) |
0f71a2f6 | 3658 | { |
8de9bdc4 | 3659 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3660 | if (gdbarch->call_dummy_breakpoint_offset_p == -1) |
8e65ff28 AC |
3661 | internal_error (__FILE__, __LINE__, |
3662 | "gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid"); | |
0f71a2f6 | 3663 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3664 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n"); |
3665 | return gdbarch->call_dummy_breakpoint_offset_p; | |
3666 | } | |
3667 | ||
3668 | void | |
104c1213 JM |
3669 | set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch, |
3670 | int call_dummy_breakpoint_offset_p) | |
0f71a2f6 JM |
3671 | { |
3672 | gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p; | |
3673 | } | |
3674 | ||
3675 | int | |
104c1213 | 3676 | gdbarch_call_dummy_length (struct gdbarch *gdbarch) |
0f71a2f6 | 3677 | { |
8de9bdc4 | 3678 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3679 | if (gdbarch->call_dummy_length == -1) |
8e65ff28 AC |
3680 | internal_error (__FILE__, __LINE__, |
3681 | "gdbarch: gdbarch_call_dummy_length invalid"); | |
0f71a2f6 | 3682 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3683 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n"); |
3684 | return gdbarch->call_dummy_length; | |
3685 | } | |
3686 | ||
3687 | void | |
104c1213 JM |
3688 | set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, |
3689 | int call_dummy_length) | |
0f71a2f6 JM |
3690 | { |
3691 | gdbarch->call_dummy_length = call_dummy_length; | |
3692 | } | |
3693 | ||
3694 | int | |
ae45cd16 AC |
3695 | gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch) |
3696 | { | |
3697 | gdb_assert (gdbarch != NULL); | |
3698 | return gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy; | |
3699 | } | |
3700 | ||
3701 | int | |
3702 | gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) | |
0f71a2f6 | 3703 | { |
8de9bdc4 | 3704 | gdb_assert (gdbarch != NULL); |
ae45cd16 | 3705 | if (gdbarch->deprecated_pc_in_call_dummy == 0) |
8e65ff28 | 3706 | internal_error (__FILE__, __LINE__, |
ae45cd16 AC |
3707 | "gdbarch: gdbarch_deprecated_pc_in_call_dummy invalid"); |
3708 | /* Ignore predicate (gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy). */ | |
0f71a2f6 | 3709 | if (gdbarch_debug >= 2) |
ae45cd16 AC |
3710 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pc_in_call_dummy called\n"); |
3711 | return gdbarch->deprecated_pc_in_call_dummy (pc, sp, frame_address); | |
0f71a2f6 JM |
3712 | } |
3713 | ||
3714 | void | |
ae45cd16 AC |
3715 | set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, |
3716 | gdbarch_deprecated_pc_in_call_dummy_ftype deprecated_pc_in_call_dummy) | |
0f71a2f6 | 3717 | { |
ae45cd16 | 3718 | gdbarch->deprecated_pc_in_call_dummy = deprecated_pc_in_call_dummy; |
0f71a2f6 JM |
3719 | } |
3720 | ||
3721 | int | |
104c1213 | 3722 | gdbarch_call_dummy_p (struct gdbarch *gdbarch) |
0f71a2f6 | 3723 | { |
8de9bdc4 | 3724 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3725 | if (gdbarch->call_dummy_p == -1) |
8e65ff28 AC |
3726 | internal_error (__FILE__, __LINE__, |
3727 | "gdbarch: gdbarch_call_dummy_p invalid"); | |
0f71a2f6 | 3728 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3729 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n"); |
3730 | return gdbarch->call_dummy_p; | |
3731 | } | |
3732 | ||
3733 | void | |
104c1213 JM |
3734 | set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, |
3735 | int call_dummy_p) | |
0f71a2f6 JM |
3736 | { |
3737 | gdbarch->call_dummy_p = call_dummy_p; | |
3738 | } | |
3739 | ||
3740 | LONGEST * | |
104c1213 | 3741 | gdbarch_call_dummy_words (struct gdbarch *gdbarch) |
0f71a2f6 | 3742 | { |
8de9bdc4 | 3743 | gdb_assert (gdbarch != NULL); |
c0e8c252 | 3744 | /* Skip verify of call_dummy_words, invalid_p == 0 */ |
0f71a2f6 | 3745 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3746 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n"); |
3747 | return gdbarch->call_dummy_words; | |
3748 | } | |
3749 | ||
3750 | void | |
104c1213 JM |
3751 | set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, |
3752 | LONGEST * call_dummy_words) | |
0f71a2f6 JM |
3753 | { |
3754 | gdbarch->call_dummy_words = call_dummy_words; | |
3755 | } | |
3756 | ||
3757 | int | |
104c1213 | 3758 | gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch) |
0f71a2f6 | 3759 | { |
8de9bdc4 | 3760 | gdb_assert (gdbarch != NULL); |
c0e8c252 | 3761 | /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */ |
0f71a2f6 | 3762 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3763 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n"); |
3764 | return gdbarch->sizeof_call_dummy_words; | |
3765 | } | |
3766 | ||
3767 | void | |
104c1213 JM |
3768 | set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, |
3769 | int sizeof_call_dummy_words) | |
0f71a2f6 JM |
3770 | { |
3771 | gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words; | |
3772 | } | |
3773 | ||
3774 | int | |
104c1213 | 3775 | gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch) |
0f71a2f6 | 3776 | { |
8de9bdc4 | 3777 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3778 | if (gdbarch->call_dummy_stack_adjust_p == -1) |
8e65ff28 AC |
3779 | internal_error (__FILE__, __LINE__, |
3780 | "gdbarch: gdbarch_call_dummy_stack_adjust_p invalid"); | |
0f71a2f6 | 3781 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3782 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n"); |
3783 | return gdbarch->call_dummy_stack_adjust_p; | |
3784 | } | |
3785 | ||
3786 | void | |
104c1213 JM |
3787 | set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, |
3788 | int call_dummy_stack_adjust_p) | |
0f71a2f6 JM |
3789 | { |
3790 | gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p; | |
3791 | } | |
3792 | ||
3793 | int | |
104c1213 | 3794 | gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch) |
0f71a2f6 | 3795 | { |
8de9bdc4 | 3796 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3797 | if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0) |
8e65ff28 AC |
3798 | internal_error (__FILE__, __LINE__, |
3799 | "gdbarch: gdbarch_call_dummy_stack_adjust invalid"); | |
0f71a2f6 | 3800 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3801 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n"); |
3802 | return gdbarch->call_dummy_stack_adjust; | |
3803 | } | |
3804 | ||
3805 | void | |
104c1213 JM |
3806 | set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, |
3807 | int call_dummy_stack_adjust) | |
0f71a2f6 JM |
3808 | { |
3809 | gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust; | |
3810 | } | |
3811 | ||
3812 | void | |
3813 | gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p) | |
3814 | { | |
8de9bdc4 | 3815 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3816 | if (gdbarch->fix_call_dummy == 0) |
8e65ff28 AC |
3817 | internal_error (__FILE__, __LINE__, |
3818 | "gdbarch: gdbarch_fix_call_dummy invalid"); | |
0f71a2f6 | 3819 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3820 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n"); |
3821 | gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p); | |
3822 | } | |
3823 | ||
3824 | void | |
104c1213 JM |
3825 | set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, |
3826 | gdbarch_fix_call_dummy_ftype fix_call_dummy) | |
0f71a2f6 JM |
3827 | { |
3828 | gdbarch->fix_call_dummy = fix_call_dummy; | |
3829 | } | |
3830 | ||
2ca6c561 AC |
3831 | int |
3832 | gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch) | |
3833 | { | |
3834 | gdb_assert (gdbarch != NULL); | |
3835 | return gdbarch->deprecated_init_frame_pc_first != 0; | |
3836 | } | |
3837 | ||
97f46953 | 3838 | CORE_ADDR |
2ca6c561 | 3839 | gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) |
10312cc4 | 3840 | { |
8de9bdc4 | 3841 | gdb_assert (gdbarch != NULL); |
2ca6c561 | 3842 | if (gdbarch->deprecated_init_frame_pc_first == 0) |
10312cc4 | 3843 | internal_error (__FILE__, __LINE__, |
2ca6c561 | 3844 | "gdbarch: gdbarch_deprecated_init_frame_pc_first invalid"); |
10312cc4 | 3845 | if (gdbarch_debug >= 2) |
2ca6c561 | 3846 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc_first called\n"); |
97f46953 | 3847 | return gdbarch->deprecated_init_frame_pc_first (fromleaf, prev); |
10312cc4 AC |
3848 | } |
3849 | ||
3850 | void | |
2ca6c561 AC |
3851 | set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, |
3852 | gdbarch_deprecated_init_frame_pc_first_ftype deprecated_init_frame_pc_first) | |
10312cc4 | 3853 | { |
2ca6c561 | 3854 | gdbarch->deprecated_init_frame_pc_first = deprecated_init_frame_pc_first; |
10312cc4 AC |
3855 | } |
3856 | ||
a5afb99f AC |
3857 | int |
3858 | gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch) | |
3859 | { | |
3860 | gdb_assert (gdbarch != NULL); | |
3861 | return gdbarch->deprecated_init_frame_pc != 0; | |
3862 | } | |
3863 | ||
97f46953 | 3864 | CORE_ADDR |
a5afb99f | 3865 | gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) |
10312cc4 | 3866 | { |
8de9bdc4 | 3867 | gdb_assert (gdbarch != NULL); |
a5afb99f | 3868 | if (gdbarch->deprecated_init_frame_pc == 0) |
10312cc4 | 3869 | internal_error (__FILE__, __LINE__, |
a5afb99f | 3870 | "gdbarch: gdbarch_deprecated_init_frame_pc invalid"); |
10312cc4 | 3871 | if (gdbarch_debug >= 2) |
a5afb99f AC |
3872 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc called\n"); |
3873 | return gdbarch->deprecated_init_frame_pc (fromleaf, prev); | |
10312cc4 AC |
3874 | } |
3875 | ||
3876 | void | |
a5afb99f AC |
3877 | set_gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, |
3878 | gdbarch_deprecated_init_frame_pc_ftype deprecated_init_frame_pc) | |
10312cc4 | 3879 | { |
a5afb99f | 3880 | gdbarch->deprecated_init_frame_pc = deprecated_init_frame_pc; |
10312cc4 AC |
3881 | } |
3882 | ||
0f71a2f6 | 3883 | int |
104c1213 | 3884 | gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch) |
0f71a2f6 | 3885 | { |
8de9bdc4 | 3886 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3887 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3888 | fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n"); |
3889 | return gdbarch->believe_pcc_promotion; | |
3890 | } | |
3891 | ||
3892 | void | |
104c1213 JM |
3893 | set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, |
3894 | int believe_pcc_promotion) | |
0f71a2f6 JM |
3895 | { |
3896 | gdbarch->believe_pcc_promotion = believe_pcc_promotion; | |
3897 | } | |
3898 | ||
3899 | int | |
104c1213 | 3900 | gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch) |
0f71a2f6 | 3901 | { |
8de9bdc4 | 3902 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3903 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3904 | fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n"); |
3905 | return gdbarch->believe_pcc_promotion_type; | |
3906 | } | |
3907 | ||
3908 | void | |
104c1213 JM |
3909 | set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, |
3910 | int believe_pcc_promotion_type) | |
0f71a2f6 JM |
3911 | { |
3912 | gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type; | |
3913 | } | |
3914 | ||
a216a322 AC |
3915 | int |
3916 | gdbarch_get_saved_register_p (struct gdbarch *gdbarch) | |
3917 | { | |
3918 | gdb_assert (gdbarch != NULL); | |
3919 | return gdbarch->get_saved_register != 0; | |
3920 | } | |
3921 | ||
0f71a2f6 | 3922 | void |
adf40b2e | 3923 | gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval) |
0f71a2f6 | 3924 | { |
8de9bdc4 | 3925 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3926 | if (gdbarch->get_saved_register == 0) |
8e65ff28 AC |
3927 | internal_error (__FILE__, __LINE__, |
3928 | "gdbarch: gdbarch_get_saved_register invalid"); | |
0f71a2f6 | 3929 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3930 | fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n"); |
3931 | gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval); | |
3932 | } | |
3933 | ||
3934 | void | |
104c1213 JM |
3935 | set_gdbarch_get_saved_register (struct gdbarch *gdbarch, |
3936 | gdbarch_get_saved_register_ftype get_saved_register) | |
0f71a2f6 JM |
3937 | { |
3938 | gdbarch->get_saved_register = get_saved_register; | |
3939 | } | |
3940 | ||
3941 | int | |
3942 | gdbarch_register_convertible (struct gdbarch *gdbarch, int nr) | |
3943 | { | |
8de9bdc4 | 3944 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3945 | if (gdbarch->register_convertible == 0) |
8e65ff28 AC |
3946 | internal_error (__FILE__, __LINE__, |
3947 | "gdbarch: gdbarch_register_convertible invalid"); | |
0f71a2f6 | 3948 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3949 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n"); |
3950 | return gdbarch->register_convertible (nr); | |
3951 | } | |
3952 | ||
3953 | void | |
104c1213 JM |
3954 | set_gdbarch_register_convertible (struct gdbarch *gdbarch, |
3955 | gdbarch_register_convertible_ftype register_convertible) | |
0f71a2f6 JM |
3956 | { |
3957 | gdbarch->register_convertible = register_convertible; | |
3958 | } | |
3959 | ||
3960 | void | |
3961 | gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to) | |
3962 | { | |
8de9bdc4 | 3963 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3964 | if (gdbarch->register_convert_to_virtual == 0) |
8e65ff28 AC |
3965 | internal_error (__FILE__, __LINE__, |
3966 | "gdbarch: gdbarch_register_convert_to_virtual invalid"); | |
0f71a2f6 | 3967 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3968 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n"); |
3969 | gdbarch->register_convert_to_virtual (regnum, type, from, to); | |
3970 | } | |
3971 | ||
3972 | void | |
104c1213 JM |
3973 | set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, |
3974 | gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual) | |
0f71a2f6 JM |
3975 | { |
3976 | gdbarch->register_convert_to_virtual = register_convert_to_virtual; | |
3977 | } | |
3978 | ||
3979 | void | |
3980 | gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to) | |
3981 | { | |
8de9bdc4 | 3982 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 3983 | if (gdbarch->register_convert_to_raw == 0) |
8e65ff28 AC |
3984 | internal_error (__FILE__, __LINE__, |
3985 | "gdbarch: gdbarch_register_convert_to_raw invalid"); | |
0f71a2f6 | 3986 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3987 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n"); |
3988 | gdbarch->register_convert_to_raw (type, regnum, from, to); | |
3989 | } | |
3990 | ||
3991 | void | |
104c1213 JM |
3992 | set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, |
3993 | gdbarch_register_convert_to_raw_ftype register_convert_to_raw) | |
0f71a2f6 JM |
3994 | { |
3995 | gdbarch->register_convert_to_raw = register_convert_to_raw; | |
3996 | } | |
3997 | ||
13d01224 AC |
3998 | int |
3999 | gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum) | |
4000 | { | |
4001 | gdb_assert (gdbarch != NULL); | |
4002 | if (gdbarch->convert_register_p == 0) | |
4003 | internal_error (__FILE__, __LINE__, | |
4004 | "gdbarch: gdbarch_convert_register_p invalid"); | |
4005 | if (gdbarch_debug >= 2) | |
4006 | fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n"); | |
4007 | return gdbarch->convert_register_p (regnum); | |
4008 | } | |
4009 | ||
4010 | void | |
4011 | set_gdbarch_convert_register_p (struct gdbarch *gdbarch, | |
4012 | gdbarch_convert_register_p_ftype convert_register_p) | |
4013 | { | |
4014 | gdbarch->convert_register_p = convert_register_p; | |
4015 | } | |
4016 | ||
4017 | void | |
4018 | gdbarch_register_to_value (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to) | |
4019 | { | |
4020 | gdb_assert (gdbarch != NULL); | |
4021 | if (gdbarch->register_to_value == 0) | |
4022 | internal_error (__FILE__, __LINE__, | |
4023 | "gdbarch: gdbarch_register_to_value invalid"); | |
4024 | if (gdbarch_debug >= 2) | |
4025 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n"); | |
4026 | gdbarch->register_to_value (regnum, type, from, to); | |
4027 | } | |
4028 | ||
4029 | void | |
4030 | set_gdbarch_register_to_value (struct gdbarch *gdbarch, | |
4031 | gdbarch_register_to_value_ftype register_to_value) | |
4032 | { | |
4033 | gdbarch->register_to_value = register_to_value; | |
4034 | } | |
4035 | ||
4036 | void | |
4037 | gdbarch_value_to_register (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to) | |
4038 | { | |
4039 | gdb_assert (gdbarch != NULL); | |
4040 | if (gdbarch->value_to_register == 0) | |
4041 | internal_error (__FILE__, __LINE__, | |
4042 | "gdbarch: gdbarch_value_to_register invalid"); | |
4043 | if (gdbarch_debug >= 2) | |
4044 | fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n"); | |
4045 | gdbarch->value_to_register (type, regnum, from, to); | |
4046 | } | |
4047 | ||
4048 | void | |
4049 | set_gdbarch_value_to_register (struct gdbarch *gdbarch, | |
4050 | gdbarch_value_to_register_ftype value_to_register) | |
4051 | { | |
4052 | gdbarch->value_to_register = value_to_register; | |
4053 | } | |
4054 | ||
4478b372 | 4055 | CORE_ADDR |
66140c26 | 4056 | gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf) |
4478b372 | 4057 | { |
8de9bdc4 | 4058 | gdb_assert (gdbarch != NULL); |
4478b372 | 4059 | if (gdbarch->pointer_to_address == 0) |
8e65ff28 AC |
4060 | internal_error (__FILE__, __LINE__, |
4061 | "gdbarch: gdbarch_pointer_to_address invalid"); | |
4478b372 JB |
4062 | if (gdbarch_debug >= 2) |
4063 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n"); | |
4064 | return gdbarch->pointer_to_address (type, buf); | |
4065 | } | |
4066 | ||
4067 | void | |
4068 | set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, | |
4069 | gdbarch_pointer_to_address_ftype pointer_to_address) | |
4070 | { | |
4071 | gdbarch->pointer_to_address = pointer_to_address; | |
4072 | } | |
4073 | ||
4074 | void | |
ac2e2ef7 | 4075 | gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr) |
4478b372 | 4076 | { |
8de9bdc4 | 4077 | gdb_assert (gdbarch != NULL); |
4478b372 | 4078 | if (gdbarch->address_to_pointer == 0) |
8e65ff28 AC |
4079 | internal_error (__FILE__, __LINE__, |
4080 | "gdbarch: gdbarch_address_to_pointer invalid"); | |
4478b372 JB |
4081 | if (gdbarch_debug >= 2) |
4082 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n"); | |
4083 | gdbarch->address_to_pointer (type, buf, addr); | |
4084 | } | |
4085 | ||
4086 | void | |
4087 | set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, | |
4088 | gdbarch_address_to_pointer_ftype address_to_pointer) | |
4089 | { | |
4090 | gdbarch->address_to_pointer = address_to_pointer; | |
4091 | } | |
4092 | ||
fc0c74b1 AC |
4093 | int |
4094 | gdbarch_integer_to_address_p (struct gdbarch *gdbarch) | |
4095 | { | |
8de9bdc4 | 4096 | gdb_assert (gdbarch != NULL); |
fc0c74b1 AC |
4097 | return gdbarch->integer_to_address != 0; |
4098 | } | |
4099 | ||
4100 | CORE_ADDR | |
4101 | gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf) | |
4102 | { | |
8de9bdc4 | 4103 | gdb_assert (gdbarch != NULL); |
fc0c74b1 AC |
4104 | if (gdbarch->integer_to_address == 0) |
4105 | internal_error (__FILE__, __LINE__, | |
4106 | "gdbarch: gdbarch_integer_to_address invalid"); | |
4107 | if (gdbarch_debug >= 2) | |
4108 | fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n"); | |
4109 | return gdbarch->integer_to_address (type, buf); | |
4110 | } | |
4111 | ||
4112 | void | |
4113 | set_gdbarch_integer_to_address (struct gdbarch *gdbarch, | |
4114 | gdbarch_integer_to_address_ftype integer_to_address) | |
4115 | { | |
4116 | gdbarch->integer_to_address = integer_to_address; | |
4117 | } | |
4118 | ||
71a9f22e JB |
4119 | int |
4120 | gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type) | |
4121 | { | |
8de9bdc4 | 4122 | gdb_assert (gdbarch != NULL); |
71a9f22e | 4123 | if (gdbarch->return_value_on_stack == 0) |
8e65ff28 AC |
4124 | internal_error (__FILE__, __LINE__, |
4125 | "gdbarch: gdbarch_return_value_on_stack invalid"); | |
71a9f22e JB |
4126 | if (gdbarch_debug >= 2) |
4127 | fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n"); | |
4128 | return gdbarch->return_value_on_stack (type); | |
4129 | } | |
4130 | ||
4131 | void | |
4132 | set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, | |
4133 | gdbarch_return_value_on_stack_ftype return_value_on_stack) | |
4134 | { | |
4135 | gdbarch->return_value_on_stack = return_value_on_stack; | |
4136 | } | |
4137 | ||
0f71a2f6 JM |
4138 | CORE_ADDR |
4139 | gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) | |
4140 | { | |
8de9bdc4 | 4141 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4142 | if (gdbarch->push_arguments == 0) |
8e65ff28 AC |
4143 | internal_error (__FILE__, __LINE__, |
4144 | "gdbarch: gdbarch_push_arguments invalid"); | |
0f71a2f6 | 4145 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4146 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n"); |
4147 | return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr); | |
4148 | } | |
4149 | ||
4150 | void | |
104c1213 JM |
4151 | set_gdbarch_push_arguments (struct gdbarch *gdbarch, |
4152 | gdbarch_push_arguments_ftype push_arguments) | |
0f71a2f6 JM |
4153 | { |
4154 | gdbarch->push_arguments = push_arguments; | |
4155 | } | |
4156 | ||
4157 | void | |
4158 | gdbarch_push_dummy_frame (struct gdbarch *gdbarch) | |
4159 | { | |
8de9bdc4 | 4160 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4161 | if (gdbarch->push_dummy_frame == 0) |
8e65ff28 AC |
4162 | internal_error (__FILE__, __LINE__, |
4163 | "gdbarch: gdbarch_push_dummy_frame invalid"); | |
0f71a2f6 | 4164 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4165 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n"); |
4166 | gdbarch->push_dummy_frame (); | |
4167 | } | |
4168 | ||
4169 | void | |
104c1213 JM |
4170 | set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, |
4171 | gdbarch_push_dummy_frame_ftype push_dummy_frame) | |
0f71a2f6 JM |
4172 | { |
4173 | gdbarch->push_dummy_frame = push_dummy_frame; | |
4174 | } | |
4175 | ||
69a0d5f4 AC |
4176 | int |
4177 | gdbarch_push_return_address_p (struct gdbarch *gdbarch) | |
4178 | { | |
8de9bdc4 | 4179 | gdb_assert (gdbarch != NULL); |
69a0d5f4 AC |
4180 | return gdbarch->push_return_address != 0; |
4181 | } | |
4182 | ||
0f71a2f6 JM |
4183 | CORE_ADDR |
4184 | gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp) | |
4185 | { | |
8de9bdc4 | 4186 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4187 | if (gdbarch->push_return_address == 0) |
8e65ff28 AC |
4188 | internal_error (__FILE__, __LINE__, |
4189 | "gdbarch: gdbarch_push_return_address invalid"); | |
0f71a2f6 | 4190 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4191 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n"); |
4192 | return gdbarch->push_return_address (pc, sp); | |
4193 | } | |
4194 | ||
4195 | void | |
104c1213 JM |
4196 | set_gdbarch_push_return_address (struct gdbarch *gdbarch, |
4197 | gdbarch_push_return_address_ftype push_return_address) | |
0f71a2f6 JM |
4198 | { |
4199 | gdbarch->push_return_address = push_return_address; | |
4200 | } | |
4201 | ||
dedc2a2b AC |
4202 | int |
4203 | gdbarch_pop_frame_p (struct gdbarch *gdbarch) | |
4204 | { | |
4205 | gdb_assert (gdbarch != NULL); | |
4206 | return gdbarch->pop_frame != 0; | |
4207 | } | |
4208 | ||
0f71a2f6 JM |
4209 | void |
4210 | gdbarch_pop_frame (struct gdbarch *gdbarch) | |
4211 | { | |
8de9bdc4 | 4212 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4213 | if (gdbarch->pop_frame == 0) |
8e65ff28 AC |
4214 | internal_error (__FILE__, __LINE__, |
4215 | "gdbarch: gdbarch_pop_frame invalid"); | |
0f71a2f6 | 4216 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4217 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n"); |
4218 | gdbarch->pop_frame (); | |
4219 | } | |
4220 | ||
4221 | void | |
104c1213 JM |
4222 | set_gdbarch_pop_frame (struct gdbarch *gdbarch, |
4223 | gdbarch_pop_frame_ftype pop_frame) | |
0f71a2f6 JM |
4224 | { |
4225 | gdbarch->pop_frame = pop_frame; | |
4226 | } | |
4227 | ||
0f71a2f6 JM |
4228 | void |
4229 | gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp) | |
4230 | { | |
8de9bdc4 | 4231 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4232 | if (gdbarch->store_struct_return == 0) |
8e65ff28 AC |
4233 | internal_error (__FILE__, __LINE__, |
4234 | "gdbarch: gdbarch_store_struct_return invalid"); | |
0f71a2f6 | 4235 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4236 | fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n"); |
4237 | gdbarch->store_struct_return (addr, sp); | |
4238 | } | |
4239 | ||
4240 | void | |
104c1213 JM |
4241 | set_gdbarch_store_struct_return (struct gdbarch *gdbarch, |
4242 | gdbarch_store_struct_return_ftype store_struct_return) | |
0f71a2f6 JM |
4243 | { |
4244 | gdbarch->store_struct_return = store_struct_return; | |
4245 | } | |
4246 | ||
4247 | void | |
ebba8386 AC |
4248 | gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf) |
4249 | { | |
4250 | gdb_assert (gdbarch != NULL); | |
4251 | if (gdbarch->extract_return_value == 0) | |
4252 | internal_error (__FILE__, __LINE__, | |
4253 | "gdbarch: gdbarch_extract_return_value invalid"); | |
4254 | if (gdbarch_debug >= 2) | |
4255 | fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n"); | |
4256 | gdbarch->extract_return_value (type, regcache, valbuf); | |
4257 | } | |
4258 | ||
4259 | void | |
4260 | set_gdbarch_extract_return_value (struct gdbarch *gdbarch, | |
4261 | gdbarch_extract_return_value_ftype extract_return_value) | |
4262 | { | |
4263 | gdbarch->extract_return_value = extract_return_value; | |
4264 | } | |
4265 | ||
4266 | void | |
4267 | gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf) | |
0f71a2f6 | 4268 | { |
8de9bdc4 | 4269 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4270 | if (gdbarch->store_return_value == 0) |
8e65ff28 AC |
4271 | internal_error (__FILE__, __LINE__, |
4272 | "gdbarch: gdbarch_store_return_value invalid"); | |
0f71a2f6 | 4273 | if (gdbarch_debug >= 2) |
0f71a2f6 | 4274 | fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n"); |
ebba8386 | 4275 | gdbarch->store_return_value (type, regcache, valbuf); |
0f71a2f6 JM |
4276 | } |
4277 | ||
4278 | void | |
104c1213 JM |
4279 | set_gdbarch_store_return_value (struct gdbarch *gdbarch, |
4280 | gdbarch_store_return_value_ftype store_return_value) | |
0f71a2f6 JM |
4281 | { |
4282 | gdbarch->store_return_value = store_return_value; | |
4283 | } | |
4284 | ||
ebba8386 AC |
4285 | void |
4286 | gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf) | |
4287 | { | |
4288 | gdb_assert (gdbarch != NULL); | |
4289 | if (gdbarch->deprecated_extract_return_value == 0) | |
4290 | internal_error (__FILE__, __LINE__, | |
4291 | "gdbarch: gdbarch_deprecated_extract_return_value invalid"); | |
4292 | if (gdbarch_debug >= 2) | |
4293 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n"); | |
4294 | gdbarch->deprecated_extract_return_value (type, regbuf, valbuf); | |
4295 | } | |
4296 | ||
4297 | void | |
4298 | set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, | |
4299 | gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value) | |
4300 | { | |
4301 | gdbarch->deprecated_extract_return_value = deprecated_extract_return_value; | |
4302 | } | |
4303 | ||
4304 | void | |
4305 | gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf) | |
4306 | { | |
4307 | gdb_assert (gdbarch != NULL); | |
4308 | if (gdbarch->deprecated_store_return_value == 0) | |
4309 | internal_error (__FILE__, __LINE__, | |
4310 | "gdbarch: gdbarch_deprecated_store_return_value invalid"); | |
4311 | if (gdbarch_debug >= 2) | |
4312 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n"); | |
4313 | gdbarch->deprecated_store_return_value (type, valbuf); | |
4314 | } | |
4315 | ||
4316 | void | |
4317 | set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, | |
4318 | gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value) | |
4319 | { | |
4320 | gdbarch->deprecated_store_return_value = deprecated_store_return_value; | |
4321 | } | |
4322 | ||
049ee0e4 AC |
4323 | int |
4324 | gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch) | |
4325 | { | |
4326 | gdb_assert (gdbarch != NULL); | |
4327 | return gdbarch->extract_struct_value_address != 0; | |
4328 | } | |
4329 | ||
4330 | CORE_ADDR | |
4331 | gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache) | |
4332 | { | |
4333 | gdb_assert (gdbarch != NULL); | |
4334 | if (gdbarch->extract_struct_value_address == 0) | |
4335 | internal_error (__FILE__, __LINE__, | |
4336 | "gdbarch: gdbarch_extract_struct_value_address invalid"); | |
4337 | if (gdbarch_debug >= 2) | |
4338 | fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n"); | |
4339 | return gdbarch->extract_struct_value_address (regcache); | |
4340 | } | |
4341 | ||
4342 | void | |
4343 | set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, | |
4344 | gdbarch_extract_struct_value_address_ftype extract_struct_value_address) | |
4345 | { | |
4346 | gdbarch->extract_struct_value_address = extract_struct_value_address; | |
4347 | } | |
4348 | ||
d6dd581e | 4349 | int |
26e9b323 | 4350 | gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch) |
d6dd581e | 4351 | { |
8de9bdc4 | 4352 | gdb_assert (gdbarch != NULL); |
26e9b323 | 4353 | return gdbarch->deprecated_extract_struct_value_address != 0; |
d6dd581e AC |
4354 | } |
4355 | ||
0f71a2f6 | 4356 | CORE_ADDR |
26e9b323 | 4357 | gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf) |
0f71a2f6 | 4358 | { |
8de9bdc4 | 4359 | gdb_assert (gdbarch != NULL); |
26e9b323 | 4360 | if (gdbarch->deprecated_extract_struct_value_address == 0) |
8e65ff28 | 4361 | internal_error (__FILE__, __LINE__, |
26e9b323 | 4362 | "gdbarch: gdbarch_deprecated_extract_struct_value_address invalid"); |
0f71a2f6 | 4363 | if (gdbarch_debug >= 2) |
26e9b323 AC |
4364 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n"); |
4365 | return gdbarch->deprecated_extract_struct_value_address (regbuf); | |
0f71a2f6 JM |
4366 | } |
4367 | ||
4368 | void | |
26e9b323 AC |
4369 | set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, |
4370 | gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address) | |
0f71a2f6 | 4371 | { |
26e9b323 | 4372 | gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address; |
0f71a2f6 JM |
4373 | } |
4374 | ||
4375 | int | |
4376 | gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type) | |
4377 | { | |
8de9bdc4 | 4378 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4379 | if (gdbarch->use_struct_convention == 0) |
8e65ff28 AC |
4380 | internal_error (__FILE__, __LINE__, |
4381 | "gdbarch: gdbarch_use_struct_convention invalid"); | |
0f71a2f6 | 4382 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4383 | fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n"); |
4384 | return gdbarch->use_struct_convention (gcc_p, value_type); | |
4385 | } | |
4386 | ||
4387 | void | |
104c1213 JM |
4388 | set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, |
4389 | gdbarch_use_struct_convention_ftype use_struct_convention) | |
0f71a2f6 JM |
4390 | { |
4391 | gdbarch->use_struct_convention = use_struct_convention; | |
4392 | } | |
4393 | ||
8f871025 AC |
4394 | int |
4395 | gdbarch_frame_init_saved_regs_p (struct gdbarch *gdbarch) | |
4396 | { | |
4397 | gdb_assert (gdbarch != NULL); | |
4398 | return gdbarch->frame_init_saved_regs != 0; | |
4399 | } | |
4400 | ||
0f71a2f6 JM |
4401 | void |
4402 | gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame) | |
4403 | { | |
8de9bdc4 | 4404 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4405 | if (gdbarch->frame_init_saved_regs == 0) |
8e65ff28 AC |
4406 | internal_error (__FILE__, __LINE__, |
4407 | "gdbarch: gdbarch_frame_init_saved_regs invalid"); | |
0f71a2f6 | 4408 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4409 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n"); |
4410 | gdbarch->frame_init_saved_regs (frame); | |
4411 | } | |
4412 | ||
4413 | void | |
104c1213 JM |
4414 | set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, |
4415 | gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs) | |
0f71a2f6 JM |
4416 | { |
4417 | gdbarch->frame_init_saved_regs = frame_init_saved_regs; | |
4418 | } | |
4419 | ||
5fdff426 AC |
4420 | int |
4421 | gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch) | |
4422 | { | |
8de9bdc4 | 4423 | gdb_assert (gdbarch != NULL); |
5fdff426 AC |
4424 | return gdbarch->init_extra_frame_info != 0; |
4425 | } | |
4426 | ||
0f71a2f6 JM |
4427 | void |
4428 | gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame) | |
4429 | { | |
8de9bdc4 | 4430 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4431 | if (gdbarch->init_extra_frame_info == 0) |
8e65ff28 AC |
4432 | internal_error (__FILE__, __LINE__, |
4433 | "gdbarch: gdbarch_init_extra_frame_info invalid"); | |
0f71a2f6 | 4434 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4435 | fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n"); |
4436 | gdbarch->init_extra_frame_info (fromleaf, frame); | |
4437 | } | |
4438 | ||
4439 | void | |
104c1213 JM |
4440 | set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, |
4441 | gdbarch_init_extra_frame_info_ftype init_extra_frame_info) | |
0f71a2f6 JM |
4442 | { |
4443 | gdbarch->init_extra_frame_info = init_extra_frame_info; | |
4444 | } | |
4445 | ||
4446 | CORE_ADDR | |
4447 | gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) | |
4448 | { | |
8de9bdc4 | 4449 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4450 | if (gdbarch->skip_prologue == 0) |
8e65ff28 AC |
4451 | internal_error (__FILE__, __LINE__, |
4452 | "gdbarch: gdbarch_skip_prologue invalid"); | |
0f71a2f6 | 4453 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4454 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n"); |
4455 | return gdbarch->skip_prologue (ip); | |
4456 | } | |
4457 | ||
4458 | void | |
104c1213 JM |
4459 | set_gdbarch_skip_prologue (struct gdbarch *gdbarch, |
4460 | gdbarch_skip_prologue_ftype skip_prologue) | |
0f71a2f6 JM |
4461 | { |
4462 | gdbarch->skip_prologue = skip_prologue; | |
4463 | } | |
4464 | ||
dad41f9a AC |
4465 | int |
4466 | gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip) | |
4467 | { | |
8de9bdc4 | 4468 | gdb_assert (gdbarch != NULL); |
dad41f9a | 4469 | if (gdbarch->prologue_frameless_p == 0) |
8e65ff28 AC |
4470 | internal_error (__FILE__, __LINE__, |
4471 | "gdbarch: gdbarch_prologue_frameless_p invalid"); | |
dad41f9a AC |
4472 | if (gdbarch_debug >= 2) |
4473 | fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n"); | |
4474 | return gdbarch->prologue_frameless_p (ip); | |
4475 | } | |
4476 | ||
4477 | void | |
4478 | set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, | |
4479 | gdbarch_prologue_frameless_p_ftype prologue_frameless_p) | |
4480 | { | |
4481 | gdbarch->prologue_frameless_p = prologue_frameless_p; | |
4482 | } | |
4483 | ||
0f71a2f6 JM |
4484 | int |
4485 | gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) | |
4486 | { | |
8de9bdc4 | 4487 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4488 | if (gdbarch->inner_than == 0) |
8e65ff28 AC |
4489 | internal_error (__FILE__, __LINE__, |
4490 | "gdbarch: gdbarch_inner_than invalid"); | |
0f71a2f6 | 4491 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4492 | fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n"); |
4493 | return gdbarch->inner_than (lhs, rhs); | |
4494 | } | |
4495 | ||
4496 | void | |
104c1213 JM |
4497 | set_gdbarch_inner_than (struct gdbarch *gdbarch, |
4498 | gdbarch_inner_than_ftype inner_than) | |
0f71a2f6 JM |
4499 | { |
4500 | gdbarch->inner_than = inner_than; | |
4501 | } | |
4502 | ||
f4f9705a | 4503 | const unsigned char * |
adf40b2e | 4504 | gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) |
0f71a2f6 | 4505 | { |
8de9bdc4 | 4506 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4507 | if (gdbarch->breakpoint_from_pc == 0) |
8e65ff28 AC |
4508 | internal_error (__FILE__, __LINE__, |
4509 | "gdbarch: gdbarch_breakpoint_from_pc invalid"); | |
0f71a2f6 | 4510 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4511 | fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n"); |
4512 | return gdbarch->breakpoint_from_pc (pcptr, lenptr); | |
4513 | } | |
4514 | ||
4515 | void | |
104c1213 JM |
4516 | set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, |
4517 | gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc) | |
0f71a2f6 JM |
4518 | { |
4519 | gdbarch->breakpoint_from_pc = breakpoint_from_pc; | |
4520 | } | |
4521 | ||
917317f4 JM |
4522 | int |
4523 | gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) | |
4524 | { | |
8de9bdc4 | 4525 | gdb_assert (gdbarch != NULL); |
917317f4 | 4526 | if (gdbarch->memory_insert_breakpoint == 0) |
8e65ff28 AC |
4527 | internal_error (__FILE__, __LINE__, |
4528 | "gdbarch: gdbarch_memory_insert_breakpoint invalid"); | |
917317f4 | 4529 | if (gdbarch_debug >= 2) |
917317f4 JM |
4530 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n"); |
4531 | return gdbarch->memory_insert_breakpoint (addr, contents_cache); | |
4532 | } | |
4533 | ||
4534 | void | |
4535 | set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, | |
4536 | gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint) | |
4537 | { | |
4538 | gdbarch->memory_insert_breakpoint = memory_insert_breakpoint; | |
4539 | } | |
4540 | ||
4541 | int | |
4542 | gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) | |
4543 | { | |
8de9bdc4 | 4544 | gdb_assert (gdbarch != NULL); |
917317f4 | 4545 | if (gdbarch->memory_remove_breakpoint == 0) |
8e65ff28 AC |
4546 | internal_error (__FILE__, __LINE__, |
4547 | "gdbarch: gdbarch_memory_remove_breakpoint invalid"); | |
917317f4 | 4548 | if (gdbarch_debug >= 2) |
917317f4 JM |
4549 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n"); |
4550 | return gdbarch->memory_remove_breakpoint (addr, contents_cache); | |
4551 | } | |
4552 | ||
4553 | void | |
4554 | set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, | |
4555 | gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint) | |
4556 | { | |
4557 | gdbarch->memory_remove_breakpoint = memory_remove_breakpoint; | |
4558 | } | |
4559 | ||
0f71a2f6 | 4560 | CORE_ADDR |
104c1213 | 4561 | gdbarch_decr_pc_after_break (struct gdbarch *gdbarch) |
0f71a2f6 | 4562 | { |
8de9bdc4 | 4563 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4564 | if (gdbarch->decr_pc_after_break == -1) |
8e65ff28 AC |
4565 | internal_error (__FILE__, __LINE__, |
4566 | "gdbarch: gdbarch_decr_pc_after_break invalid"); | |
0f71a2f6 | 4567 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4568 | fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n"); |
4569 | return gdbarch->decr_pc_after_break; | |
4570 | } | |
4571 | ||
4572 | void | |
104c1213 JM |
4573 | set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, |
4574 | CORE_ADDR decr_pc_after_break) | |
0f71a2f6 JM |
4575 | { |
4576 | gdbarch->decr_pc_after_break = decr_pc_after_break; | |
4577 | } | |
4578 | ||
e02bc4cc DS |
4579 | int |
4580 | gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it) | |
4581 | { | |
8de9bdc4 | 4582 | gdb_assert (gdbarch != NULL); |
e02bc4cc DS |
4583 | if (gdbarch->prepare_to_proceed == 0) |
4584 | internal_error (__FILE__, __LINE__, | |
4585 | "gdbarch: gdbarch_prepare_to_proceed invalid"); | |
4586 | if (gdbarch_debug >= 2) | |
4587 | fprintf_unfiltered (gdb_stdlog, "gdbarch_prepare_to_proceed called\n"); | |
4588 | return gdbarch->prepare_to_proceed (select_it); | |
4589 | } | |
4590 | ||
4591 | void | |
4592 | set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, | |
4593 | gdbarch_prepare_to_proceed_ftype prepare_to_proceed) | |
4594 | { | |
4595 | gdbarch->prepare_to_proceed = prepare_to_proceed; | |
4596 | } | |
4597 | ||
0f71a2f6 | 4598 | CORE_ADDR |
104c1213 | 4599 | gdbarch_function_start_offset (struct gdbarch *gdbarch) |
0f71a2f6 | 4600 | { |
8de9bdc4 | 4601 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4602 | if (gdbarch->function_start_offset == -1) |
8e65ff28 AC |
4603 | internal_error (__FILE__, __LINE__, |
4604 | "gdbarch: gdbarch_function_start_offset invalid"); | |
0f71a2f6 | 4605 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4606 | fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n"); |
4607 | return gdbarch->function_start_offset; | |
4608 | } | |
4609 | ||
4610 | void | |
104c1213 JM |
4611 | set_gdbarch_function_start_offset (struct gdbarch *gdbarch, |
4612 | CORE_ADDR function_start_offset) | |
0f71a2f6 JM |
4613 | { |
4614 | gdbarch->function_start_offset = function_start_offset; | |
4615 | } | |
4616 | ||
4617 | void | |
adf40b2e | 4618 | gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len) |
0f71a2f6 | 4619 | { |
8de9bdc4 | 4620 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4621 | if (gdbarch->remote_translate_xfer_address == 0) |
8e65ff28 AC |
4622 | internal_error (__FILE__, __LINE__, |
4623 | "gdbarch: gdbarch_remote_translate_xfer_address invalid"); | |
0f71a2f6 | 4624 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4625 | fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n"); |
4626 | gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len); | |
4627 | } | |
4628 | ||
4629 | void | |
104c1213 JM |
4630 | set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, |
4631 | gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address) | |
0f71a2f6 JM |
4632 | { |
4633 | gdbarch->remote_translate_xfer_address = remote_translate_xfer_address; | |
4634 | } | |
4635 | ||
4636 | CORE_ADDR | |
104c1213 | 4637 | gdbarch_frame_args_skip (struct gdbarch *gdbarch) |
0f71a2f6 | 4638 | { |
8de9bdc4 | 4639 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4640 | if (gdbarch->frame_args_skip == -1) |
8e65ff28 AC |
4641 | internal_error (__FILE__, __LINE__, |
4642 | "gdbarch: gdbarch_frame_args_skip invalid"); | |
0f71a2f6 | 4643 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4644 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n"); |
4645 | return gdbarch->frame_args_skip; | |
4646 | } | |
4647 | ||
4648 | void | |
104c1213 JM |
4649 | set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, |
4650 | CORE_ADDR frame_args_skip) | |
0f71a2f6 JM |
4651 | { |
4652 | gdbarch->frame_args_skip = frame_args_skip; | |
4653 | } | |
4654 | ||
4655 | int | |
4656 | gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi) | |
4657 | { | |
8de9bdc4 | 4658 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4659 | if (gdbarch->frameless_function_invocation == 0) |
8e65ff28 AC |
4660 | internal_error (__FILE__, __LINE__, |
4661 | "gdbarch: gdbarch_frameless_function_invocation invalid"); | |
0f71a2f6 | 4662 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4663 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n"); |
4664 | return gdbarch->frameless_function_invocation (fi); | |
4665 | } | |
4666 | ||
4667 | void | |
104c1213 JM |
4668 | set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, |
4669 | gdbarch_frameless_function_invocation_ftype frameless_function_invocation) | |
0f71a2f6 JM |
4670 | { |
4671 | gdbarch->frameless_function_invocation = frameless_function_invocation; | |
4672 | } | |
4673 | ||
d62d1979 AC |
4674 | int |
4675 | gdbarch_frame_chain_p (struct gdbarch *gdbarch) | |
4676 | { | |
4677 | gdb_assert (gdbarch != NULL); | |
4678 | return gdbarch->frame_chain != 0; | |
4679 | } | |
4680 | ||
0f71a2f6 JM |
4681 | CORE_ADDR |
4682 | gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame) | |
4683 | { | |
8de9bdc4 | 4684 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4685 | if (gdbarch->frame_chain == 0) |
8e65ff28 AC |
4686 | internal_error (__FILE__, __LINE__, |
4687 | "gdbarch: gdbarch_frame_chain invalid"); | |
0f71a2f6 | 4688 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4689 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n"); |
4690 | return gdbarch->frame_chain (frame); | |
4691 | } | |
4692 | ||
4693 | void | |
104c1213 JM |
4694 | set_gdbarch_frame_chain (struct gdbarch *gdbarch, |
4695 | gdbarch_frame_chain_ftype frame_chain) | |
0f71a2f6 JM |
4696 | { |
4697 | gdbarch->frame_chain = frame_chain; | |
4698 | } | |
4699 | ||
51603483 DJ |
4700 | int |
4701 | gdbarch_frame_chain_valid_p (struct gdbarch *gdbarch) | |
4702 | { | |
4703 | gdb_assert (gdbarch != NULL); | |
4704 | return gdbarch->frame_chain_valid != 0; | |
4705 | } | |
4706 | ||
0f71a2f6 JM |
4707 | int |
4708 | gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe) | |
4709 | { | |
8de9bdc4 | 4710 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4711 | if (gdbarch->frame_chain_valid == 0) |
8e65ff28 AC |
4712 | internal_error (__FILE__, __LINE__, |
4713 | "gdbarch: gdbarch_frame_chain_valid invalid"); | |
0f71a2f6 | 4714 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4715 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n"); |
4716 | return gdbarch->frame_chain_valid (chain, thisframe); | |
4717 | } | |
4718 | ||
4719 | void | |
104c1213 JM |
4720 | set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, |
4721 | gdbarch_frame_chain_valid_ftype frame_chain_valid) | |
0f71a2f6 JM |
4722 | { |
4723 | gdbarch->frame_chain_valid = frame_chain_valid; | |
4724 | } | |
4725 | ||
d62d1979 AC |
4726 | int |
4727 | gdbarch_frame_saved_pc_p (struct gdbarch *gdbarch) | |
4728 | { | |
4729 | gdb_assert (gdbarch != NULL); | |
4730 | return gdbarch->frame_saved_pc != 0; | |
4731 | } | |
4732 | ||
0f71a2f6 JM |
4733 | CORE_ADDR |
4734 | gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi) | |
4735 | { | |
8de9bdc4 | 4736 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4737 | if (gdbarch->frame_saved_pc == 0) |
8e65ff28 AC |
4738 | internal_error (__FILE__, __LINE__, |
4739 | "gdbarch: gdbarch_frame_saved_pc invalid"); | |
0f71a2f6 | 4740 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4741 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n"); |
4742 | return gdbarch->frame_saved_pc (fi); | |
4743 | } | |
4744 | ||
4745 | void | |
104c1213 JM |
4746 | set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, |
4747 | gdbarch_frame_saved_pc_ftype frame_saved_pc) | |
0f71a2f6 JM |
4748 | { |
4749 | gdbarch->frame_saved_pc = frame_saved_pc; | |
4750 | } | |
4751 | ||
4752 | CORE_ADDR | |
4753 | gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi) | |
4754 | { | |
8de9bdc4 | 4755 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4756 | if (gdbarch->frame_args_address == 0) |
8e65ff28 AC |
4757 | internal_error (__FILE__, __LINE__, |
4758 | "gdbarch: gdbarch_frame_args_address invalid"); | |
0f71a2f6 | 4759 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4760 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n"); |
4761 | return gdbarch->frame_args_address (fi); | |
4762 | } | |
4763 | ||
4764 | void | |
104c1213 JM |
4765 | set_gdbarch_frame_args_address (struct gdbarch *gdbarch, |
4766 | gdbarch_frame_args_address_ftype frame_args_address) | |
0f71a2f6 JM |
4767 | { |
4768 | gdbarch->frame_args_address = frame_args_address; | |
4769 | } | |
4770 | ||
4771 | CORE_ADDR | |
4772 | gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi) | |
4773 | { | |
8de9bdc4 | 4774 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4775 | if (gdbarch->frame_locals_address == 0) |
8e65ff28 AC |
4776 | internal_error (__FILE__, __LINE__, |
4777 | "gdbarch: gdbarch_frame_locals_address invalid"); | |
0f71a2f6 | 4778 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4779 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n"); |
4780 | return gdbarch->frame_locals_address (fi); | |
4781 | } | |
4782 | ||
4783 | void | |
104c1213 JM |
4784 | set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, |
4785 | gdbarch_frame_locals_address_ftype frame_locals_address) | |
0f71a2f6 JM |
4786 | { |
4787 | gdbarch->frame_locals_address = frame_locals_address; | |
4788 | } | |
4789 | ||
4790 | CORE_ADDR | |
4791 | gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame) | |
4792 | { | |
8de9bdc4 | 4793 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4794 | if (gdbarch->saved_pc_after_call == 0) |
8e65ff28 AC |
4795 | internal_error (__FILE__, __LINE__, |
4796 | "gdbarch: gdbarch_saved_pc_after_call invalid"); | |
0f71a2f6 | 4797 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4798 | fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n"); |
4799 | return gdbarch->saved_pc_after_call (frame); | |
4800 | } | |
4801 | ||
4802 | void | |
104c1213 JM |
4803 | set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, |
4804 | gdbarch_saved_pc_after_call_ftype saved_pc_after_call) | |
0f71a2f6 JM |
4805 | { |
4806 | gdbarch->saved_pc_after_call = saved_pc_after_call; | |
4807 | } | |
4808 | ||
4809 | int | |
4810 | gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame) | |
4811 | { | |
8de9bdc4 | 4812 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 4813 | if (gdbarch->frame_num_args == 0) |
8e65ff28 AC |
4814 | internal_error (__FILE__, __LINE__, |
4815 | "gdbarch: gdbarch_frame_num_args invalid"); | |
0f71a2f6 | 4816 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4817 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n"); |
4818 | return gdbarch->frame_num_args (frame); | |
4819 | } | |
4820 | ||
4821 | void | |
104c1213 JM |
4822 | set_gdbarch_frame_num_args (struct gdbarch *gdbarch, |
4823 | gdbarch_frame_num_args_ftype frame_num_args) | |
0f71a2f6 JM |
4824 | { |
4825 | gdbarch->frame_num_args = frame_num_args; | |
4826 | } | |
4827 | ||
2ada493a AC |
4828 | int |
4829 | gdbarch_stack_align_p (struct gdbarch *gdbarch) | |
4830 | { | |
8de9bdc4 | 4831 | gdb_assert (gdbarch != NULL); |
2ada493a AC |
4832 | return gdbarch->stack_align != 0; |
4833 | } | |
4834 | ||
4835 | CORE_ADDR | |
4836 | gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp) | |
4837 | { | |
8de9bdc4 | 4838 | gdb_assert (gdbarch != NULL); |
2ada493a | 4839 | if (gdbarch->stack_align == 0) |
8e65ff28 AC |
4840 | internal_error (__FILE__, __LINE__, |
4841 | "gdbarch: gdbarch_stack_align invalid"); | |
2ada493a AC |
4842 | if (gdbarch_debug >= 2) |
4843 | fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n"); | |
4844 | return gdbarch->stack_align (sp); | |
4845 | } | |
4846 | ||
4847 | void | |
4848 | set_gdbarch_stack_align (struct gdbarch *gdbarch, | |
4849 | gdbarch_stack_align_ftype stack_align) | |
4850 | { | |
4851 | gdbarch->stack_align = stack_align; | |
4852 | } | |
4853 | ||
dc604539 AC |
4854 | int |
4855 | gdbarch_frame_align_p (struct gdbarch *gdbarch) | |
4856 | { | |
4857 | gdb_assert (gdbarch != NULL); | |
4858 | return gdbarch->frame_align != 0; | |
4859 | } | |
4860 | ||
4861 | CORE_ADDR | |
4862 | gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address) | |
4863 | { | |
4864 | gdb_assert (gdbarch != NULL); | |
4865 | if (gdbarch->frame_align == 0) | |
4866 | internal_error (__FILE__, __LINE__, | |
4867 | "gdbarch: gdbarch_frame_align invalid"); | |
4868 | if (gdbarch_debug >= 2) | |
4869 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n"); | |
4870 | return gdbarch->frame_align (gdbarch, address); | |
4871 | } | |
4872 | ||
4873 | void | |
4874 | set_gdbarch_frame_align (struct gdbarch *gdbarch, | |
4875 | gdbarch_frame_align_ftype frame_align) | |
4876 | { | |
4877 | gdbarch->frame_align = frame_align; | |
4878 | } | |
4879 | ||
1dd4193b AC |
4880 | int |
4881 | gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch) | |
4882 | { | |
8de9bdc4 | 4883 | gdb_assert (gdbarch != NULL); |
1dd4193b AC |
4884 | /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */ |
4885 | if (gdbarch_debug >= 2) | |
4886 | fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n"); | |
4887 | return gdbarch->extra_stack_alignment_needed; | |
4888 | } | |
4889 | ||
4890 | void | |
4891 | set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch, | |
4892 | int extra_stack_alignment_needed) | |
4893 | { | |
4894 | gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed; | |
4895 | } | |
4896 | ||
d03e67c9 AC |
4897 | int |
4898 | gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch) | |
4899 | { | |
8de9bdc4 | 4900 | gdb_assert (gdbarch != NULL); |
d03e67c9 AC |
4901 | return gdbarch->reg_struct_has_addr != 0; |
4902 | } | |
4903 | ||
4904 | int | |
4905 | gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type) | |
4906 | { | |
8de9bdc4 | 4907 | gdb_assert (gdbarch != NULL); |
d03e67c9 | 4908 | if (gdbarch->reg_struct_has_addr == 0) |
8e65ff28 AC |
4909 | internal_error (__FILE__, __LINE__, |
4910 | "gdbarch: gdbarch_reg_struct_has_addr invalid"); | |
d03e67c9 AC |
4911 | if (gdbarch_debug >= 2) |
4912 | fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n"); | |
4913 | return gdbarch->reg_struct_has_addr (gcc_p, type); | |
4914 | } | |
4915 | ||
4916 | void | |
4917 | set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, | |
4918 | gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr) | |
4919 | { | |
4920 | gdbarch->reg_struct_has_addr = reg_struct_has_addr; | |
4921 | } | |
4922 | ||
d1e3cf49 AC |
4923 | int |
4924 | gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch) | |
4925 | { | |
8de9bdc4 | 4926 | gdb_assert (gdbarch != NULL); |
d1e3cf49 AC |
4927 | return gdbarch->save_dummy_frame_tos != 0; |
4928 | } | |
4929 | ||
4930 | void | |
4931 | gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp) | |
4932 | { | |
8de9bdc4 | 4933 | gdb_assert (gdbarch != NULL); |
d1e3cf49 | 4934 | if (gdbarch->save_dummy_frame_tos == 0) |
8e65ff28 AC |
4935 | internal_error (__FILE__, __LINE__, |
4936 | "gdbarch: gdbarch_save_dummy_frame_tos invalid"); | |
d1e3cf49 AC |
4937 | if (gdbarch_debug >= 2) |
4938 | fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n"); | |
4939 | gdbarch->save_dummy_frame_tos (sp); | |
4940 | } | |
4941 | ||
4942 | void | |
4943 | set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, | |
4944 | gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos) | |
4945 | { | |
4946 | gdbarch->save_dummy_frame_tos = save_dummy_frame_tos; | |
4947 | } | |
4948 | ||
58d5518e ND |
4949 | int |
4950 | gdbarch_parm_boundary (struct gdbarch *gdbarch) | |
4951 | { | |
8de9bdc4 | 4952 | gdb_assert (gdbarch != NULL); |
58d5518e ND |
4953 | if (gdbarch_debug >= 2) |
4954 | fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n"); | |
4955 | return gdbarch->parm_boundary; | |
4956 | } | |
4957 | ||
4958 | void | |
4959 | set_gdbarch_parm_boundary (struct gdbarch *gdbarch, | |
4960 | int parm_boundary) | |
4961 | { | |
4962 | gdbarch->parm_boundary = parm_boundary; | |
4963 | } | |
4964 | ||
f0d4cc9e AC |
4965 | const struct floatformat * |
4966 | gdbarch_float_format (struct gdbarch *gdbarch) | |
4967 | { | |
8de9bdc4 | 4968 | gdb_assert (gdbarch != NULL); |
f0d4cc9e AC |
4969 | if (gdbarch_debug >= 2) |
4970 | fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n"); | |
4971 | return gdbarch->float_format; | |
4972 | } | |
4973 | ||
4974 | void | |
4975 | set_gdbarch_float_format (struct gdbarch *gdbarch, | |
4976 | const struct floatformat * float_format) | |
4977 | { | |
4978 | gdbarch->float_format = float_format; | |
4979 | } | |
4980 | ||
4981 | const struct floatformat * | |
4982 | gdbarch_double_format (struct gdbarch *gdbarch) | |
4983 | { | |
8de9bdc4 | 4984 | gdb_assert (gdbarch != NULL); |
f0d4cc9e AC |
4985 | if (gdbarch_debug >= 2) |
4986 | fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n"); | |
4987 | return gdbarch->double_format; | |
4988 | } | |
4989 | ||
4990 | void | |
4991 | set_gdbarch_double_format (struct gdbarch *gdbarch, | |
4992 | const struct floatformat * double_format) | |
4993 | { | |
4994 | gdbarch->double_format = double_format; | |
4995 | } | |
4996 | ||
4997 | const struct floatformat * | |
4998 | gdbarch_long_double_format (struct gdbarch *gdbarch) | |
4999 | { | |
8de9bdc4 | 5000 | gdb_assert (gdbarch != NULL); |
f0d4cc9e AC |
5001 | if (gdbarch_debug >= 2) |
5002 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n"); | |
5003 | return gdbarch->long_double_format; | |
5004 | } | |
5005 | ||
5006 | void | |
5007 | set_gdbarch_long_double_format (struct gdbarch *gdbarch, | |
5008 | const struct floatformat * long_double_format) | |
5009 | { | |
5010 | gdbarch->long_double_format = long_double_format; | |
5011 | } | |
5012 | ||
f517ea4e PS |
5013 | CORE_ADDR |
5014 | gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr) | |
5015 | { | |
8de9bdc4 | 5016 | gdb_assert (gdbarch != NULL); |
f517ea4e | 5017 | if (gdbarch->convert_from_func_ptr_addr == 0) |
8e65ff28 AC |
5018 | internal_error (__FILE__, __LINE__, |
5019 | "gdbarch: gdbarch_convert_from_func_ptr_addr invalid"); | |
f517ea4e PS |
5020 | if (gdbarch_debug >= 2) |
5021 | fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n"); | |
5022 | return gdbarch->convert_from_func_ptr_addr (addr); | |
5023 | } | |
5024 | ||
5025 | void | |
5026 | set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, | |
5027 | gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr) | |
5028 | { | |
5029 | gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr; | |
5030 | } | |
5031 | ||
875e1767 AC |
5032 | CORE_ADDR |
5033 | gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr) | |
5034 | { | |
8de9bdc4 | 5035 | gdb_assert (gdbarch != NULL); |
875e1767 AC |
5036 | if (gdbarch->addr_bits_remove == 0) |
5037 | internal_error (__FILE__, __LINE__, | |
5038 | "gdbarch: gdbarch_addr_bits_remove invalid"); | |
5039 | if (gdbarch_debug >= 2) | |
5040 | fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n"); | |
5041 | return gdbarch->addr_bits_remove (addr); | |
5042 | } | |
5043 | ||
5044 | void | |
5045 | set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, | |
5046 | gdbarch_addr_bits_remove_ftype addr_bits_remove) | |
5047 | { | |
5048 | gdbarch->addr_bits_remove = addr_bits_remove; | |
5049 | } | |
5050 | ||
181c1381 RE |
5051 | CORE_ADDR |
5052 | gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr) | |
5053 | { | |
8de9bdc4 | 5054 | gdb_assert (gdbarch != NULL); |
181c1381 RE |
5055 | if (gdbarch->smash_text_address == 0) |
5056 | internal_error (__FILE__, __LINE__, | |
5057 | "gdbarch: gdbarch_smash_text_address invalid"); | |
5058 | if (gdbarch_debug >= 2) | |
5059 | fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n"); | |
5060 | return gdbarch->smash_text_address (addr); | |
5061 | } | |
5062 | ||
5063 | void | |
5064 | set_gdbarch_smash_text_address (struct gdbarch *gdbarch, | |
5065 | gdbarch_smash_text_address_ftype smash_text_address) | |
5066 | { | |
5067 | gdbarch->smash_text_address = smash_text_address; | |
5068 | } | |
5069 | ||
64c4637f AC |
5070 | int |
5071 | gdbarch_software_single_step_p (struct gdbarch *gdbarch) | |
5072 | { | |
8de9bdc4 | 5073 | gdb_assert (gdbarch != NULL); |
64c4637f AC |
5074 | return gdbarch->software_single_step != 0; |
5075 | } | |
5076 | ||
5077 | void | |
5078 | gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p) | |
5079 | { | |
8de9bdc4 | 5080 | gdb_assert (gdbarch != NULL); |
64c4637f AC |
5081 | if (gdbarch->software_single_step == 0) |
5082 | internal_error (__FILE__, __LINE__, | |
5083 | "gdbarch: gdbarch_software_single_step invalid"); | |
5084 | if (gdbarch_debug >= 2) | |
5085 | fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n"); | |
5086 | gdbarch->software_single_step (sig, insert_breakpoints_p); | |
5087 | } | |
5088 | ||
5089 | void | |
5090 | set_gdbarch_software_single_step (struct gdbarch *gdbarch, | |
5091 | gdbarch_software_single_step_ftype software_single_step) | |
5092 | { | |
5093 | gdbarch->software_single_step = software_single_step; | |
5094 | } | |
5095 | ||
2bf0cb65 EZ |
5096 | int |
5097 | gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info) | |
5098 | { | |
8de9bdc4 | 5099 | gdb_assert (gdbarch != NULL); |
2bf0cb65 EZ |
5100 | if (gdbarch->print_insn == 0) |
5101 | internal_error (__FILE__, __LINE__, | |
5102 | "gdbarch: gdbarch_print_insn invalid"); | |
5103 | if (gdbarch_debug >= 2) | |
5104 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n"); | |
5105 | return gdbarch->print_insn (vma, info); | |
5106 | } | |
5107 | ||
5108 | void | |
5109 | set_gdbarch_print_insn (struct gdbarch *gdbarch, | |
5110 | gdbarch_print_insn_ftype print_insn) | |
5111 | { | |
5112 | gdbarch->print_insn = print_insn; | |
5113 | } | |
5114 | ||
bdcd319a CV |
5115 | CORE_ADDR |
5116 | gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc) | |
5117 | { | |
8de9bdc4 | 5118 | gdb_assert (gdbarch != NULL); |
bdcd319a CV |
5119 | if (gdbarch->skip_trampoline_code == 0) |
5120 | internal_error (__FILE__, __LINE__, | |
5121 | "gdbarch: gdbarch_skip_trampoline_code invalid"); | |
5122 | if (gdbarch_debug >= 2) | |
5123 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n"); | |
5124 | return gdbarch->skip_trampoline_code (pc); | |
5125 | } | |
5126 | ||
5127 | void | |
5128 | set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, | |
5129 | gdbarch_skip_trampoline_code_ftype skip_trampoline_code) | |
5130 | { | |
5131 | gdbarch->skip_trampoline_code = skip_trampoline_code; | |
5132 | } | |
5133 | ||
68e9cc94 CV |
5134 | int |
5135 | gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name) | |
5136 | { | |
8de9bdc4 | 5137 | gdb_assert (gdbarch != NULL); |
68e9cc94 CV |
5138 | if (gdbarch->in_solib_call_trampoline == 0) |
5139 | internal_error (__FILE__, __LINE__, | |
5140 | "gdbarch: gdbarch_in_solib_call_trampoline invalid"); | |
5141 | if (gdbarch_debug >= 2) | |
5142 | fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_call_trampoline called\n"); | |
5143 | return gdbarch->in_solib_call_trampoline (pc, name); | |
5144 | } | |
5145 | ||
5146 | void | |
5147 | set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, | |
5148 | gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline) | |
5149 | { | |
5150 | gdbarch->in_solib_call_trampoline = in_solib_call_trampoline; | |
5151 | } | |
5152 | ||
d50355b6 MS |
5153 | int |
5154 | gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name) | |
5155 | { | |
5156 | gdb_assert (gdbarch != NULL); | |
5157 | if (gdbarch->in_solib_return_trampoline == 0) | |
5158 | internal_error (__FILE__, __LINE__, | |
5159 | "gdbarch: gdbarch_in_solib_return_trampoline invalid"); | |
5160 | if (gdbarch_debug >= 2) | |
5161 | fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n"); | |
5162 | return gdbarch->in_solib_return_trampoline (pc, name); | |
5163 | } | |
5164 | ||
5165 | void | |
5166 | set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, | |
5167 | gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline) | |
5168 | { | |
5169 | gdbarch->in_solib_return_trampoline = in_solib_return_trampoline; | |
5170 | } | |
5171 | ||
d7bd68ca AC |
5172 | int |
5173 | gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name) | |
5174 | { | |
8de9bdc4 | 5175 | gdb_assert (gdbarch != NULL); |
d7bd68ca AC |
5176 | if (gdbarch->pc_in_sigtramp == 0) |
5177 | internal_error (__FILE__, __LINE__, | |
5178 | "gdbarch: gdbarch_pc_in_sigtramp invalid"); | |
5179 | if (gdbarch_debug >= 2) | |
5180 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_sigtramp called\n"); | |
5181 | return gdbarch->pc_in_sigtramp (pc, name); | |
5182 | } | |
5183 | ||
5184 | void | |
5185 | set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, | |
5186 | gdbarch_pc_in_sigtramp_ftype pc_in_sigtramp) | |
5187 | { | |
5188 | gdbarch->pc_in_sigtramp = pc_in_sigtramp; | |
5189 | } | |
5190 | ||
43156d82 MK |
5191 | int |
5192 | gdbarch_sigtramp_start_p (struct gdbarch *gdbarch) | |
5193 | { | |
5194 | gdb_assert (gdbarch != NULL); | |
5195 | return gdbarch->sigtramp_start != 0; | |
5196 | } | |
5197 | ||
5198 | CORE_ADDR | |
5199 | gdbarch_sigtramp_start (struct gdbarch *gdbarch, CORE_ADDR pc) | |
5200 | { | |
5201 | gdb_assert (gdbarch != NULL); | |
5202 | if (gdbarch->sigtramp_start == 0) | |
5203 | internal_error (__FILE__, __LINE__, | |
5204 | "gdbarch: gdbarch_sigtramp_start invalid"); | |
5205 | if (gdbarch_debug >= 2) | |
5206 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sigtramp_start called\n"); | |
5207 | return gdbarch->sigtramp_start (pc); | |
5208 | } | |
5209 | ||
5210 | void | |
5211 | set_gdbarch_sigtramp_start (struct gdbarch *gdbarch, | |
5212 | gdbarch_sigtramp_start_ftype sigtramp_start) | |
5213 | { | |
5214 | gdbarch->sigtramp_start = sigtramp_start; | |
5215 | } | |
5216 | ||
e76cff22 AC |
5217 | int |
5218 | gdbarch_sigtramp_end_p (struct gdbarch *gdbarch) | |
5219 | { | |
5220 | gdb_assert (gdbarch != NULL); | |
5221 | return gdbarch->sigtramp_end != 0; | |
5222 | } | |
5223 | ||
43156d82 MK |
5224 | CORE_ADDR |
5225 | gdbarch_sigtramp_end (struct gdbarch *gdbarch, CORE_ADDR pc) | |
5226 | { | |
5227 | gdb_assert (gdbarch != NULL); | |
5228 | if (gdbarch->sigtramp_end == 0) | |
5229 | internal_error (__FILE__, __LINE__, | |
5230 | "gdbarch: gdbarch_sigtramp_end invalid"); | |
5231 | if (gdbarch_debug >= 2) | |
5232 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sigtramp_end called\n"); | |
5233 | return gdbarch->sigtramp_end (pc); | |
5234 | } | |
5235 | ||
5236 | void | |
5237 | set_gdbarch_sigtramp_end (struct gdbarch *gdbarch, | |
5238 | gdbarch_sigtramp_end_ftype sigtramp_end) | |
5239 | { | |
5240 | gdbarch->sigtramp_end = sigtramp_end; | |
5241 | } | |
5242 | ||
c12260ac CV |
5243 | int |
5244 | gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr) | |
5245 | { | |
8de9bdc4 | 5246 | gdb_assert (gdbarch != NULL); |
c12260ac CV |
5247 | if (gdbarch->in_function_epilogue_p == 0) |
5248 | internal_error (__FILE__, __LINE__, | |
5249 | "gdbarch: gdbarch_in_function_epilogue_p invalid"); | |
5250 | if (gdbarch_debug >= 2) | |
5251 | fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n"); | |
5252 | return gdbarch->in_function_epilogue_p (gdbarch, addr); | |
5253 | } | |
5254 | ||
5255 | void | |
5256 | set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, | |
5257 | gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p) | |
5258 | { | |
5259 | gdbarch->in_function_epilogue_p = in_function_epilogue_p; | |
5260 | } | |
5261 | ||
552c04a7 TT |
5262 | char * |
5263 | gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv) | |
5264 | { | |
8de9bdc4 | 5265 | gdb_assert (gdbarch != NULL); |
552c04a7 TT |
5266 | if (gdbarch->construct_inferior_arguments == 0) |
5267 | internal_error (__FILE__, __LINE__, | |
5268 | "gdbarch: gdbarch_construct_inferior_arguments invalid"); | |
5269 | if (gdbarch_debug >= 2) | |
5270 | fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n"); | |
5271 | return gdbarch->construct_inferior_arguments (gdbarch, argc, argv); | |
5272 | } | |
5273 | ||
5274 | void | |
5275 | set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, | |
5276 | gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments) | |
5277 | { | |
5278 | gdbarch->construct_inferior_arguments = construct_inferior_arguments; | |
5279 | } | |
5280 | ||
b6af0555 JS |
5281 | int |
5282 | gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch) | |
5283 | { | |
8de9bdc4 | 5284 | gdb_assert (gdbarch != NULL); |
b6af0555 JS |
5285 | return gdbarch->dwarf2_build_frame_info != 0; |
5286 | } | |
5287 | ||
5288 | void | |
5289 | gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile) | |
5290 | { | |
8de9bdc4 | 5291 | gdb_assert (gdbarch != NULL); |
b6af0555 JS |
5292 | if (gdbarch->dwarf2_build_frame_info == 0) |
5293 | internal_error (__FILE__, __LINE__, | |
5294 | "gdbarch: gdbarch_dwarf2_build_frame_info invalid"); | |
5295 | if (gdbarch_debug >= 2) | |
5296 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_build_frame_info called\n"); | |
5297 | gdbarch->dwarf2_build_frame_info (objfile); | |
5298 | } | |
5299 | ||
5300 | void | |
5301 | set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, | |
5302 | gdbarch_dwarf2_build_frame_info_ftype dwarf2_build_frame_info) | |
5303 | { | |
5304 | gdbarch->dwarf2_build_frame_info = dwarf2_build_frame_info; | |
5305 | } | |
5306 | ||
a2cf933a EZ |
5307 | void |
5308 | gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym) | |
5309 | { | |
8de9bdc4 | 5310 | gdb_assert (gdbarch != NULL); |
a2cf933a EZ |
5311 | if (gdbarch->elf_make_msymbol_special == 0) |
5312 | internal_error (__FILE__, __LINE__, | |
5313 | "gdbarch: gdbarch_elf_make_msymbol_special invalid"); | |
5314 | if (gdbarch_debug >= 2) | |
5315 | fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n"); | |
5316 | gdbarch->elf_make_msymbol_special (sym, msym); | |
5317 | } | |
5318 | ||
5319 | void | |
5320 | set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, | |
5321 | gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special) | |
5322 | { | |
5323 | gdbarch->elf_make_msymbol_special = elf_make_msymbol_special; | |
5324 | } | |
5325 | ||
5326 | void | |
5327 | gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym) | |
5328 | { | |
8de9bdc4 | 5329 | gdb_assert (gdbarch != NULL); |
a2cf933a EZ |
5330 | if (gdbarch->coff_make_msymbol_special == 0) |
5331 | internal_error (__FILE__, __LINE__, | |
5332 | "gdbarch: gdbarch_coff_make_msymbol_special invalid"); | |
5333 | if (gdbarch_debug >= 2) | |
5334 | fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n"); | |
5335 | gdbarch->coff_make_msymbol_special (val, msym); | |
5336 | } | |
5337 | ||
5338 | void | |
5339 | set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, | |
5340 | gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special) | |
5341 | { | |
5342 | gdbarch->coff_make_msymbol_special = coff_make_msymbol_special; | |
5343 | } | |
5344 | ||
5720643c JB |
5345 | const char * |
5346 | gdbarch_name_of_malloc (struct gdbarch *gdbarch) | |
5347 | { | |
5348 | gdb_assert (gdbarch != NULL); | |
5349 | /* Skip verify of name_of_malloc, invalid_p == 0 */ | |
5350 | if (gdbarch_debug >= 2) | |
5351 | fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n"); | |
5352 | return gdbarch->name_of_malloc; | |
5353 | } | |
5354 | ||
5355 | void | |
5356 | set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, | |
5357 | const char * name_of_malloc) | |
5358 | { | |
5359 | gdbarch->name_of_malloc = name_of_malloc; | |
5360 | } | |
5361 | ||
c4ed33b9 AC |
5362 | int |
5363 | gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch) | |
5364 | { | |
5365 | gdb_assert (gdbarch != NULL); | |
5366 | /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */ | |
5367 | if (gdbarch_debug >= 2) | |
5368 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n"); | |
5369 | return gdbarch->cannot_step_breakpoint; | |
5370 | } | |
5371 | ||
5372 | void | |
5373 | set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, | |
5374 | int cannot_step_breakpoint) | |
5375 | { | |
5376 | gdbarch->cannot_step_breakpoint = cannot_step_breakpoint; | |
5377 | } | |
5378 | ||
f74fa174 MM |
5379 | int |
5380 | gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch) | |
5381 | { | |
5382 | gdb_assert (gdbarch != NULL); | |
5383 | /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */ | |
5384 | if (gdbarch_debug >= 2) | |
5385 | fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n"); | |
5386 | return gdbarch->have_nonsteppable_watchpoint; | |
5387 | } | |
5388 | ||
5389 | void | |
5390 | set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, | |
967c0d83 | 5391 | int have_nonsteppable_watchpoint) |
f74fa174 MM |
5392 | { |
5393 | gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint; | |
5394 | } | |
5395 | ||
8b2dbe47 KB |
5396 | int |
5397 | gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch) | |
5398 | { | |
5399 | gdb_assert (gdbarch != NULL); | |
5400 | return gdbarch->address_class_type_flags != 0; | |
5401 | } | |
5402 | ||
5403 | int | |
5404 | gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class) | |
5405 | { | |
5406 | gdb_assert (gdbarch != NULL); | |
5407 | if (gdbarch->address_class_type_flags == 0) | |
5408 | internal_error (__FILE__, __LINE__, | |
5409 | "gdbarch: gdbarch_address_class_type_flags invalid"); | |
5410 | if (gdbarch_debug >= 2) | |
5411 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n"); | |
5412 | return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class); | |
5413 | } | |
5414 | ||
5415 | void | |
5416 | set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, | |
5417 | gdbarch_address_class_type_flags_ftype address_class_type_flags) | |
5418 | { | |
5419 | gdbarch->address_class_type_flags = address_class_type_flags; | |
5420 | } | |
5421 | ||
5422 | int | |
5423 | gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch) | |
5424 | { | |
5425 | gdb_assert (gdbarch != NULL); | |
5426 | return gdbarch->address_class_type_flags_to_name != 0; | |
5427 | } | |
5428 | ||
321432c0 | 5429 | const char * |
8b2dbe47 KB |
5430 | gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags) |
5431 | { | |
5432 | gdb_assert (gdbarch != NULL); | |
5433 | if (gdbarch->address_class_type_flags_to_name == 0) | |
5434 | internal_error (__FILE__, __LINE__, | |
5435 | "gdbarch: gdbarch_address_class_type_flags_to_name invalid"); | |
5436 | if (gdbarch_debug >= 2) | |
5437 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n"); | |
5f11f355 | 5438 | return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags); |
8b2dbe47 KB |
5439 | } |
5440 | ||
5441 | void | |
5442 | set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, | |
5443 | gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name) | |
5444 | { | |
5445 | gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name; | |
5446 | } | |
5447 | ||
5448 | int | |
5449 | gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch) | |
5450 | { | |
5451 | gdb_assert (gdbarch != NULL); | |
5452 | return gdbarch->address_class_name_to_type_flags != 0; | |
5453 | } | |
5454 | ||
5455 | int | |
321432c0 | 5456 | gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr) |
8b2dbe47 KB |
5457 | { |
5458 | gdb_assert (gdbarch != NULL); | |
5459 | if (gdbarch->address_class_name_to_type_flags == 0) | |
5460 | internal_error (__FILE__, __LINE__, | |
5461 | "gdbarch: gdbarch_address_class_name_to_type_flags invalid"); | |
5462 | if (gdbarch_debug >= 2) | |
5463 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n"); | |
5f11f355 | 5464 | return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr); |
8b2dbe47 KB |
5465 | } |
5466 | ||
5467 | void | |
5468 | set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, | |
5469 | gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags) | |
5470 | { | |
5471 | gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags; | |
5472 | } | |
5473 | ||
b59ff9d5 AC |
5474 | int |
5475 | gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup) | |
5476 | { | |
5477 | gdb_assert (gdbarch != NULL); | |
5478 | if (gdbarch->register_reggroup_p == 0) | |
5479 | internal_error (__FILE__, __LINE__, | |
5480 | "gdbarch: gdbarch_register_reggroup_p invalid"); | |
5481 | if (gdbarch_debug >= 2) | |
5482 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n"); | |
5483 | return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup); | |
5484 | } | |
5485 | ||
5486 | void | |
5487 | set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, | |
5488 | gdbarch_register_reggroup_p_ftype register_reggroup_p) | |
5489 | { | |
5490 | gdbarch->register_reggroup_p = register_reggroup_p; | |
5491 | } | |
5492 | ||
0f71a2f6 | 5493 | |
be5a57e1 | 5494 | /* Keep a registry of per-architecture data-pointers required by GDB |
0f71a2f6 JM |
5495 | modules. */ |
5496 | ||
5497 | struct gdbarch_data | |
5498 | { | |
95160752 | 5499 | unsigned index; |
76860b5f | 5500 | int init_p; |
95160752 AC |
5501 | gdbarch_data_init_ftype *init; |
5502 | gdbarch_data_free_ftype *free; | |
0f71a2f6 JM |
5503 | }; |
5504 | ||
5505 | struct gdbarch_data_registration | |
adf40b2e | 5506 | { |
adf40b2e JM |
5507 | struct gdbarch_data *data; |
5508 | struct gdbarch_data_registration *next; | |
5509 | }; | |
0f71a2f6 | 5510 | |
be5a57e1 | 5511 | struct gdbarch_data_registry |
adf40b2e | 5512 | { |
95160752 | 5513 | unsigned nr; |
adf40b2e JM |
5514 | struct gdbarch_data_registration *registrations; |
5515 | }; | |
0f71a2f6 | 5516 | |
be5a57e1 | 5517 | struct gdbarch_data_registry gdbarch_data_registry = |
0f71a2f6 JM |
5518 | { |
5519 | 0, NULL, | |
5520 | }; | |
5521 | ||
5522 | struct gdbarch_data * | |
95160752 AC |
5523 | register_gdbarch_data (gdbarch_data_init_ftype *init, |
5524 | gdbarch_data_free_ftype *free) | |
0f71a2f6 JM |
5525 | { |
5526 | struct gdbarch_data_registration **curr; | |
76860b5f | 5527 | /* Append the new registraration. */ |
be5a57e1 | 5528 | for (curr = &gdbarch_data_registry.registrations; |
0f71a2f6 JM |
5529 | (*curr) != NULL; |
5530 | curr = &(*curr)->next); | |
5531 | (*curr) = XMALLOC (struct gdbarch_data_registration); | |
5532 | (*curr)->next = NULL; | |
0f71a2f6 | 5533 | (*curr)->data = XMALLOC (struct gdbarch_data); |
be5a57e1 | 5534 | (*curr)->data->index = gdbarch_data_registry.nr++; |
95160752 | 5535 | (*curr)->data->init = init; |
76860b5f | 5536 | (*curr)->data->init_p = 1; |
95160752 | 5537 | (*curr)->data->free = free; |
0f71a2f6 JM |
5538 | return (*curr)->data; |
5539 | } | |
5540 | ||
5541 | ||
b3cc3077 | 5542 | /* Create/delete the gdbarch data vector. */ |
95160752 AC |
5543 | |
5544 | static void | |
b3cc3077 | 5545 | alloc_gdbarch_data (struct gdbarch *gdbarch) |
95160752 | 5546 | { |
b3cc3077 JB |
5547 | gdb_assert (gdbarch->data == NULL); |
5548 | gdbarch->nr_data = gdbarch_data_registry.nr; | |
5549 | gdbarch->data = xcalloc (gdbarch->nr_data, sizeof (void*)); | |
5550 | } | |
3c875b6f | 5551 | |
b3cc3077 JB |
5552 | static void |
5553 | free_gdbarch_data (struct gdbarch *gdbarch) | |
5554 | { | |
5555 | struct gdbarch_data_registration *rego; | |
5556 | gdb_assert (gdbarch->data != NULL); | |
5557 | for (rego = gdbarch_data_registry.registrations; | |
5558 | rego != NULL; | |
5559 | rego = rego->next) | |
95160752 | 5560 | { |
b3cc3077 JB |
5561 | struct gdbarch_data *data = rego->data; |
5562 | gdb_assert (data->index < gdbarch->nr_data); | |
5563 | if (data->free != NULL && gdbarch->data[data->index] != NULL) | |
95160752 | 5564 | { |
b3cc3077 JB |
5565 | data->free (gdbarch, gdbarch->data[data->index]); |
5566 | gdbarch->data[data->index] = NULL; | |
95160752 | 5567 | } |
0f71a2f6 | 5568 | } |
b3cc3077 JB |
5569 | xfree (gdbarch->data); |
5570 | gdbarch->data = NULL; | |
0f71a2f6 JM |
5571 | } |
5572 | ||
5573 | ||
76860b5f | 5574 | /* Initialize the current value of the specified per-architecture |
b3cc3077 JB |
5575 | data-pointer. */ |
5576 | ||
95160752 AC |
5577 | void |
5578 | set_gdbarch_data (struct gdbarch *gdbarch, | |
5579 | struct gdbarch_data *data, | |
5580 | void *pointer) | |
5581 | { | |
5582 | gdb_assert (data->index < gdbarch->nr_data); | |
76860b5f AC |
5583 | if (gdbarch->data[data->index] != NULL) |
5584 | { | |
5585 | gdb_assert (data->free != NULL); | |
5586 | data->free (gdbarch, gdbarch->data[data->index]); | |
5587 | } | |
95160752 AC |
5588 | gdbarch->data[data->index] = pointer; |
5589 | } | |
5590 | ||
0f71a2f6 JM |
5591 | /* Return the current value of the specified per-architecture |
5592 | data-pointer. */ | |
5593 | ||
5594 | void * | |
451fbdda | 5595 | gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data) |
0f71a2f6 | 5596 | { |
451fbdda | 5597 | gdb_assert (data->index < gdbarch->nr_data); |
76860b5f AC |
5598 | /* The data-pointer isn't initialized, call init() to get a value but |
5599 | only if the architecture initializaiton has completed. Otherwise | |
5600 | punt - hope that the caller knows what they are doing. */ | |
5601 | if (gdbarch->data[data->index] == NULL | |
5602 | && gdbarch->initialized_p) | |
5603 | { | |
5604 | /* Be careful to detect an initialization cycle. */ | |
5605 | gdb_assert (data->init_p); | |
5606 | data->init_p = 0; | |
5607 | gdb_assert (data->init != NULL); | |
5608 | gdbarch->data[data->index] = data->init (gdbarch); | |
5609 | data->init_p = 1; | |
5610 | gdb_assert (gdbarch->data[data->index] != NULL); | |
5611 | } | |
451fbdda | 5612 | return gdbarch->data[data->index]; |
0f71a2f6 JM |
5613 | } |
5614 | ||
5615 | ||
5616 | ||
be5a57e1 | 5617 | /* Keep a registry of swapped data required by GDB modules. */ |
0f71a2f6 JM |
5618 | |
5619 | struct gdbarch_swap | |
5620 | { | |
5621 | void *swap; | |
5622 | struct gdbarch_swap_registration *source; | |
5623 | struct gdbarch_swap *next; | |
5624 | }; | |
5625 | ||
5626 | struct gdbarch_swap_registration | |
adf40b2e JM |
5627 | { |
5628 | void *data; | |
5629 | unsigned long sizeof_data; | |
5630 | gdbarch_swap_ftype *init; | |
5631 | struct gdbarch_swap_registration *next; | |
5632 | }; | |
0f71a2f6 | 5633 | |
be5a57e1 | 5634 | struct gdbarch_swap_registry |
adf40b2e JM |
5635 | { |
5636 | int nr; | |
5637 | struct gdbarch_swap_registration *registrations; | |
5638 | }; | |
0f71a2f6 | 5639 | |
be5a57e1 | 5640 | struct gdbarch_swap_registry gdbarch_swap_registry = |
0f71a2f6 JM |
5641 | { |
5642 | 0, NULL, | |
5643 | }; | |
5644 | ||
5645 | void | |
104c1213 JM |
5646 | register_gdbarch_swap (void *data, |
5647 | unsigned long sizeof_data, | |
5648 | gdbarch_swap_ftype *init) | |
0f71a2f6 JM |
5649 | { |
5650 | struct gdbarch_swap_registration **rego; | |
be5a57e1 | 5651 | for (rego = &gdbarch_swap_registry.registrations; |
0f71a2f6 JM |
5652 | (*rego) != NULL; |
5653 | rego = &(*rego)->next); | |
5654 | (*rego) = XMALLOC (struct gdbarch_swap_registration); | |
5655 | (*rego)->next = NULL; | |
5656 | (*rego)->init = init; | |
5657 | (*rego)->data = data; | |
5658 | (*rego)->sizeof_data = sizeof_data; | |
5659 | } | |
5660 | ||
40af4b0c AC |
5661 | static void |
5662 | clear_gdbarch_swap (struct gdbarch *gdbarch) | |
5663 | { | |
5664 | struct gdbarch_swap *curr; | |
5665 | for (curr = gdbarch->swap; | |
5666 | curr != NULL; | |
5667 | curr = curr->next) | |
5668 | { | |
5669 | memset (curr->source->data, 0, curr->source->sizeof_data); | |
5670 | } | |
5671 | } | |
0f71a2f6 | 5672 | |
0f71a2f6 | 5673 | static void |
104c1213 | 5674 | init_gdbarch_swap (struct gdbarch *gdbarch) |
0f71a2f6 JM |
5675 | { |
5676 | struct gdbarch_swap_registration *rego; | |
5677 | struct gdbarch_swap **curr = &gdbarch->swap; | |
be5a57e1 | 5678 | for (rego = gdbarch_swap_registry.registrations; |
0f71a2f6 JM |
5679 | rego != NULL; |
5680 | rego = rego->next) | |
5681 | { | |
5682 | if (rego->data != NULL) | |
5683 | { | |
5684 | (*curr) = XMALLOC (struct gdbarch_swap); | |
5685 | (*curr)->source = rego; | |
5686 | (*curr)->swap = xmalloc (rego->sizeof_data); | |
5687 | (*curr)->next = NULL; | |
0f71a2f6 JM |
5688 | curr = &(*curr)->next; |
5689 | } | |
5690 | if (rego->init != NULL) | |
5691 | rego->init (); | |
5692 | } | |
5693 | } | |
5694 | ||
0f71a2f6 | 5695 | static void |
104c1213 | 5696 | swapout_gdbarch_swap (struct gdbarch *gdbarch) |
0f71a2f6 JM |
5697 | { |
5698 | struct gdbarch_swap *curr; | |
5699 | for (curr = gdbarch->swap; | |
5700 | curr != NULL; | |
5701 | curr = curr->next) | |
5702 | memcpy (curr->swap, curr->source->data, curr->source->sizeof_data); | |
5703 | } | |
5704 | ||
0f71a2f6 | 5705 | static void |
104c1213 | 5706 | swapin_gdbarch_swap (struct gdbarch *gdbarch) |
0f71a2f6 JM |
5707 | { |
5708 | struct gdbarch_swap *curr; | |
5709 | for (curr = gdbarch->swap; | |
5710 | curr != NULL; | |
5711 | curr = curr->next) | |
5712 | memcpy (curr->source->data, curr->swap, curr->source->sizeof_data); | |
5713 | } | |
5714 | ||
5715 | ||
be5a57e1 | 5716 | /* Keep a registry of the architectures known by GDB. */ |
0f71a2f6 | 5717 | |
4b9b3959 | 5718 | struct gdbarch_registration |
0f71a2f6 JM |
5719 | { |
5720 | enum bfd_architecture bfd_architecture; | |
5721 | gdbarch_init_ftype *init; | |
4b9b3959 | 5722 | gdbarch_dump_tdep_ftype *dump_tdep; |
0f71a2f6 | 5723 | struct gdbarch_list *arches; |
4b9b3959 | 5724 | struct gdbarch_registration *next; |
0f71a2f6 JM |
5725 | }; |
5726 | ||
be5a57e1 | 5727 | static struct gdbarch_registration *gdbarch_registry = NULL; |
0f71a2f6 | 5728 | |
b4a20239 AC |
5729 | static void |
5730 | append_name (const char ***buf, int *nr, const char *name) | |
5731 | { | |
5732 | *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1)); | |
5733 | (*buf)[*nr] = name; | |
5734 | *nr += 1; | |
5735 | } | |
5736 | ||
5737 | const char ** | |
5738 | gdbarch_printable_names (void) | |
5739 | { | |
5740 | if (GDB_MULTI_ARCH) | |
5741 | { | |
5742 | /* Accumulate a list of names based on the registed list of | |
5743 | architectures. */ | |
5744 | enum bfd_architecture a; | |
5745 | int nr_arches = 0; | |
5746 | const char **arches = NULL; | |
4b9b3959 | 5747 | struct gdbarch_registration *rego; |
be5a57e1 | 5748 | for (rego = gdbarch_registry; |
b4a20239 AC |
5749 | rego != NULL; |
5750 | rego = rego->next) | |
5751 | { | |
5752 | const struct bfd_arch_info *ap; | |
5753 | ap = bfd_lookup_arch (rego->bfd_architecture, 0); | |
5754 | if (ap == NULL) | |
8e65ff28 AC |
5755 | internal_error (__FILE__, __LINE__, |
5756 | "gdbarch_architecture_names: multi-arch unknown"); | |
b4a20239 AC |
5757 | do |
5758 | { | |
5759 | append_name (&arches, &nr_arches, ap->printable_name); | |
5760 | ap = ap->next; | |
5761 | } | |
5762 | while (ap != NULL); | |
5763 | } | |
5764 | append_name (&arches, &nr_arches, NULL); | |
5765 | return arches; | |
5766 | } | |
5767 | else | |
5768 | /* Just return all the architectures that BFD knows. Assume that | |
5769 | the legacy architecture framework supports them. */ | |
5770 | return bfd_arch_list (); | |
5771 | } | |
5772 | ||
5773 | ||
0f71a2f6 | 5774 | void |
4b9b3959 AC |
5775 | gdbarch_register (enum bfd_architecture bfd_architecture, |
5776 | gdbarch_init_ftype *init, | |
5777 | gdbarch_dump_tdep_ftype *dump_tdep) | |
0f71a2f6 | 5778 | { |
4b9b3959 | 5779 | struct gdbarch_registration **curr; |
0f71a2f6 | 5780 | const struct bfd_arch_info *bfd_arch_info; |
ec3d358c | 5781 | /* Check that BFD recognizes this architecture */ |
0f71a2f6 JM |
5782 | bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0); |
5783 | if (bfd_arch_info == NULL) | |
5784 | { | |
8e65ff28 AC |
5785 | internal_error (__FILE__, __LINE__, |
5786 | "gdbarch: Attempt to register unknown architecture (%d)", | |
5787 | bfd_architecture); | |
0f71a2f6 JM |
5788 | } |
5789 | /* Check that we haven't seen this architecture before */ | |
be5a57e1 | 5790 | for (curr = &gdbarch_registry; |
0f71a2f6 JM |
5791 | (*curr) != NULL; |
5792 | curr = &(*curr)->next) | |
5793 | { | |
5794 | if (bfd_architecture == (*curr)->bfd_architecture) | |
8e65ff28 AC |
5795 | internal_error (__FILE__, __LINE__, |
5796 | "gdbarch: Duplicate registraration of architecture (%s)", | |
5797 | bfd_arch_info->printable_name); | |
0f71a2f6 JM |
5798 | } |
5799 | /* log it */ | |
5800 | if (gdbarch_debug) | |
5801 | fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n", | |
5802 | bfd_arch_info->printable_name, | |
5803 | (long) init); | |
5804 | /* Append it */ | |
4b9b3959 | 5805 | (*curr) = XMALLOC (struct gdbarch_registration); |
0f71a2f6 JM |
5806 | (*curr)->bfd_architecture = bfd_architecture; |
5807 | (*curr)->init = init; | |
4b9b3959 | 5808 | (*curr)->dump_tdep = dump_tdep; |
0f71a2f6 JM |
5809 | (*curr)->arches = NULL; |
5810 | (*curr)->next = NULL; | |
8e1a459b C |
5811 | /* When non- multi-arch, install whatever target dump routine we've |
5812 | been provided - hopefully that routine has been written correctly | |
4b9b3959 AC |
5813 | and works regardless of multi-arch. */ |
5814 | if (!GDB_MULTI_ARCH && dump_tdep != NULL | |
5815 | && startup_gdbarch.dump_tdep == NULL) | |
5816 | startup_gdbarch.dump_tdep = dump_tdep; | |
5817 | } | |
5818 | ||
5819 | void | |
5820 | register_gdbarch_init (enum bfd_architecture bfd_architecture, | |
5821 | gdbarch_init_ftype *init) | |
5822 | { | |
5823 | gdbarch_register (bfd_architecture, init, NULL); | |
0f71a2f6 | 5824 | } |
0f71a2f6 JM |
5825 | |
5826 | ||
5827 | /* Look for an architecture using gdbarch_info. Base search on only | |
5828 | BFD_ARCH_INFO and BYTE_ORDER. */ | |
5829 | ||
5830 | struct gdbarch_list * | |
104c1213 JM |
5831 | gdbarch_list_lookup_by_info (struct gdbarch_list *arches, |
5832 | const struct gdbarch_info *info) | |
0f71a2f6 JM |
5833 | { |
5834 | for (; arches != NULL; arches = arches->next) | |
5835 | { | |
5836 | if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info) | |
5837 | continue; | |
5838 | if (info->byte_order != arches->gdbarch->byte_order) | |
5839 | continue; | |
4be87837 DJ |
5840 | if (info->osabi != arches->gdbarch->osabi) |
5841 | continue; | |
0f71a2f6 JM |
5842 | return arches; |
5843 | } | |
5844 | return NULL; | |
5845 | } | |
5846 | ||
5847 | ||
5848 | /* Update the current architecture. Return ZERO if the update request | |
5849 | failed. */ | |
5850 | ||
5851 | int | |
16f33e29 | 5852 | gdbarch_update_p (struct gdbarch_info info) |
0f71a2f6 JM |
5853 | { |
5854 | struct gdbarch *new_gdbarch; | |
40af4b0c | 5855 | struct gdbarch *old_gdbarch; |
4b9b3959 | 5856 | struct gdbarch_registration *rego; |
0f71a2f6 | 5857 | |
b732d07d AC |
5858 | /* Fill in missing parts of the INFO struct using a number of |
5859 | sources: ``set ...''; INFOabfd supplied; existing target. */ | |
5860 | ||
5861 | /* ``(gdb) set architecture ...'' */ | |
5862 | if (info.bfd_arch_info == NULL | |
5863 | && !TARGET_ARCHITECTURE_AUTO) | |
5864 | info.bfd_arch_info = TARGET_ARCHITECTURE; | |
5865 | if (info.bfd_arch_info == NULL | |
5866 | && info.abfd != NULL | |
5867 | && bfd_get_arch (info.abfd) != bfd_arch_unknown | |
5868 | && bfd_get_arch (info.abfd) != bfd_arch_obscure) | |
5869 | info.bfd_arch_info = bfd_get_arch_info (info.abfd); | |
0f71a2f6 | 5870 | if (info.bfd_arch_info == NULL) |
b732d07d AC |
5871 | info.bfd_arch_info = TARGET_ARCHITECTURE; |
5872 | ||
5873 | /* ``(gdb) set byte-order ...'' */ | |
428721aa | 5874 | if (info.byte_order == BFD_ENDIAN_UNKNOWN |
b732d07d AC |
5875 | && !TARGET_BYTE_ORDER_AUTO) |
5876 | info.byte_order = TARGET_BYTE_ORDER; | |
5877 | /* From the INFO struct. */ | |
428721aa | 5878 | if (info.byte_order == BFD_ENDIAN_UNKNOWN |
b732d07d | 5879 | && info.abfd != NULL) |
d7449b42 | 5880 | info.byte_order = (bfd_big_endian (info.abfd) ? BFD_ENDIAN_BIG |
778eb05e | 5881 | : bfd_little_endian (info.abfd) ? BFD_ENDIAN_LITTLE |
428721aa | 5882 | : BFD_ENDIAN_UNKNOWN); |
b732d07d | 5883 | /* From the current target. */ |
428721aa | 5884 | if (info.byte_order == BFD_ENDIAN_UNKNOWN) |
b732d07d | 5885 | info.byte_order = TARGET_BYTE_ORDER; |
0f71a2f6 | 5886 | |
4be87837 DJ |
5887 | /* ``(gdb) set osabi ...'' is handled by gdbarch_lookup_osabi. */ |
5888 | if (info.osabi == GDB_OSABI_UNINITIALIZED) | |
5889 | info.osabi = gdbarch_lookup_osabi (info.abfd); | |
5890 | if (info.osabi == GDB_OSABI_UNINITIALIZED) | |
5891 | info.osabi = current_gdbarch->osabi; | |
5892 | ||
b732d07d AC |
5893 | /* Must have found some sort of architecture. */ |
5894 | gdb_assert (info.bfd_arch_info != NULL); | |
0f71a2f6 JM |
5895 | |
5896 | if (gdbarch_debug) | |
5897 | { | |
0f71a2f6 JM |
5898 | fprintf_unfiltered (gdb_stdlog, |
5899 | "gdbarch_update: info.bfd_arch_info %s\n", | |
5900 | (info.bfd_arch_info != NULL | |
5901 | ? info.bfd_arch_info->printable_name | |
5902 | : "(null)")); | |
5903 | fprintf_unfiltered (gdb_stdlog, | |
5904 | "gdbarch_update: info.byte_order %d (%s)\n", | |
5905 | info.byte_order, | |
d7449b42 | 5906 | (info.byte_order == BFD_ENDIAN_BIG ? "big" |
778eb05e | 5907 | : info.byte_order == BFD_ENDIAN_LITTLE ? "little" |
0f71a2f6 | 5908 | : "default")); |
4be87837 DJ |
5909 | fprintf_unfiltered (gdb_stdlog, |
5910 | "gdbarch_update: info.osabi %d (%s)\n", | |
5911 | info.osabi, gdbarch_osabi_name (info.osabi)); | |
0f71a2f6 JM |
5912 | fprintf_unfiltered (gdb_stdlog, |
5913 | "gdbarch_update: info.abfd 0x%lx\n", | |
5914 | (long) info.abfd); | |
5915 | fprintf_unfiltered (gdb_stdlog, | |
5916 | "gdbarch_update: info.tdep_info 0x%lx\n", | |
5917 | (long) info.tdep_info); | |
5918 | } | |
5919 | ||
b732d07d AC |
5920 | /* Find the target that knows about this architecture. */ |
5921 | for (rego = gdbarch_registry; | |
5922 | rego != NULL; | |
5923 | rego = rego->next) | |
5924 | if (rego->bfd_architecture == info.bfd_arch_info->arch) | |
5925 | break; | |
5926 | if (rego == NULL) | |
5927 | { | |
5928 | if (gdbarch_debug) | |
5929 | fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n"); | |
5930 | return 0; | |
5931 | } | |
5932 | ||
40af4b0c AC |
5933 | /* Swap the data belonging to the old target out setting the |
5934 | installed data to zero. This stops the ->init() function trying | |
5935 | to refer to the previous architecture's global data structures. */ | |
5936 | swapout_gdbarch_swap (current_gdbarch); | |
5937 | clear_gdbarch_swap (current_gdbarch); | |
5938 | ||
5939 | /* Save the previously selected architecture, setting the global to | |
5940 | NULL. This stops ->init() trying to use the previous | |
5941 | architecture's configuration. The previous architecture may not | |
5942 | even be of the same architecture family. The most recent | |
5943 | architecture of the same family is found at the head of the | |
5944 | rego->arches list. */ | |
5945 | old_gdbarch = current_gdbarch; | |
5946 | current_gdbarch = NULL; | |
5947 | ||
0f71a2f6 JM |
5948 | /* Ask the target for a replacement architecture. */ |
5949 | new_gdbarch = rego->init (info, rego->arches); | |
5950 | ||
40af4b0c AC |
5951 | /* Did the target like it? No. Reject the change and revert to the |
5952 | old architecture. */ | |
0f71a2f6 JM |
5953 | if (new_gdbarch == NULL) |
5954 | { | |
5955 | if (gdbarch_debug) | |
5956 | fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n"); | |
40af4b0c AC |
5957 | swapin_gdbarch_swap (old_gdbarch); |
5958 | current_gdbarch = old_gdbarch; | |
0f71a2f6 JM |
5959 | return 0; |
5960 | } | |
5961 | ||
40af4b0c AC |
5962 | /* Did the architecture change? No. Oops, put the old architecture |
5963 | back. */ | |
5964 | if (old_gdbarch == new_gdbarch) | |
0f71a2f6 JM |
5965 | { |
5966 | if (gdbarch_debug) | |
5967 | fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n", | |
5968 | (long) new_gdbarch, | |
5969 | new_gdbarch->bfd_arch_info->printable_name); | |
40af4b0c AC |
5970 | swapin_gdbarch_swap (old_gdbarch); |
5971 | current_gdbarch = old_gdbarch; | |
0f71a2f6 JM |
5972 | return 1; |
5973 | } | |
5974 | ||
0f79675b AC |
5975 | /* Is this a pre-existing architecture? Yes. Move it to the front |
5976 | of the list of architectures (keeping the list sorted Most | |
5977 | Recently Used) and then copy it in. */ | |
5978 | { | |
5979 | struct gdbarch_list **list; | |
5980 | for (list = ®o->arches; | |
5981 | (*list) != NULL; | |
5982 | list = &(*list)->next) | |
5983 | { | |
5984 | if ((*list)->gdbarch == new_gdbarch) | |
5985 | { | |
5986 | struct gdbarch_list *this; | |
5987 | if (gdbarch_debug) | |
5988 | fprintf_unfiltered (gdb_stdlog, | |
5989 | "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n", | |
5990 | (long) new_gdbarch, | |
5991 | new_gdbarch->bfd_arch_info->printable_name); | |
5992 | /* Unlink this. */ | |
5993 | this = (*list); | |
5994 | (*list) = this->next; | |
5995 | /* Insert in the front. */ | |
5996 | this->next = rego->arches; | |
5997 | rego->arches = this; | |
5998 | /* Copy the new architecture in. */ | |
5999 | current_gdbarch = new_gdbarch; | |
6000 | swapin_gdbarch_swap (new_gdbarch); | |
6001 | architecture_changed_event (); | |
6002 | return 1; | |
6003 | } | |
6004 | } | |
6005 | } | |
6006 | ||
6007 | /* Prepend this new architecture to the architecture list (keep the | |
6008 | list sorted Most Recently Used). */ | |
6009 | { | |
6010 | struct gdbarch_list *this = XMALLOC (struct gdbarch_list); | |
6011 | this->next = rego->arches; | |
6012 | this->gdbarch = new_gdbarch; | |
6013 | rego->arches = this; | |
6014 | } | |
0f71a2f6 | 6015 | |
76860b5f | 6016 | /* Switch to this new architecture marking it initialized. */ |
0f71a2f6 | 6017 | current_gdbarch = new_gdbarch; |
76860b5f | 6018 | current_gdbarch->initialized_p = 1; |
0f71a2f6 JM |
6019 | if (gdbarch_debug) |
6020 | { | |
6021 | fprintf_unfiltered (gdb_stdlog, | |
adf40b2e | 6022 | "gdbarch_update: New architecture 0x%08lx (%s) selected\n", |
0f71a2f6 JM |
6023 | (long) new_gdbarch, |
6024 | new_gdbarch->bfd_arch_info->printable_name); | |
0f71a2f6 | 6025 | } |
adf40b2e | 6026 | |
4b9b3959 AC |
6027 | /* Check that the newly installed architecture is valid. Plug in |
6028 | any post init values. */ | |
6029 | new_gdbarch->dump_tdep = rego->dump_tdep; | |
0f71a2f6 JM |
6030 | verify_gdbarch (new_gdbarch); |
6031 | ||
cf17c188 AC |
6032 | /* Initialize the per-architecture memory (swap) areas. |
6033 | CURRENT_GDBARCH must be update before these modules are | |
6034 | called. */ | |
6035 | init_gdbarch_swap (new_gdbarch); | |
6036 | ||
76860b5f | 6037 | /* Initialize the per-architecture data. CURRENT_GDBARCH |
cf17c188 | 6038 | must be updated before these modules are called. */ |
67c2c32c KS |
6039 | architecture_changed_event (); |
6040 | ||
4b9b3959 AC |
6041 | if (gdbarch_debug) |
6042 | gdbarch_dump (current_gdbarch, gdb_stdlog); | |
6043 | ||
0f71a2f6 JM |
6044 | return 1; |
6045 | } | |
c906108c | 6046 | |
c906108c | 6047 | |
c906108c SS |
6048 | /* Disassembler */ |
6049 | ||
6050 | /* Pointer to the target-dependent disassembly function. */ | |
104c1213 | 6051 | int (*tm_print_insn) (bfd_vma, disassemble_info *); |
c906108c SS |
6052 | disassemble_info tm_print_insn_info; |
6053 | ||
6054 | ||
104c1213 | 6055 | extern void _initialize_gdbarch (void); |
b4a20239 | 6056 | |
c906108c | 6057 | void |
7c7651b2 | 6058 | _initialize_gdbarch (void) |
c906108c | 6059 | { |
5d161b24 DB |
6060 | struct cmd_list_element *c; |
6061 | ||
adf40b2e | 6062 | INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered); |
c906108c SS |
6063 | tm_print_insn_info.flavour = bfd_target_unknown_flavour; |
6064 | tm_print_insn_info.read_memory_func = dis_asm_read_memory; | |
6065 | tm_print_insn_info.memory_error_func = dis_asm_memory_error; | |
6066 | tm_print_insn_info.print_address_func = dis_asm_print_address; | |
6067 | ||
5d161b24 | 6068 | add_show_from_set (add_set_cmd ("arch", |
c906108c SS |
6069 | class_maintenance, |
6070 | var_zinteger, | |
adf40b2e | 6071 | (char *)&gdbarch_debug, |
c906108c | 6072 | "Set architecture debugging.\n\ |
5d161b24 DB |
6073 | When non-zero, architecture debugging is enabled.", &setdebuglist), |
6074 | &showdebuglist); | |
59233f88 AC |
6075 | c = add_set_cmd ("archdebug", |
6076 | class_maintenance, | |
6077 | var_zinteger, | |
6078 | (char *)&gdbarch_debug, | |
6079 | "Set architecture debugging.\n\ | |
5d161b24 DB |
6080 | When non-zero, architecture debugging is enabled.", &setlist); |
6081 | ||
59233f88 AC |
6082 | deprecate_cmd (c, "set debug arch"); |
6083 | deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch"); | |
c906108c | 6084 | } |