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