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