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