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