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