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