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