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