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