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