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