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