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