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