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