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