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