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