2003-03-05 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
2
3 /* Dynamic architecture support for GDB, the GNU debugger.
4 Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5
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.
12
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.
17
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. */
22
23 /* This file was created with the aid of ``gdbarch.sh''.
24
25 The Bourne shell script ``gdbarch.sh'' creates the files
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
31 changes into that script. Conversely, when making sweeping changes
32 to this file, modifying gdbarch.sh and using its output may prove
33 easier. */
34
35
36 #include "defs.h"
37 #include "arch-utils.h"
38
39 #if GDB_MULTI_ARCH
40 #include "gdbcmd.h"
41 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
42 #else
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"
51 #include "gdb_wait.h"
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 */
58 #include "value.h" /* For old tm.h/nm.h macros. */
59 #endif
60 #include "symcat.h"
61
62 #include "floatformat.h"
63
64 #include "gdb_assert.h"
65 #include "gdb_string.h"
66 #include "gdb-events.h"
67 #include "reggroups.h"
68 #include "osabi.h"
69
70 /* Static function declarations */
71
72 static void verify_gdbarch (struct gdbarch *gdbarch);
73 static void alloc_gdbarch_data (struct gdbarch *);
74 static void free_gdbarch_data (struct gdbarch *);
75 static void init_gdbarch_swap (struct gdbarch *);
76 static void clear_gdbarch_swap (struct gdbarch *);
77 static void swapout_gdbarch_swap (struct gdbarch *);
78 static void swapin_gdbarch_swap (struct gdbarch *);
79
80 /* Non-zero if we want to trace architecture code. */
81
82 #ifndef GDBARCH_DEBUG
83 #define GDBARCH_DEBUG 0
84 #endif
85 int gdbarch_debug = GDBARCH_DEBUG;
86
87
88 /* Maintain the struct gdbarch object */
89
90 struct gdbarch
91 {
92 /* Has this architecture been fully initialized? */
93 int initialized_p;
94 /* basic architectural information */
95 const struct bfd_arch_info * bfd_arch_info;
96 int byte_order;
97 enum gdb_osabi osabi;
98
99 /* target specific vector. */
100 struct gdbarch_tdep *tdep;
101 gdbarch_dump_tdep_ftype *dump_tdep;
102
103 /* per-architecture data-pointers */
104 unsigned nr_data;
105 void **data;
106
107 /* per-architecture swap-regions */
108 struct gdbarch_swap *swap;
109
110 /* Multi-arch values.
111
112 When extending this structure you must:
113
114 Add the field below.
115
116 Declare set/get functions and define the corresponding
117 macro in gdbarch.h.
118
119 gdbarch_alloc(): If zero/NULL is not a suitable default,
120 initialize the new field.
121
122 verify_gdbarch(): Confirm that the target updated the field
123 correctly.
124
125 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
126 field is dumped out
127
128 ``startup_gdbarch()'': Append an initial value to the static
129 variable (base values on the host's c-type system).
130
131 get_gdbarch(): Implement the set/get functions (probably using
132 the macro's as shortcuts).
133
134 */
135
136 int short_bit;
137 int int_bit;
138 int long_bit;
139 int long_long_bit;
140 int float_bit;
141 int double_bit;
142 int long_double_bit;
143 int ptr_bit;
144 int addr_bit;
145 int bfd_vma_bit;
146 int char_signed;
147 gdbarch_read_pc_ftype *read_pc;
148 gdbarch_write_pc_ftype *write_pc;
149 gdbarch_read_fp_ftype *read_fp;
150 gdbarch_read_sp_ftype *read_sp;
151 gdbarch_write_sp_ftype *write_sp;
152 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
153 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
154 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
155 int num_regs;
156 int num_pseudo_regs;
157 int sp_regnum;
158 int fp_regnum;
159 int pc_regnum;
160 int ps_regnum;
161 int fp0_regnum;
162 int npc_regnum;
163 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
164 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
165 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
166 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
167 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
168 gdbarch_register_name_ftype *register_name;
169 int register_size;
170 int register_bytes;
171 gdbarch_register_byte_ftype *register_byte;
172 gdbarch_register_raw_size_ftype *register_raw_size;
173 int deprecated_max_register_raw_size;
174 gdbarch_register_virtual_size_ftype *register_virtual_size;
175 int deprecated_max_register_virtual_size;
176 gdbarch_register_virtual_type_ftype *register_virtual_type;
177 gdbarch_register_type_ftype *register_type;
178 gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info;
179 gdbarch_print_registers_info_ftype *print_registers_info;
180 gdbarch_print_float_info_ftype *print_float_info;
181 gdbarch_print_vector_info_ftype *print_vector_info;
182 gdbarch_register_sim_regno_ftype *register_sim_regno;
183 gdbarch_register_bytes_ok_ftype *register_bytes_ok;
184 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
185 gdbarch_cannot_store_register_ftype *cannot_store_register;
186 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
187 int deprecated_use_generic_dummy_frames;
188 int call_dummy_location;
189 gdbarch_call_dummy_address_ftype *call_dummy_address;
190 CORE_ADDR call_dummy_start_offset;
191 CORE_ADDR call_dummy_breakpoint_offset;
192 int call_dummy_breakpoint_offset_p;
193 int call_dummy_length;
194 gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy;
195 int call_dummy_p;
196 LONGEST * call_dummy_words;
197 int sizeof_call_dummy_words;
198 int call_dummy_stack_adjust_p;
199 int call_dummy_stack_adjust;
200 gdbarch_fix_call_dummy_ftype *fix_call_dummy;
201 gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first;
202 gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc;
203 int believe_pcc_promotion;
204 int believe_pcc_promotion_type;
205 gdbarch_get_saved_register_ftype *get_saved_register;
206 gdbarch_register_convertible_ftype *register_convertible;
207 gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
208 gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
209 gdbarch_convert_register_p_ftype *convert_register_p;
210 gdbarch_register_to_value_ftype *register_to_value;
211 gdbarch_value_to_register_ftype *value_to_register;
212 gdbarch_pointer_to_address_ftype *pointer_to_address;
213 gdbarch_address_to_pointer_ftype *address_to_pointer;
214 gdbarch_integer_to_address_ftype *integer_to_address;
215 gdbarch_return_value_on_stack_ftype *return_value_on_stack;
216 gdbarch_push_arguments_ftype *push_arguments;
217 gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame;
218 gdbarch_push_return_address_ftype *push_return_address;
219 gdbarch_pop_frame_ftype *pop_frame;
220 gdbarch_store_struct_return_ftype *store_struct_return;
221 gdbarch_extract_return_value_ftype *extract_return_value;
222 gdbarch_store_return_value_ftype *store_return_value;
223 gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value;
224 gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value;
225 gdbarch_extract_struct_value_address_ftype *extract_struct_value_address;
226 gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
227 gdbarch_use_struct_convention_ftype *use_struct_convention;
228 gdbarch_deprecated_frame_init_saved_regs_ftype *deprecated_frame_init_saved_regs;
229 gdbarch_deprecated_init_extra_frame_info_ftype *deprecated_init_extra_frame_info;
230 gdbarch_skip_prologue_ftype *skip_prologue;
231 gdbarch_prologue_frameless_p_ftype *prologue_frameless_p;
232 gdbarch_inner_than_ftype *inner_than;
233 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
234 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
235 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
236 CORE_ADDR decr_pc_after_break;
237 gdbarch_prepare_to_proceed_ftype *prepare_to_proceed;
238 CORE_ADDR function_start_offset;
239 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
240 CORE_ADDR frame_args_skip;
241 gdbarch_frameless_function_invocation_ftype *frameless_function_invocation;
242 gdbarch_frame_chain_ftype *frame_chain;
243 gdbarch_frame_chain_valid_ftype *frame_chain_valid;
244 gdbarch_frame_saved_pc_ftype *frame_saved_pc;
245 gdbarch_frame_args_address_ftype *frame_args_address;
246 gdbarch_frame_locals_address_ftype *frame_locals_address;
247 gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
248 gdbarch_frame_num_args_ftype *frame_num_args;
249 gdbarch_stack_align_ftype *stack_align;
250 gdbarch_frame_align_ftype *frame_align;
251 int extra_stack_alignment_needed;
252 gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
253 gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
254 gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
255 int parm_boundary;
256 const struct floatformat * float_format;
257 const struct floatformat * double_format;
258 const struct floatformat * long_double_format;
259 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
260 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
261 gdbarch_smash_text_address_ftype *smash_text_address;
262 gdbarch_software_single_step_ftype *software_single_step;
263 gdbarch_print_insn_ftype *print_insn;
264 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
265 gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
266 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
267 gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp;
268 gdbarch_sigtramp_start_ftype *sigtramp_start;
269 gdbarch_sigtramp_end_ftype *sigtramp_end;
270 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
271 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
272 gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info;
273 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
274 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
275 const char * name_of_malloc;
276 int cannot_step_breakpoint;
277 int have_nonsteppable_watchpoint;
278 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
279 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
280 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
281 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
282 };
283
284
285 /* The default architecture uses host values (for want of a better
286 choice). */
287
288 extern const struct bfd_arch_info bfd_default_arch_struct;
289
290 struct gdbarch startup_gdbarch =
291 {
292 1, /* Always initialized. */
293 /* basic architecture information */
294 &bfd_default_arch_struct,
295 BFD_ENDIAN_BIG,
296 GDB_OSABI_UNKNOWN,
297 /* target specific vector and its dump routine */
298 NULL, NULL,
299 /*per-architecture data-pointers and swap regions */
300 0, NULL, NULL,
301 /* Multi-arch values */
302 8 * sizeof (short),
303 8 * sizeof (int),
304 8 * sizeof (long),
305 8 * sizeof (LONGEST),
306 8 * sizeof (float),
307 8 * sizeof (double),
308 8 * sizeof (long double),
309 8 * sizeof (void*),
310 8 * sizeof (void*),
311 8 * sizeof (void*),
312 1,
313 0,
314 0,
315 0,
316 0,
317 0,
318 0,
319 0,
320 0,
321 0,
322 0,
323 -1,
324 -1,
325 -1,
326 -1,
327 0,
328 0,
329 0,
330 0,
331 0,
332 0,
333 0,
334 0,
335 0,
336 0,
337 generic_register_byte,
338 generic_register_size,
339 0,
340 generic_register_size,
341 0,
342 0,
343 0,
344 0,
345 default_print_registers_info,
346 0,
347 0,
348 0,
349 0,
350 0,
351 0,
352 0,
353 0,
354 0,
355 0,
356 0,
357 0,
358 0,
359 0,
360 generic_pc_in_call_dummy,
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,
385 0,
386 0,
387 0,
388 0,
389 0,
390 0,
391 0,
392 0,
393 0,
394 0,
395 0,
396 0,
397 0,
398 0,
399 0,
400 0,
401 0,
402 0,
403 0,
404 0,
405 0,
406 0,
407 0,
408 0,
409 0,
410 0,
411 0,
412 0,
413 0,
414 0,
415 0,
416 0,
417 0,
418 0,
419 0,
420 0,
421 0,
422 0,
423 0,
424 0,
425 0,
426 0,
427 0,
428 0,
429 0,
430 0,
431 0,
432 0,
433 0,
434 0,
435 0,
436 generic_in_function_epilogue_p,
437 construct_inferior_arguments,
438 0,
439 0,
440 0,
441 "malloc",
442 0,
443 0,
444 0,
445 0,
446 0,
447 default_register_reggroup_p,
448 /* startup_gdbarch() */
449 };
450
451 struct gdbarch *current_gdbarch = &startup_gdbarch;
452
453 /* Do any initialization needed for a non-multiarch configuration
454 after the _initialize_MODULE functions have been run. */
455 void
456 initialize_non_multiarch (void)
457 {
458 alloc_gdbarch_data (&startup_gdbarch);
459 /* Ensure that all swap areas are zeroed so that they again think
460 they are starting from scratch. */
461 clear_gdbarch_swap (&startup_gdbarch);
462 init_gdbarch_swap (&startup_gdbarch);
463 }
464
465
466 /* Create a new ``struct gdbarch'' based on information provided by
467 ``struct gdbarch_info''. */
468
469 struct gdbarch *
470 gdbarch_alloc (const struct gdbarch_info *info,
471 struct gdbarch_tdep *tdep)
472 {
473 /* NOTE: The new architecture variable is named ``current_gdbarch''
474 so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
475 the current local architecture and not the previous global
476 architecture. This ensures that the new architectures initial
477 values are not influenced by the previous architecture. Once
478 everything is parameterised with gdbarch, this will go away. */
479 struct gdbarch *current_gdbarch = XMALLOC (struct gdbarch);
480 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
481
482 alloc_gdbarch_data (current_gdbarch);
483
484 current_gdbarch->tdep = tdep;
485
486 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
487 current_gdbarch->byte_order = info->byte_order;
488 current_gdbarch->osabi = info->osabi;
489
490 /* Force the explicit initialization of these. */
491 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
492 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
493 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
494 current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
495 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
496 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
497 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
498 current_gdbarch->ptr_bit = TARGET_INT_BIT;
499 current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
500 current_gdbarch->char_signed = -1;
501 current_gdbarch->read_pc = generic_target_read_pc;
502 current_gdbarch->write_pc = generic_target_write_pc;
503 current_gdbarch->read_fp = generic_target_read_fp;
504 current_gdbarch->read_sp = generic_target_read_sp;
505 current_gdbarch->write_sp = generic_target_write_sp;
506 current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
507 current_gdbarch->num_regs = -1;
508 current_gdbarch->sp_regnum = -1;
509 current_gdbarch->fp_regnum = -1;
510 current_gdbarch->pc_regnum = -1;
511 current_gdbarch->ps_regnum = -1;
512 current_gdbarch->fp0_regnum = -1;
513 current_gdbarch->npc_regnum = -1;
514 current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
515 current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
516 current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
517 current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
518 current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
519 current_gdbarch->register_name = legacy_register_name;
520 current_gdbarch->register_size = -1;
521 current_gdbarch->register_bytes = -1;
522 current_gdbarch->register_byte = generic_register_byte;
523 current_gdbarch->register_raw_size = generic_register_size;
524 current_gdbarch->register_virtual_size = generic_register_size;
525 current_gdbarch->print_registers_info = default_print_registers_info;
526 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
527 current_gdbarch->cannot_fetch_register = cannot_register_not;
528 current_gdbarch->cannot_store_register = cannot_register_not;
529 current_gdbarch->deprecated_use_generic_dummy_frames = 1;
530 current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
531 current_gdbarch->call_dummy_start_offset = -1;
532 current_gdbarch->call_dummy_breakpoint_offset = -1;
533 current_gdbarch->call_dummy_breakpoint_offset_p = -1;
534 current_gdbarch->call_dummy_length = -1;
535 current_gdbarch->deprecated_pc_in_call_dummy = generic_pc_in_call_dummy;
536 current_gdbarch->call_dummy_p = -1;
537 current_gdbarch->call_dummy_words = legacy_call_dummy_words;
538 current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
539 current_gdbarch->call_dummy_stack_adjust_p = -1;
540 current_gdbarch->register_convertible = generic_register_convertible_not;
541 current_gdbarch->convert_register_p = legacy_convert_register_p;
542 current_gdbarch->register_to_value = legacy_register_to_value;
543 current_gdbarch->value_to_register = legacy_value_to_register;
544 current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
545 current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
546 current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
547 current_gdbarch->push_arguments = default_push_arguments;
548 current_gdbarch->extract_return_value = legacy_extract_return_value;
549 current_gdbarch->store_return_value = legacy_store_return_value;
550 current_gdbarch->use_struct_convention = generic_use_struct_convention;
551 current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
552 current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
553 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
554 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
555 current_gdbarch->decr_pc_after_break = -1;
556 current_gdbarch->prepare_to_proceed = default_prepare_to_proceed;
557 current_gdbarch->function_start_offset = -1;
558 current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
559 current_gdbarch->frame_args_skip = -1;
560 current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
561 current_gdbarch->frame_args_address = get_frame_base;
562 current_gdbarch->frame_locals_address = get_frame_base;
563 current_gdbarch->extra_stack_alignment_needed = 1;
564 current_gdbarch->convert_from_func_ptr_addr = core_addr_identity;
565 current_gdbarch->addr_bits_remove = core_addr_identity;
566 current_gdbarch->smash_text_address = core_addr_identity;
567 current_gdbarch->print_insn = legacy_print_insn;
568 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
569 current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
570 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
571 current_gdbarch->pc_in_sigtramp = legacy_pc_in_sigtramp;
572 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
573 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
574 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
575 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
576 current_gdbarch->name_of_malloc = "malloc";
577 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
578 /* gdbarch_alloc() */
579
580 return current_gdbarch;
581 }
582
583
584 /* Free a gdbarch struct. This should never happen in normal
585 operation --- once you've created a gdbarch, you keep it around.
586 However, if an architecture's init function encounters an error
587 building the structure, it may need to clean up a partially
588 constructed gdbarch. */
589
590 void
591 gdbarch_free (struct gdbarch *arch)
592 {
593 gdb_assert (arch != NULL);
594 free_gdbarch_data (arch);
595 xfree (arch);
596 }
597
598
599 /* Ensure that all values in a GDBARCH are reasonable. */
600
601 static void
602 verify_gdbarch (struct gdbarch *gdbarch)
603 {
604 struct ui_file *log;
605 struct cleanup *cleanups;
606 long dummy;
607 char *buf;
608 /* Only perform sanity checks on a multi-arch target. */
609 if (!GDB_MULTI_ARCH)
610 return;
611 log = mem_fileopen ();
612 cleanups = make_cleanup_ui_file_delete (log);
613 /* fundamental */
614 if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
615 fprintf_unfiltered (log, "\n\tbyte-order");
616 if (gdbarch->bfd_arch_info == NULL)
617 fprintf_unfiltered (log, "\n\tbfd_arch_info");
618 /* Check those that need to be defined for the given multi-arch level. */
619 /* Skip verify of short_bit, invalid_p == 0 */
620 /* Skip verify of int_bit, invalid_p == 0 */
621 /* Skip verify of long_bit, invalid_p == 0 */
622 /* Skip verify of long_long_bit, invalid_p == 0 */
623 /* Skip verify of float_bit, invalid_p == 0 */
624 /* Skip verify of double_bit, invalid_p == 0 */
625 /* Skip verify of long_double_bit, invalid_p == 0 */
626 /* Skip verify of ptr_bit, invalid_p == 0 */
627 if (gdbarch->addr_bit == 0)
628 gdbarch->addr_bit = TARGET_PTR_BIT;
629 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
630 if (gdbarch->char_signed == -1)
631 gdbarch->char_signed = 1;
632 /* Skip verify of read_pc, invalid_p == 0 */
633 /* Skip verify of write_pc, invalid_p == 0 */
634 /* Skip verify of read_fp, invalid_p == 0 */
635 /* Skip verify of read_sp, invalid_p == 0 */
636 /* Skip verify of write_sp, invalid_p == 0 */
637 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
638 /* Skip verify of pseudo_register_read, has predicate */
639 /* Skip verify of pseudo_register_write, has predicate */
640 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
641 && (gdbarch->num_regs == -1))
642 fprintf_unfiltered (log, "\n\tnum_regs");
643 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
644 /* Skip verify of sp_regnum, invalid_p == 0 */
645 /* Skip verify of fp_regnum, invalid_p == 0 */
646 /* Skip verify of pc_regnum, invalid_p == 0 */
647 /* Skip verify of ps_regnum, invalid_p == 0 */
648 /* Skip verify of fp0_regnum, invalid_p == 0 */
649 /* Skip verify of npc_regnum, invalid_p == 0 */
650 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
651 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
652 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
653 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
654 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
655 /* Skip verify of register_name, invalid_p == 0 */
656 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
657 && (gdbarch->register_size == -1))
658 fprintf_unfiltered (log, "\n\tregister_size");
659 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
660 && (gdbarch->register_bytes == -1))
661 fprintf_unfiltered (log, "\n\tregister_bytes");
662 /* Skip verify of register_byte, invalid_p == 0 */
663 /* Skip verify of register_raw_size, invalid_p == 0 */
664 /* Skip verify of deprecated_max_register_raw_size, has predicate */
665 /* Skip verify of register_virtual_size, invalid_p == 0 */
666 /* Skip verify of deprecated_max_register_virtual_size, has predicate */
667 /* Skip verify of register_virtual_type, has predicate */
668 /* Skip verify of register_type, has predicate */
669 /* Skip verify of deprecated_do_registers_info, has predicate */
670 /* Skip verify of print_registers_info, invalid_p == 0 */
671 /* Skip verify of print_float_info, has predicate */
672 /* Skip verify of print_vector_info, has predicate */
673 /* Skip verify of register_sim_regno, invalid_p == 0 */
674 /* Skip verify of register_bytes_ok, has predicate */
675 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
676 /* Skip verify of cannot_store_register, invalid_p == 0 */
677 /* Skip verify of get_longjmp_target, has predicate */
678 /* Skip verify of deprecated_use_generic_dummy_frames, invalid_p == 0 */
679 /* Skip verify of call_dummy_location, invalid_p == 0 */
680 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
681 && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
682 fprintf_unfiltered (log, "\n\tcall_dummy_address");
683 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
684 && (gdbarch->call_dummy_start_offset == -1))
685 fprintf_unfiltered (log, "\n\tcall_dummy_start_offset");
686 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
687 && (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1))
688 fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset");
689 if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
690 && (gdbarch->call_dummy_breakpoint_offset_p == -1))
691 fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset_p");
692 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
693 && (gdbarch->call_dummy_length == -1))
694 fprintf_unfiltered (log, "\n\tcall_dummy_length");
695 /* Skip verify of deprecated_pc_in_call_dummy, has predicate */
696 if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
697 && (gdbarch->call_dummy_p == -1))
698 fprintf_unfiltered (log, "\n\tcall_dummy_p");
699 /* Skip verify of call_dummy_words, invalid_p == 0 */
700 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
701 if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
702 && (gdbarch->call_dummy_stack_adjust_p == -1))
703 fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust_p");
704 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
705 && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0))
706 fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust");
707 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
708 && (gdbarch->fix_call_dummy == 0))
709 fprintf_unfiltered (log, "\n\tfix_call_dummy");
710 /* Skip verify of deprecated_init_frame_pc_first, has predicate */
711 /* Skip verify of deprecated_init_frame_pc, has predicate */
712 /* Skip verify of get_saved_register, has predicate */
713 /* Skip verify of register_convertible, invalid_p == 0 */
714 /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
715 /* Skip verify of register_convert_to_raw, invalid_p == 0 */
716 /* Skip verify of convert_register_p, invalid_p == 0 */
717 /* Skip verify of register_to_value, invalid_p == 0 */
718 /* Skip verify of value_to_register, invalid_p == 0 */
719 /* Skip verify of pointer_to_address, invalid_p == 0 */
720 /* Skip verify of address_to_pointer, invalid_p == 0 */
721 /* Skip verify of integer_to_address, has predicate */
722 /* Skip verify of return_value_on_stack, invalid_p == 0 */
723 /* Skip verify of push_arguments, invalid_p == 0 */
724 /* Skip verify of deprecated_push_dummy_frame, has predicate */
725 /* Skip verify of push_return_address, has predicate */
726 /* Skip verify of pop_frame, has predicate */
727 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
728 && (gdbarch->store_struct_return == 0))
729 fprintf_unfiltered (log, "\n\tstore_struct_return");
730 /* Skip verify of extract_return_value, invalid_p == 0 */
731 /* Skip verify of store_return_value, invalid_p == 0 */
732 /* Skip verify of extract_struct_value_address, has predicate */
733 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
734 /* Skip verify of use_struct_convention, invalid_p == 0 */
735 /* Skip verify of deprecated_frame_init_saved_regs, has predicate */
736 /* Skip verify of deprecated_init_extra_frame_info, has predicate */
737 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
738 && (gdbarch->skip_prologue == 0))
739 fprintf_unfiltered (log, "\n\tskip_prologue");
740 /* Skip verify of prologue_frameless_p, invalid_p == 0 */
741 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
742 && (gdbarch->inner_than == 0))
743 fprintf_unfiltered (log, "\n\tinner_than");
744 /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
745 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
746 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
747 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
748 && (gdbarch->decr_pc_after_break == -1))
749 fprintf_unfiltered (log, "\n\tdecr_pc_after_break");
750 /* Skip verify of prepare_to_proceed, invalid_p == 0 */
751 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
752 && (gdbarch->function_start_offset == -1))
753 fprintf_unfiltered (log, "\n\tfunction_start_offset");
754 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
755 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
756 && (gdbarch->frame_args_skip == -1))
757 fprintf_unfiltered (log, "\n\tframe_args_skip");
758 /* Skip verify of frameless_function_invocation, invalid_p == 0 */
759 /* Skip verify of frame_chain, has predicate */
760 /* Skip verify of frame_chain_valid, has predicate */
761 /* Skip verify of frame_saved_pc, has predicate */
762 /* Skip verify of frame_args_address, invalid_p == 0 */
763 /* Skip verify of frame_locals_address, invalid_p == 0 */
764 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
765 && (gdbarch->saved_pc_after_call == 0))
766 fprintf_unfiltered (log, "\n\tsaved_pc_after_call");
767 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
768 && (gdbarch->frame_num_args == 0))
769 fprintf_unfiltered (log, "\n\tframe_num_args");
770 /* Skip verify of stack_align, has predicate */
771 /* Skip verify of frame_align, has predicate */
772 /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
773 /* Skip verify of reg_struct_has_addr, has predicate */
774 /* Skip verify of save_dummy_frame_tos, has predicate */
775 /* Skip verify of unwind_dummy_id, has predicate */
776 if (gdbarch->float_format == 0)
777 gdbarch->float_format = default_float_format (gdbarch);
778 if (gdbarch->double_format == 0)
779 gdbarch->double_format = default_double_format (gdbarch);
780 if (gdbarch->long_double_format == 0)
781 gdbarch->long_double_format = default_double_format (gdbarch);
782 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
783 /* Skip verify of addr_bits_remove, invalid_p == 0 */
784 /* Skip verify of smash_text_address, invalid_p == 0 */
785 /* Skip verify of software_single_step, has predicate */
786 /* Skip verify of print_insn, invalid_p == 0 */
787 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
788 /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
789 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
790 /* Skip verify of pc_in_sigtramp, invalid_p == 0 */
791 /* Skip verify of sigtramp_start, has predicate */
792 /* Skip verify of sigtramp_end, has predicate */
793 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
794 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
795 /* Skip verify of dwarf2_build_frame_info, has predicate */
796 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
797 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
798 /* Skip verify of name_of_malloc, invalid_p == 0 */
799 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
800 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
801 /* Skip verify of address_class_type_flags, has predicate */
802 /* Skip verify of address_class_type_flags_to_name, has predicate */
803 /* Skip verify of address_class_name_to_type_flags, has predicate */
804 /* Skip verify of register_reggroup_p, invalid_p == 0 */
805 buf = ui_file_xstrdup (log, &dummy);
806 make_cleanup (xfree, buf);
807 if (strlen (buf) > 0)
808 internal_error (__FILE__, __LINE__,
809 "verify_gdbarch: the following are invalid ...%s",
810 buf);
811 do_cleanups (cleanups);
812 }
813
814
815 /* Print out the details of the current architecture. */
816
817 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
818 just happens to match the global variable ``current_gdbarch''. That
819 way macros refering to that variable get the local and not the global
820 version - ulgh. Once everything is parameterised with gdbarch, this
821 will go away. */
822
823 void
824 gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
825 {
826 fprintf_unfiltered (file,
827 "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
828 GDB_MULTI_ARCH);
829 if (GDB_MULTI_ARCH)
830 fprintf_unfiltered (file,
831 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
832 gdbarch_frame_align_p (current_gdbarch));
833 if (GDB_MULTI_ARCH)
834 fprintf_unfiltered (file,
835 "gdbarch_dump: frame_align = 0x%08lx\n",
836 (long) current_gdbarch->frame_align);
837 if (GDB_MULTI_ARCH)
838 fprintf_unfiltered (file,
839 "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
840 (long) current_gdbarch->in_function_epilogue_p);
841 if (GDB_MULTI_ARCH)
842 fprintf_unfiltered (file,
843 "gdbarch_dump: register_reggroup_p = 0x%08lx\n",
844 (long) current_gdbarch->register_reggroup_p);
845 if (GDB_MULTI_ARCH)
846 fprintf_unfiltered (file,
847 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
848 gdbarch_pseudo_register_read_p (current_gdbarch));
849 if (GDB_MULTI_ARCH)
850 fprintf_unfiltered (file,
851 "gdbarch_dump: pseudo_register_read = 0x%08lx\n",
852 (long) current_gdbarch->pseudo_register_read);
853 if (GDB_MULTI_ARCH)
854 fprintf_unfiltered (file,
855 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
856 gdbarch_pseudo_register_write_p (current_gdbarch));
857 if (GDB_MULTI_ARCH)
858 fprintf_unfiltered (file,
859 "gdbarch_dump: pseudo_register_write = 0x%08lx\n",
860 (long) current_gdbarch->pseudo_register_write);
861 if (GDB_MULTI_ARCH)
862 fprintf_unfiltered (file,
863 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
864 gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
865 if (GDB_MULTI_ARCH)
866 fprintf_unfiltered (file,
867 "gdbarch_dump: address_class_name_to_type_flags = 0x%08lx\n",
868 (long) current_gdbarch->address_class_name_to_type_flags);
869 #ifdef ADDRESS_CLASS_TYPE_FLAGS_P
870 fprintf_unfiltered (file,
871 "gdbarch_dump: %s # %s\n",
872 "ADDRESS_CLASS_TYPE_FLAGS_P()",
873 XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ()));
874 fprintf_unfiltered (file,
875 "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS_P() = %d\n",
876 ADDRESS_CLASS_TYPE_FLAGS_P ());
877 #endif
878 #ifdef ADDRESS_CLASS_TYPE_FLAGS
879 fprintf_unfiltered (file,
880 "gdbarch_dump: %s # %s\n",
881 "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
882 XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class)));
883 if (GDB_MULTI_ARCH)
884 fprintf_unfiltered (file,
885 "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS = <0x%08lx>\n",
886 (long) current_gdbarch->address_class_type_flags
887 /*ADDRESS_CLASS_TYPE_FLAGS ()*/);
888 #endif
889 if (GDB_MULTI_ARCH)
890 fprintf_unfiltered (file,
891 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
892 gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
893 if (GDB_MULTI_ARCH)
894 fprintf_unfiltered (file,
895 "gdbarch_dump: address_class_type_flags_to_name = 0x%08lx\n",
896 (long) current_gdbarch->address_class_type_flags_to_name);
897 #ifdef ADDRESS_TO_POINTER
898 #if GDB_MULTI_ARCH
899 /* Macro might contain `[{}]' when not multi-arch */
900 fprintf_unfiltered (file,
901 "gdbarch_dump: %s # %s\n",
902 "ADDRESS_TO_POINTER(type, buf, addr)",
903 XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
904 #endif
905 if (GDB_MULTI_ARCH)
906 fprintf_unfiltered (file,
907 "gdbarch_dump: ADDRESS_TO_POINTER = <0x%08lx>\n",
908 (long) current_gdbarch->address_to_pointer
909 /*ADDRESS_TO_POINTER ()*/);
910 #endif
911 #ifdef ADDR_BITS_REMOVE
912 fprintf_unfiltered (file,
913 "gdbarch_dump: %s # %s\n",
914 "ADDR_BITS_REMOVE(addr)",
915 XSTRING (ADDR_BITS_REMOVE (addr)));
916 if (GDB_MULTI_ARCH)
917 fprintf_unfiltered (file,
918 "gdbarch_dump: ADDR_BITS_REMOVE = <0x%08lx>\n",
919 (long) current_gdbarch->addr_bits_remove
920 /*ADDR_BITS_REMOVE ()*/);
921 #endif
922 #ifdef BELIEVE_PCC_PROMOTION
923 fprintf_unfiltered (file,
924 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
925 XSTRING (BELIEVE_PCC_PROMOTION));
926 fprintf_unfiltered (file,
927 "gdbarch_dump: BELIEVE_PCC_PROMOTION = %d\n",
928 BELIEVE_PCC_PROMOTION);
929 #endif
930 #ifdef BELIEVE_PCC_PROMOTION_TYPE
931 fprintf_unfiltered (file,
932 "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n",
933 XSTRING (BELIEVE_PCC_PROMOTION_TYPE));
934 fprintf_unfiltered (file,
935 "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %d\n",
936 BELIEVE_PCC_PROMOTION_TYPE);
937 #endif
938 #ifdef BREAKPOINT_FROM_PC
939 fprintf_unfiltered (file,
940 "gdbarch_dump: %s # %s\n",
941 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
942 XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
943 if (GDB_MULTI_ARCH)
944 fprintf_unfiltered (file,
945 "gdbarch_dump: BREAKPOINT_FROM_PC = <0x%08lx>\n",
946 (long) current_gdbarch->breakpoint_from_pc
947 /*BREAKPOINT_FROM_PC ()*/);
948 #endif
949 #ifdef CALL_DUMMY_ADDRESS
950 fprintf_unfiltered (file,
951 "gdbarch_dump: %s # %s\n",
952 "CALL_DUMMY_ADDRESS()",
953 XSTRING (CALL_DUMMY_ADDRESS ()));
954 if (GDB_MULTI_ARCH)
955 fprintf_unfiltered (file,
956 "gdbarch_dump: CALL_DUMMY_ADDRESS = <0x%08lx>\n",
957 (long) current_gdbarch->call_dummy_address
958 /*CALL_DUMMY_ADDRESS ()*/);
959 #endif
960 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
961 fprintf_unfiltered (file,
962 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
963 XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET));
964 if (CALL_DUMMY_BREAKPOINT_OFFSET_P)
965 fprintf_unfiltered (file,
966 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
967 (long) CALL_DUMMY_BREAKPOINT_OFFSET);
968 #endif
969 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
970 fprintf_unfiltered (file,
971 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P # %s\n",
972 XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET_P));
973 fprintf_unfiltered (file,
974 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P = %d\n",
975 CALL_DUMMY_BREAKPOINT_OFFSET_P);
976 #endif
977 #ifdef CALL_DUMMY_LENGTH
978 fprintf_unfiltered (file,
979 "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n",
980 XSTRING (CALL_DUMMY_LENGTH));
981 if (gdbarch->call_dummy_length >= 0)
982 fprintf_unfiltered (file,
983 "gdbarch_dump: CALL_DUMMY_LENGTH = %d\n",
984 CALL_DUMMY_LENGTH);
985 #endif
986 #ifdef CALL_DUMMY_LOCATION
987 fprintf_unfiltered (file,
988 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
989 XSTRING (CALL_DUMMY_LOCATION));
990 fprintf_unfiltered (file,
991 "gdbarch_dump: CALL_DUMMY_LOCATION = %d\n",
992 CALL_DUMMY_LOCATION);
993 #endif
994 #ifdef CALL_DUMMY_P
995 fprintf_unfiltered (file,
996 "gdbarch_dump: CALL_DUMMY_P # %s\n",
997 XSTRING (CALL_DUMMY_P));
998 fprintf_unfiltered (file,
999 "gdbarch_dump: CALL_DUMMY_P = %d\n",
1000 CALL_DUMMY_P);
1001 #endif
1002 #ifdef CALL_DUMMY_STACK_ADJUST
1003 fprintf_unfiltered (file,
1004 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n",
1005 XSTRING (CALL_DUMMY_STACK_ADJUST));
1006 if (CALL_DUMMY_STACK_ADJUST_P)
1007 fprintf_unfiltered (file,
1008 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
1009 (long) CALL_DUMMY_STACK_ADJUST);
1010 #endif
1011 #ifdef CALL_DUMMY_STACK_ADJUST_P
1012 fprintf_unfiltered (file,
1013 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P # %s\n",
1014 XSTRING (CALL_DUMMY_STACK_ADJUST_P));
1015 fprintf_unfiltered (file,
1016 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
1017 (long) CALL_DUMMY_STACK_ADJUST_P);
1018 #endif
1019 #ifdef CALL_DUMMY_START_OFFSET
1020 fprintf_unfiltered (file,
1021 "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n",
1022 XSTRING (CALL_DUMMY_START_OFFSET));
1023 fprintf_unfiltered (file,
1024 "gdbarch_dump: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
1025 (long) CALL_DUMMY_START_OFFSET);
1026 #endif
1027 #ifdef CALL_DUMMY_WORDS
1028 fprintf_unfiltered (file,
1029 "gdbarch_dump: CALL_DUMMY_WORDS # %s\n",
1030 XSTRING (CALL_DUMMY_WORDS));
1031 fprintf_unfiltered (file,
1032 "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n",
1033 (long) CALL_DUMMY_WORDS);
1034 #endif
1035 #ifdef CANNOT_FETCH_REGISTER
1036 fprintf_unfiltered (file,
1037 "gdbarch_dump: %s # %s\n",
1038 "CANNOT_FETCH_REGISTER(regnum)",
1039 XSTRING (CANNOT_FETCH_REGISTER (regnum)));
1040 if (GDB_MULTI_ARCH)
1041 fprintf_unfiltered (file,
1042 "gdbarch_dump: CANNOT_FETCH_REGISTER = <0x%08lx>\n",
1043 (long) current_gdbarch->cannot_fetch_register
1044 /*CANNOT_FETCH_REGISTER ()*/);
1045 #endif
1046 #ifdef CANNOT_STEP_BREAKPOINT
1047 fprintf_unfiltered (file,
1048 "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
1049 XSTRING (CANNOT_STEP_BREAKPOINT));
1050 fprintf_unfiltered (file,
1051 "gdbarch_dump: CANNOT_STEP_BREAKPOINT = %d\n",
1052 CANNOT_STEP_BREAKPOINT);
1053 #endif
1054 #ifdef CANNOT_STORE_REGISTER
1055 fprintf_unfiltered (file,
1056 "gdbarch_dump: %s # %s\n",
1057 "CANNOT_STORE_REGISTER(regnum)",
1058 XSTRING (CANNOT_STORE_REGISTER (regnum)));
1059 if (GDB_MULTI_ARCH)
1060 fprintf_unfiltered (file,
1061 "gdbarch_dump: CANNOT_STORE_REGISTER = <0x%08lx>\n",
1062 (long) current_gdbarch->cannot_store_register
1063 /*CANNOT_STORE_REGISTER ()*/);
1064 #endif
1065 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
1066 #if GDB_MULTI_ARCH
1067 /* Macro might contain `[{}]' when not multi-arch */
1068 fprintf_unfiltered (file,
1069 "gdbarch_dump: %s # %s\n",
1070 "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
1071 XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
1072 #endif
1073 if (GDB_MULTI_ARCH)
1074 fprintf_unfiltered (file,
1075 "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
1076 (long) current_gdbarch->coff_make_msymbol_special
1077 /*COFF_MAKE_MSYMBOL_SPECIAL ()*/);
1078 #endif
1079 if (GDB_MULTI_ARCH)
1080 fprintf_unfiltered (file,
1081 "gdbarch_dump: construct_inferior_arguments = 0x%08lx\n",
1082 (long) current_gdbarch->construct_inferior_arguments);
1083 #ifdef CONVERT_FROM_FUNC_PTR_ADDR
1084 fprintf_unfiltered (file,
1085 "gdbarch_dump: %s # %s\n",
1086 "CONVERT_FROM_FUNC_PTR_ADDR(addr)",
1087 XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr)));
1088 if (GDB_MULTI_ARCH)
1089 fprintf_unfiltered (file,
1090 "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = <0x%08lx>\n",
1091 (long) current_gdbarch->convert_from_func_ptr_addr
1092 /*CONVERT_FROM_FUNC_PTR_ADDR ()*/);
1093 #endif
1094 #ifdef CONVERT_REGISTER_P
1095 fprintf_unfiltered (file,
1096 "gdbarch_dump: %s # %s\n",
1097 "CONVERT_REGISTER_P(regnum)",
1098 XSTRING (CONVERT_REGISTER_P (regnum)));
1099 if (GDB_MULTI_ARCH)
1100 fprintf_unfiltered (file,
1101 "gdbarch_dump: CONVERT_REGISTER_P = <0x%08lx>\n",
1102 (long) current_gdbarch->convert_register_p
1103 /*CONVERT_REGISTER_P ()*/);
1104 #endif
1105 #ifdef DECR_PC_AFTER_BREAK
1106 fprintf_unfiltered (file,
1107 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
1108 XSTRING (DECR_PC_AFTER_BREAK));
1109 fprintf_unfiltered (file,
1110 "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
1111 (long) DECR_PC_AFTER_BREAK);
1112 #endif
1113 #ifdef DEPRECATED_DO_REGISTERS_INFO_P
1114 fprintf_unfiltered (file,
1115 "gdbarch_dump: %s # %s\n",
1116 "DEPRECATED_DO_REGISTERS_INFO_P()",
1117 XSTRING (DEPRECATED_DO_REGISTERS_INFO_P ()));
1118 fprintf_unfiltered (file,
1119 "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO_P() = %d\n",
1120 DEPRECATED_DO_REGISTERS_INFO_P ());
1121 #endif
1122 #ifdef DEPRECATED_DO_REGISTERS_INFO
1123 #if GDB_MULTI_ARCH
1124 /* Macro might contain `[{}]' when not multi-arch */
1125 fprintf_unfiltered (file,
1126 "gdbarch_dump: %s # %s\n",
1127 "DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs)",
1128 XSTRING (DEPRECATED_DO_REGISTERS_INFO (reg_nr, fpregs)));
1129 #endif
1130 if (GDB_MULTI_ARCH)
1131 fprintf_unfiltered (file,
1132 "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO = <0x%08lx>\n",
1133 (long) current_gdbarch->deprecated_do_registers_info
1134 /*DEPRECATED_DO_REGISTERS_INFO ()*/);
1135 #endif
1136 #ifdef DEPRECATED_EXTRACT_RETURN_VALUE
1137 #if GDB_MULTI_ARCH
1138 /* Macro might contain `[{}]' when not multi-arch */
1139 fprintf_unfiltered (file,
1140 "gdbarch_dump: %s # %s\n",
1141 "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
1142 XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
1143 #endif
1144 if (GDB_MULTI_ARCH)
1145 fprintf_unfiltered (file,
1146 "gdbarch_dump: DEPRECATED_EXTRACT_RETURN_VALUE = <0x%08lx>\n",
1147 (long) current_gdbarch->deprecated_extract_return_value
1148 /*DEPRECATED_EXTRACT_RETURN_VALUE ()*/);
1149 #endif
1150 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
1151 fprintf_unfiltered (file,
1152 "gdbarch_dump: %s # %s\n",
1153 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
1154 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
1155 fprintf_unfiltered (file,
1156 "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() = %d\n",
1157 DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ());
1158 #endif
1159 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
1160 fprintf_unfiltered (file,
1161 "gdbarch_dump: %s # %s\n",
1162 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
1163 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
1164 if (GDB_MULTI_ARCH)
1165 fprintf_unfiltered (file,
1166 "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n",
1167 (long) current_gdbarch->deprecated_extract_struct_value_address
1168 /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
1169 #endif
1170 #ifdef DEPRECATED_FRAME_INIT_SAVED_REGS_P
1171 fprintf_unfiltered (file,
1172 "gdbarch_dump: %s # %s\n",
1173 "DEPRECATED_FRAME_INIT_SAVED_REGS_P()",
1174 XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS_P ()));
1175 fprintf_unfiltered (file,
1176 "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS_P() = %d\n",
1177 DEPRECATED_FRAME_INIT_SAVED_REGS_P ());
1178 #endif
1179 #ifdef DEPRECATED_FRAME_INIT_SAVED_REGS
1180 #if GDB_MULTI_ARCH
1181 /* Macro might contain `[{}]' when not multi-arch */
1182 fprintf_unfiltered (file,
1183 "gdbarch_dump: %s # %s\n",
1184 "DEPRECATED_FRAME_INIT_SAVED_REGS(frame)",
1185 XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS (frame)));
1186 #endif
1187 if (GDB_MULTI_ARCH)
1188 fprintf_unfiltered (file,
1189 "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS = <0x%08lx>\n",
1190 (long) current_gdbarch->deprecated_frame_init_saved_regs
1191 /*DEPRECATED_FRAME_INIT_SAVED_REGS ()*/);
1192 #endif
1193 #ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO_P
1194 fprintf_unfiltered (file,
1195 "gdbarch_dump: %s # %s\n",
1196 "DEPRECATED_INIT_EXTRA_FRAME_INFO_P()",
1197 XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()));
1198 fprintf_unfiltered (file,
1199 "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO_P() = %d\n",
1200 DEPRECATED_INIT_EXTRA_FRAME_INFO_P ());
1201 #endif
1202 #ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO
1203 #if GDB_MULTI_ARCH
1204 /* Macro might contain `[{}]' when not multi-arch */
1205 fprintf_unfiltered (file,
1206 "gdbarch_dump: %s # %s\n",
1207 "DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
1208 XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
1209 #endif
1210 if (GDB_MULTI_ARCH)
1211 fprintf_unfiltered (file,
1212 "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO = <0x%08lx>\n",
1213 (long) current_gdbarch->deprecated_init_extra_frame_info
1214 /*DEPRECATED_INIT_EXTRA_FRAME_INFO ()*/);
1215 #endif
1216 #ifdef DEPRECATED_INIT_FRAME_PC_P
1217 fprintf_unfiltered (file,
1218 "gdbarch_dump: %s # %s\n",
1219 "DEPRECATED_INIT_FRAME_PC_P()",
1220 XSTRING (DEPRECATED_INIT_FRAME_PC_P ()));
1221 fprintf_unfiltered (file,
1222 "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_P() = %d\n",
1223 DEPRECATED_INIT_FRAME_PC_P ());
1224 #endif
1225 #ifdef DEPRECATED_INIT_FRAME_PC
1226 fprintf_unfiltered (file,
1227 "gdbarch_dump: %s # %s\n",
1228 "DEPRECATED_INIT_FRAME_PC(fromleaf, prev)",
1229 XSTRING (DEPRECATED_INIT_FRAME_PC (fromleaf, prev)));
1230 if (GDB_MULTI_ARCH)
1231 fprintf_unfiltered (file,
1232 "gdbarch_dump: DEPRECATED_INIT_FRAME_PC = <0x%08lx>\n",
1233 (long) current_gdbarch->deprecated_init_frame_pc
1234 /*DEPRECATED_INIT_FRAME_PC ()*/);
1235 #endif
1236 #ifdef DEPRECATED_INIT_FRAME_PC_FIRST_P
1237 fprintf_unfiltered (file,
1238 "gdbarch_dump: %s # %s\n",
1239 "DEPRECATED_INIT_FRAME_PC_FIRST_P()",
1240 XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST_P ()));
1241 fprintf_unfiltered (file,
1242 "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST_P() = %d\n",
1243 DEPRECATED_INIT_FRAME_PC_FIRST_P ());
1244 #endif
1245 #ifdef DEPRECATED_INIT_FRAME_PC_FIRST
1246 fprintf_unfiltered (file,
1247 "gdbarch_dump: %s # %s\n",
1248 "DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev)",
1249 XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev)));
1250 if (GDB_MULTI_ARCH)
1251 fprintf_unfiltered (file,
1252 "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST = <0x%08lx>\n",
1253 (long) current_gdbarch->deprecated_init_frame_pc_first
1254 /*DEPRECATED_INIT_FRAME_PC_FIRST ()*/);
1255 #endif
1256 #ifdef DEPRECATED_MAX_REGISTER_RAW_SIZE_P
1257 fprintf_unfiltered (file,
1258 "gdbarch_dump: %s # %s\n",
1259 "DEPRECATED_MAX_REGISTER_RAW_SIZE_P()",
1260 XSTRING (DEPRECATED_MAX_REGISTER_RAW_SIZE_P ()));
1261 fprintf_unfiltered (file,
1262 "gdbarch_dump: DEPRECATED_MAX_REGISTER_RAW_SIZE_P() = %d\n",
1263 DEPRECATED_MAX_REGISTER_RAW_SIZE_P ());
1264 #endif
1265 #ifdef DEPRECATED_MAX_REGISTER_RAW_SIZE
1266 fprintf_unfiltered (file,
1267 "gdbarch_dump: DEPRECATED_MAX_REGISTER_RAW_SIZE # %s\n",
1268 XSTRING (DEPRECATED_MAX_REGISTER_RAW_SIZE));
1269 fprintf_unfiltered (file,
1270 "gdbarch_dump: DEPRECATED_MAX_REGISTER_RAW_SIZE = %d\n",
1271 DEPRECATED_MAX_REGISTER_RAW_SIZE);
1272 #endif
1273 #ifdef DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P
1274 fprintf_unfiltered (file,
1275 "gdbarch_dump: %s # %s\n",
1276 "DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P()",
1277 XSTRING (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P ()));
1278 fprintf_unfiltered (file,
1279 "gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() = %d\n",
1280 DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P ());
1281 #endif
1282 #ifdef DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE
1283 fprintf_unfiltered (file,
1284 "gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE # %s\n",
1285 XSTRING (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE));
1286 fprintf_unfiltered (file,
1287 "gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE = %d\n",
1288 DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE);
1289 #endif
1290 #ifdef DEPRECATED_PC_IN_CALL_DUMMY_P
1291 fprintf_unfiltered (file,
1292 "gdbarch_dump: %s # %s\n",
1293 "DEPRECATED_PC_IN_CALL_DUMMY_P()",
1294 XSTRING (DEPRECATED_PC_IN_CALL_DUMMY_P ()));
1295 fprintf_unfiltered (file,
1296 "gdbarch_dump: DEPRECATED_PC_IN_CALL_DUMMY_P() = %d\n",
1297 DEPRECATED_PC_IN_CALL_DUMMY_P ());
1298 #endif
1299 #ifdef DEPRECATED_PC_IN_CALL_DUMMY
1300 fprintf_unfiltered (file,
1301 "gdbarch_dump: %s # %s\n",
1302 "DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address)",
1303 XSTRING (DEPRECATED_PC_IN_CALL_DUMMY (pc, sp, frame_address)));
1304 if (GDB_MULTI_ARCH)
1305 fprintf_unfiltered (file,
1306 "gdbarch_dump: DEPRECATED_PC_IN_CALL_DUMMY = <0x%08lx>\n",
1307 (long) current_gdbarch->deprecated_pc_in_call_dummy
1308 /*DEPRECATED_PC_IN_CALL_DUMMY ()*/);
1309 #endif
1310 #ifdef DEPRECATED_PUSH_DUMMY_FRAME_P
1311 fprintf_unfiltered (file,
1312 "gdbarch_dump: %s # %s\n",
1313 "DEPRECATED_PUSH_DUMMY_FRAME_P()",
1314 XSTRING (DEPRECATED_PUSH_DUMMY_FRAME_P ()));
1315 fprintf_unfiltered (file,
1316 "gdbarch_dump: DEPRECATED_PUSH_DUMMY_FRAME_P() = %d\n",
1317 DEPRECATED_PUSH_DUMMY_FRAME_P ());
1318 #endif
1319 #ifdef DEPRECATED_PUSH_DUMMY_FRAME
1320 #if GDB_MULTI_ARCH
1321 /* Macro might contain `[{}]' when not multi-arch */
1322 fprintf_unfiltered (file,
1323 "gdbarch_dump: %s # %s\n",
1324 "DEPRECATED_PUSH_DUMMY_FRAME(-)",
1325 XSTRING (DEPRECATED_PUSH_DUMMY_FRAME (-)));
1326 #endif
1327 if (GDB_MULTI_ARCH)
1328 fprintf_unfiltered (file,
1329 "gdbarch_dump: DEPRECATED_PUSH_DUMMY_FRAME = <0x%08lx>\n",
1330 (long) current_gdbarch->deprecated_push_dummy_frame
1331 /*DEPRECATED_PUSH_DUMMY_FRAME ()*/);
1332 #endif
1333 #ifdef DEPRECATED_STORE_RETURN_VALUE
1334 #if GDB_MULTI_ARCH
1335 /* Macro might contain `[{}]' when not multi-arch */
1336 fprintf_unfiltered (file,
1337 "gdbarch_dump: %s # %s\n",
1338 "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
1339 XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf)));
1340 #endif
1341 if (GDB_MULTI_ARCH)
1342 fprintf_unfiltered (file,
1343 "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = <0x%08lx>\n",
1344 (long) current_gdbarch->deprecated_store_return_value
1345 /*DEPRECATED_STORE_RETURN_VALUE ()*/);
1346 #endif
1347 #ifdef DEPRECATED_USE_GENERIC_DUMMY_FRAMES
1348 fprintf_unfiltered (file,
1349 "gdbarch_dump: DEPRECATED_USE_GENERIC_DUMMY_FRAMES # %s\n",
1350 XSTRING (DEPRECATED_USE_GENERIC_DUMMY_FRAMES));
1351 fprintf_unfiltered (file,
1352 "gdbarch_dump: DEPRECATED_USE_GENERIC_DUMMY_FRAMES = %d\n",
1353 DEPRECATED_USE_GENERIC_DUMMY_FRAMES);
1354 #endif
1355 #ifdef DWARF2_BUILD_FRAME_INFO_P
1356 fprintf_unfiltered (file,
1357 "gdbarch_dump: %s # %s\n",
1358 "DWARF2_BUILD_FRAME_INFO_P()",
1359 XSTRING (DWARF2_BUILD_FRAME_INFO_P ()));
1360 fprintf_unfiltered (file,
1361 "gdbarch_dump: DWARF2_BUILD_FRAME_INFO_P() = %d\n",
1362 DWARF2_BUILD_FRAME_INFO_P ());
1363 #endif
1364 #ifdef DWARF2_BUILD_FRAME_INFO
1365 #if GDB_MULTI_ARCH
1366 /* Macro might contain `[{}]' when not multi-arch */
1367 fprintf_unfiltered (file,
1368 "gdbarch_dump: %s # %s\n",
1369 "DWARF2_BUILD_FRAME_INFO(objfile)",
1370 XSTRING (DWARF2_BUILD_FRAME_INFO (objfile)));
1371 #endif
1372 if (GDB_MULTI_ARCH)
1373 fprintf_unfiltered (file,
1374 "gdbarch_dump: DWARF2_BUILD_FRAME_INFO = <0x%08lx>\n",
1375 (long) current_gdbarch->dwarf2_build_frame_info
1376 /*DWARF2_BUILD_FRAME_INFO ()*/);
1377 #endif
1378 #ifdef DWARF2_REG_TO_REGNUM
1379 fprintf_unfiltered (file,
1380 "gdbarch_dump: %s # %s\n",
1381 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
1382 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
1383 if (GDB_MULTI_ARCH)
1384 fprintf_unfiltered (file,
1385 "gdbarch_dump: DWARF2_REG_TO_REGNUM = <0x%08lx>\n",
1386 (long) current_gdbarch->dwarf2_reg_to_regnum
1387 /*DWARF2_REG_TO_REGNUM ()*/);
1388 #endif
1389 #ifdef DWARF_REG_TO_REGNUM
1390 fprintf_unfiltered (file,
1391 "gdbarch_dump: %s # %s\n",
1392 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1393 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
1394 if (GDB_MULTI_ARCH)
1395 fprintf_unfiltered (file,
1396 "gdbarch_dump: DWARF_REG_TO_REGNUM = <0x%08lx>\n",
1397 (long) current_gdbarch->dwarf_reg_to_regnum
1398 /*DWARF_REG_TO_REGNUM ()*/);
1399 #endif
1400 #ifdef ECOFF_REG_TO_REGNUM
1401 fprintf_unfiltered (file,
1402 "gdbarch_dump: %s # %s\n",
1403 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1404 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
1405 if (GDB_MULTI_ARCH)
1406 fprintf_unfiltered (file,
1407 "gdbarch_dump: ECOFF_REG_TO_REGNUM = <0x%08lx>\n",
1408 (long) current_gdbarch->ecoff_reg_to_regnum
1409 /*ECOFF_REG_TO_REGNUM ()*/);
1410 #endif
1411 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
1412 #if GDB_MULTI_ARCH
1413 /* Macro might contain `[{}]' when not multi-arch */
1414 fprintf_unfiltered (file,
1415 "gdbarch_dump: %s # %s\n",
1416 "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1417 XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
1418 #endif
1419 if (GDB_MULTI_ARCH)
1420 fprintf_unfiltered (file,
1421 "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
1422 (long) current_gdbarch->elf_make_msymbol_special
1423 /*ELF_MAKE_MSYMBOL_SPECIAL ()*/);
1424 #endif
1425 #ifdef EXTRACT_RETURN_VALUE
1426 #if GDB_MULTI_ARCH
1427 /* Macro might contain `[{}]' when not multi-arch */
1428 fprintf_unfiltered (file,
1429 "gdbarch_dump: %s # %s\n",
1430 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1431 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
1432 #endif
1433 if (GDB_MULTI_ARCH)
1434 fprintf_unfiltered (file,
1435 "gdbarch_dump: EXTRACT_RETURN_VALUE = <0x%08lx>\n",
1436 (long) current_gdbarch->extract_return_value
1437 /*EXTRACT_RETURN_VALUE ()*/);
1438 #endif
1439 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS_P
1440 fprintf_unfiltered (file,
1441 "gdbarch_dump: %s # %s\n",
1442 "EXTRACT_STRUCT_VALUE_ADDRESS_P()",
1443 XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
1444 fprintf_unfiltered (file,
1445 "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS_P() = %d\n",
1446 EXTRACT_STRUCT_VALUE_ADDRESS_P ());
1447 #endif
1448 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1449 fprintf_unfiltered (file,
1450 "gdbarch_dump: %s # %s\n",
1451 "EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
1452 XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
1453 if (GDB_MULTI_ARCH)
1454 fprintf_unfiltered (file,
1455 "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n",
1456 (long) current_gdbarch->extract_struct_value_address
1457 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
1458 #endif
1459 #ifdef EXTRA_STACK_ALIGNMENT_NEEDED
1460 fprintf_unfiltered (file,
1461 "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n",
1462 XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED));
1463 fprintf_unfiltered (file,
1464 "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %d\n",
1465 EXTRA_STACK_ALIGNMENT_NEEDED);
1466 #endif
1467 #ifdef FIX_CALL_DUMMY
1468 #if GDB_MULTI_ARCH
1469 /* Macro might contain `[{}]' when not multi-arch */
1470 fprintf_unfiltered (file,
1471 "gdbarch_dump: %s # %s\n",
1472 "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
1473 XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
1474 #endif
1475 if (GDB_MULTI_ARCH)
1476 fprintf_unfiltered (file,
1477 "gdbarch_dump: FIX_CALL_DUMMY = <0x%08lx>\n",
1478 (long) current_gdbarch->fix_call_dummy
1479 /*FIX_CALL_DUMMY ()*/);
1480 #endif
1481 #ifdef FP0_REGNUM
1482 fprintf_unfiltered (file,
1483 "gdbarch_dump: FP0_REGNUM # %s\n",
1484 XSTRING (FP0_REGNUM));
1485 fprintf_unfiltered (file,
1486 "gdbarch_dump: FP0_REGNUM = %d\n",
1487 FP0_REGNUM);
1488 #endif
1489 #ifdef FP_REGNUM
1490 fprintf_unfiltered (file,
1491 "gdbarch_dump: FP_REGNUM # %s\n",
1492 XSTRING (FP_REGNUM));
1493 fprintf_unfiltered (file,
1494 "gdbarch_dump: FP_REGNUM = %d\n",
1495 FP_REGNUM);
1496 #endif
1497 #ifdef FRAMELESS_FUNCTION_INVOCATION
1498 fprintf_unfiltered (file,
1499 "gdbarch_dump: %s # %s\n",
1500 "FRAMELESS_FUNCTION_INVOCATION(fi)",
1501 XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi)));
1502 if (GDB_MULTI_ARCH)
1503 fprintf_unfiltered (file,
1504 "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = <0x%08lx>\n",
1505 (long) current_gdbarch->frameless_function_invocation
1506 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
1507 #endif
1508 #ifdef FRAME_ARGS_ADDRESS
1509 fprintf_unfiltered (file,
1510 "gdbarch_dump: %s # %s\n",
1511 "FRAME_ARGS_ADDRESS(fi)",
1512 XSTRING (FRAME_ARGS_ADDRESS (fi)));
1513 if (GDB_MULTI_ARCH)
1514 fprintf_unfiltered (file,
1515 "gdbarch_dump: FRAME_ARGS_ADDRESS = <0x%08lx>\n",
1516 (long) current_gdbarch->frame_args_address
1517 /*FRAME_ARGS_ADDRESS ()*/);
1518 #endif
1519 #ifdef FRAME_ARGS_SKIP
1520 fprintf_unfiltered (file,
1521 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1522 XSTRING (FRAME_ARGS_SKIP));
1523 fprintf_unfiltered (file,
1524 "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n",
1525 (long) FRAME_ARGS_SKIP);
1526 #endif
1527 #ifdef FRAME_CHAIN_P
1528 fprintf_unfiltered (file,
1529 "gdbarch_dump: %s # %s\n",
1530 "FRAME_CHAIN_P()",
1531 XSTRING (FRAME_CHAIN_P ()));
1532 fprintf_unfiltered (file,
1533 "gdbarch_dump: FRAME_CHAIN_P() = %d\n",
1534 FRAME_CHAIN_P ());
1535 #endif
1536 #ifdef FRAME_CHAIN
1537 fprintf_unfiltered (file,
1538 "gdbarch_dump: %s # %s\n",
1539 "FRAME_CHAIN(frame)",
1540 XSTRING (FRAME_CHAIN (frame)));
1541 if (GDB_MULTI_ARCH)
1542 fprintf_unfiltered (file,
1543 "gdbarch_dump: FRAME_CHAIN = <0x%08lx>\n",
1544 (long) current_gdbarch->frame_chain
1545 /*FRAME_CHAIN ()*/);
1546 #endif
1547 #ifdef FRAME_CHAIN_VALID_P
1548 fprintf_unfiltered (file,
1549 "gdbarch_dump: %s # %s\n",
1550 "FRAME_CHAIN_VALID_P()",
1551 XSTRING (FRAME_CHAIN_VALID_P ()));
1552 fprintf_unfiltered (file,
1553 "gdbarch_dump: FRAME_CHAIN_VALID_P() = %d\n",
1554 FRAME_CHAIN_VALID_P ());
1555 #endif
1556 #ifdef FRAME_CHAIN_VALID
1557 fprintf_unfiltered (file,
1558 "gdbarch_dump: %s # %s\n",
1559 "FRAME_CHAIN_VALID(chain, thisframe)",
1560 XSTRING (FRAME_CHAIN_VALID (chain, thisframe)));
1561 if (GDB_MULTI_ARCH)
1562 fprintf_unfiltered (file,
1563 "gdbarch_dump: FRAME_CHAIN_VALID = <0x%08lx>\n",
1564 (long) current_gdbarch->frame_chain_valid
1565 /*FRAME_CHAIN_VALID ()*/);
1566 #endif
1567 #ifdef FRAME_LOCALS_ADDRESS
1568 fprintf_unfiltered (file,
1569 "gdbarch_dump: %s # %s\n",
1570 "FRAME_LOCALS_ADDRESS(fi)",
1571 XSTRING (FRAME_LOCALS_ADDRESS (fi)));
1572 if (GDB_MULTI_ARCH)
1573 fprintf_unfiltered (file,
1574 "gdbarch_dump: FRAME_LOCALS_ADDRESS = <0x%08lx>\n",
1575 (long) current_gdbarch->frame_locals_address
1576 /*FRAME_LOCALS_ADDRESS ()*/);
1577 #endif
1578 #ifdef FRAME_NUM_ARGS
1579 fprintf_unfiltered (file,
1580 "gdbarch_dump: %s # %s\n",
1581 "FRAME_NUM_ARGS(frame)",
1582 XSTRING (FRAME_NUM_ARGS (frame)));
1583 if (GDB_MULTI_ARCH)
1584 fprintf_unfiltered (file,
1585 "gdbarch_dump: FRAME_NUM_ARGS = <0x%08lx>\n",
1586 (long) current_gdbarch->frame_num_args
1587 /*FRAME_NUM_ARGS ()*/);
1588 #endif
1589 #ifdef FRAME_SAVED_PC_P
1590 fprintf_unfiltered (file,
1591 "gdbarch_dump: %s # %s\n",
1592 "FRAME_SAVED_PC_P()",
1593 XSTRING (FRAME_SAVED_PC_P ()));
1594 fprintf_unfiltered (file,
1595 "gdbarch_dump: FRAME_SAVED_PC_P() = %d\n",
1596 FRAME_SAVED_PC_P ());
1597 #endif
1598 #ifdef FRAME_SAVED_PC
1599 fprintf_unfiltered (file,
1600 "gdbarch_dump: %s # %s\n",
1601 "FRAME_SAVED_PC(fi)",
1602 XSTRING (FRAME_SAVED_PC (fi)));
1603 if (GDB_MULTI_ARCH)
1604 fprintf_unfiltered (file,
1605 "gdbarch_dump: FRAME_SAVED_PC = <0x%08lx>\n",
1606 (long) current_gdbarch->frame_saved_pc
1607 /*FRAME_SAVED_PC ()*/);
1608 #endif
1609 #ifdef FUNCTION_START_OFFSET
1610 fprintf_unfiltered (file,
1611 "gdbarch_dump: FUNCTION_START_OFFSET # %s\n",
1612 XSTRING (FUNCTION_START_OFFSET));
1613 fprintf_unfiltered (file,
1614 "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n",
1615 (long) FUNCTION_START_OFFSET);
1616 #endif
1617 #ifdef GET_LONGJMP_TARGET_P
1618 fprintf_unfiltered (file,
1619 "gdbarch_dump: %s # %s\n",
1620 "GET_LONGJMP_TARGET_P()",
1621 XSTRING (GET_LONGJMP_TARGET_P ()));
1622 fprintf_unfiltered (file,
1623 "gdbarch_dump: GET_LONGJMP_TARGET_P() = %d\n",
1624 GET_LONGJMP_TARGET_P ());
1625 #endif
1626 #ifdef GET_LONGJMP_TARGET
1627 fprintf_unfiltered (file,
1628 "gdbarch_dump: %s # %s\n",
1629 "GET_LONGJMP_TARGET(pc)",
1630 XSTRING (GET_LONGJMP_TARGET (pc)));
1631 if (GDB_MULTI_ARCH)
1632 fprintf_unfiltered (file,
1633 "gdbarch_dump: GET_LONGJMP_TARGET = <0x%08lx>\n",
1634 (long) current_gdbarch->get_longjmp_target
1635 /*GET_LONGJMP_TARGET ()*/);
1636 #endif
1637 #ifdef GET_SAVED_REGISTER_P
1638 fprintf_unfiltered (file,
1639 "gdbarch_dump: %s # %s\n",
1640 "GET_SAVED_REGISTER_P()",
1641 XSTRING (GET_SAVED_REGISTER_P ()));
1642 fprintf_unfiltered (file,
1643 "gdbarch_dump: GET_SAVED_REGISTER_P() = %d\n",
1644 GET_SAVED_REGISTER_P ());
1645 #endif
1646 #ifdef GET_SAVED_REGISTER
1647 #if GDB_MULTI_ARCH
1648 /* Macro might contain `[{}]' when not multi-arch */
1649 fprintf_unfiltered (file,
1650 "gdbarch_dump: %s # %s\n",
1651 "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
1652 XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
1653 #endif
1654 if (GDB_MULTI_ARCH)
1655 fprintf_unfiltered (file,
1656 "gdbarch_dump: GET_SAVED_REGISTER = <0x%08lx>\n",
1657 (long) current_gdbarch->get_saved_register
1658 /*GET_SAVED_REGISTER ()*/);
1659 #endif
1660 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
1661 fprintf_unfiltered (file,
1662 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1663 XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
1664 fprintf_unfiltered (file,
1665 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT = %d\n",
1666 HAVE_NONSTEPPABLE_WATCHPOINT);
1667 #endif
1668 #ifdef INNER_THAN
1669 fprintf_unfiltered (file,
1670 "gdbarch_dump: %s # %s\n",
1671 "INNER_THAN(lhs, rhs)",
1672 XSTRING (INNER_THAN (lhs, rhs)));
1673 if (GDB_MULTI_ARCH)
1674 fprintf_unfiltered (file,
1675 "gdbarch_dump: INNER_THAN = <0x%08lx>\n",
1676 (long) current_gdbarch->inner_than
1677 /*INNER_THAN ()*/);
1678 #endif
1679 #ifdef INTEGER_TO_ADDRESS_P
1680 fprintf_unfiltered (file,
1681 "gdbarch_dump: %s # %s\n",
1682 "INTEGER_TO_ADDRESS_P()",
1683 XSTRING (INTEGER_TO_ADDRESS_P ()));
1684 fprintf_unfiltered (file,
1685 "gdbarch_dump: INTEGER_TO_ADDRESS_P() = %d\n",
1686 INTEGER_TO_ADDRESS_P ());
1687 #endif
1688 #ifdef INTEGER_TO_ADDRESS
1689 fprintf_unfiltered (file,
1690 "gdbarch_dump: %s # %s\n",
1691 "INTEGER_TO_ADDRESS(type, buf)",
1692 XSTRING (INTEGER_TO_ADDRESS (type, buf)));
1693 if (GDB_MULTI_ARCH)
1694 fprintf_unfiltered (file,
1695 "gdbarch_dump: INTEGER_TO_ADDRESS = <0x%08lx>\n",
1696 (long) current_gdbarch->integer_to_address
1697 /*INTEGER_TO_ADDRESS ()*/);
1698 #endif
1699 #ifdef IN_SOLIB_CALL_TRAMPOLINE
1700 fprintf_unfiltered (file,
1701 "gdbarch_dump: %s # %s\n",
1702 "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
1703 XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
1704 if (GDB_MULTI_ARCH)
1705 fprintf_unfiltered (file,
1706 "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = <0x%08lx>\n",
1707 (long) current_gdbarch->in_solib_call_trampoline
1708 /*IN_SOLIB_CALL_TRAMPOLINE ()*/);
1709 #endif
1710 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1711 fprintf_unfiltered (file,
1712 "gdbarch_dump: %s # %s\n",
1713 "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1714 XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
1715 if (GDB_MULTI_ARCH)
1716 fprintf_unfiltered (file,
1717 "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = <0x%08lx>\n",
1718 (long) current_gdbarch->in_solib_return_trampoline
1719 /*IN_SOLIB_RETURN_TRAMPOLINE ()*/);
1720 #endif
1721 #ifdef MEMORY_INSERT_BREAKPOINT
1722 fprintf_unfiltered (file,
1723 "gdbarch_dump: %s # %s\n",
1724 "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1725 XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
1726 if (GDB_MULTI_ARCH)
1727 fprintf_unfiltered (file,
1728 "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = <0x%08lx>\n",
1729 (long) current_gdbarch->memory_insert_breakpoint
1730 /*MEMORY_INSERT_BREAKPOINT ()*/);
1731 #endif
1732 #ifdef MEMORY_REMOVE_BREAKPOINT
1733 fprintf_unfiltered (file,
1734 "gdbarch_dump: %s # %s\n",
1735 "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1736 XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
1737 if (GDB_MULTI_ARCH)
1738 fprintf_unfiltered (file,
1739 "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = <0x%08lx>\n",
1740 (long) current_gdbarch->memory_remove_breakpoint
1741 /*MEMORY_REMOVE_BREAKPOINT ()*/);
1742 #endif
1743 #ifdef NAME_OF_MALLOC
1744 fprintf_unfiltered (file,
1745 "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1746 XSTRING (NAME_OF_MALLOC));
1747 fprintf_unfiltered (file,
1748 "gdbarch_dump: NAME_OF_MALLOC = %s\n",
1749 NAME_OF_MALLOC);
1750 #endif
1751 #ifdef NPC_REGNUM
1752 fprintf_unfiltered (file,
1753 "gdbarch_dump: NPC_REGNUM # %s\n",
1754 XSTRING (NPC_REGNUM));
1755 fprintf_unfiltered (file,
1756 "gdbarch_dump: NPC_REGNUM = %d\n",
1757 NPC_REGNUM);
1758 #endif
1759 #ifdef NUM_PSEUDO_REGS
1760 fprintf_unfiltered (file,
1761 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1762 XSTRING (NUM_PSEUDO_REGS));
1763 fprintf_unfiltered (file,
1764 "gdbarch_dump: NUM_PSEUDO_REGS = %d\n",
1765 NUM_PSEUDO_REGS);
1766 #endif
1767 #ifdef NUM_REGS
1768 fprintf_unfiltered (file,
1769 "gdbarch_dump: NUM_REGS # %s\n",
1770 XSTRING (NUM_REGS));
1771 fprintf_unfiltered (file,
1772 "gdbarch_dump: NUM_REGS = %d\n",
1773 NUM_REGS);
1774 #endif
1775 #ifdef PARM_BOUNDARY
1776 fprintf_unfiltered (file,
1777 "gdbarch_dump: PARM_BOUNDARY # %s\n",
1778 XSTRING (PARM_BOUNDARY));
1779 fprintf_unfiltered (file,
1780 "gdbarch_dump: PARM_BOUNDARY = %d\n",
1781 PARM_BOUNDARY);
1782 #endif
1783 #ifdef PC_IN_SIGTRAMP
1784 fprintf_unfiltered (file,
1785 "gdbarch_dump: %s # %s\n",
1786 "PC_IN_SIGTRAMP(pc, name)",
1787 XSTRING (PC_IN_SIGTRAMP (pc, name)));
1788 if (GDB_MULTI_ARCH)
1789 fprintf_unfiltered (file,
1790 "gdbarch_dump: PC_IN_SIGTRAMP = <0x%08lx>\n",
1791 (long) current_gdbarch->pc_in_sigtramp
1792 /*PC_IN_SIGTRAMP ()*/);
1793 #endif
1794 #ifdef PC_REGNUM
1795 fprintf_unfiltered (file,
1796 "gdbarch_dump: PC_REGNUM # %s\n",
1797 XSTRING (PC_REGNUM));
1798 fprintf_unfiltered (file,
1799 "gdbarch_dump: PC_REGNUM = %d\n",
1800 PC_REGNUM);
1801 #endif
1802 #ifdef POINTER_TO_ADDRESS
1803 fprintf_unfiltered (file,
1804 "gdbarch_dump: %s # %s\n",
1805 "POINTER_TO_ADDRESS(type, buf)",
1806 XSTRING (POINTER_TO_ADDRESS (type, buf)));
1807 if (GDB_MULTI_ARCH)
1808 fprintf_unfiltered (file,
1809 "gdbarch_dump: POINTER_TO_ADDRESS = <0x%08lx>\n",
1810 (long) current_gdbarch->pointer_to_address
1811 /*POINTER_TO_ADDRESS ()*/);
1812 #endif
1813 #ifdef POP_FRAME_P
1814 fprintf_unfiltered (file,
1815 "gdbarch_dump: %s # %s\n",
1816 "POP_FRAME_P()",
1817 XSTRING (POP_FRAME_P ()));
1818 fprintf_unfiltered (file,
1819 "gdbarch_dump: POP_FRAME_P() = %d\n",
1820 POP_FRAME_P ());
1821 #endif
1822 #ifdef POP_FRAME
1823 #if GDB_MULTI_ARCH
1824 /* Macro might contain `[{}]' when not multi-arch */
1825 fprintf_unfiltered (file,
1826 "gdbarch_dump: %s # %s\n",
1827 "POP_FRAME(-)",
1828 XSTRING (POP_FRAME (-)));
1829 #endif
1830 if (GDB_MULTI_ARCH)
1831 fprintf_unfiltered (file,
1832 "gdbarch_dump: POP_FRAME = <0x%08lx>\n",
1833 (long) current_gdbarch->pop_frame
1834 /*POP_FRAME ()*/);
1835 #endif
1836 #ifdef PREPARE_TO_PROCEED
1837 fprintf_unfiltered (file,
1838 "gdbarch_dump: %s # %s\n",
1839 "PREPARE_TO_PROCEED(select_it)",
1840 XSTRING (PREPARE_TO_PROCEED (select_it)));
1841 if (GDB_MULTI_ARCH)
1842 fprintf_unfiltered (file,
1843 "gdbarch_dump: PREPARE_TO_PROCEED = <0x%08lx>\n",
1844 (long) current_gdbarch->prepare_to_proceed
1845 /*PREPARE_TO_PROCEED ()*/);
1846 #endif
1847 if (GDB_MULTI_ARCH)
1848 fprintf_unfiltered (file,
1849 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1850 gdbarch_print_float_info_p (current_gdbarch));
1851 if (GDB_MULTI_ARCH)
1852 fprintf_unfiltered (file,
1853 "gdbarch_dump: print_float_info = 0x%08lx\n",
1854 (long) current_gdbarch->print_float_info);
1855 if (GDB_MULTI_ARCH)
1856 fprintf_unfiltered (file,
1857 "gdbarch_dump: print_registers_info = 0x%08lx\n",
1858 (long) current_gdbarch->print_registers_info);
1859 if (GDB_MULTI_ARCH)
1860 fprintf_unfiltered (file,
1861 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1862 gdbarch_print_vector_info_p (current_gdbarch));
1863 if (GDB_MULTI_ARCH)
1864 fprintf_unfiltered (file,
1865 "gdbarch_dump: print_vector_info = 0x%08lx\n",
1866 (long) current_gdbarch->print_vector_info);
1867 #ifdef PROLOGUE_FRAMELESS_P
1868 fprintf_unfiltered (file,
1869 "gdbarch_dump: %s # %s\n",
1870 "PROLOGUE_FRAMELESS_P(ip)",
1871 XSTRING (PROLOGUE_FRAMELESS_P (ip)));
1872 if (GDB_MULTI_ARCH)
1873 fprintf_unfiltered (file,
1874 "gdbarch_dump: PROLOGUE_FRAMELESS_P = <0x%08lx>\n",
1875 (long) current_gdbarch->prologue_frameless_p
1876 /*PROLOGUE_FRAMELESS_P ()*/);
1877 #endif
1878 #ifdef PS_REGNUM
1879 fprintf_unfiltered (file,
1880 "gdbarch_dump: PS_REGNUM # %s\n",
1881 XSTRING (PS_REGNUM));
1882 fprintf_unfiltered (file,
1883 "gdbarch_dump: PS_REGNUM = %d\n",
1884 PS_REGNUM);
1885 #endif
1886 #ifdef PUSH_ARGUMENTS
1887 fprintf_unfiltered (file,
1888 "gdbarch_dump: %s # %s\n",
1889 "PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
1890 XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
1891 if (GDB_MULTI_ARCH)
1892 fprintf_unfiltered (file,
1893 "gdbarch_dump: PUSH_ARGUMENTS = <0x%08lx>\n",
1894 (long) current_gdbarch->push_arguments
1895 /*PUSH_ARGUMENTS ()*/);
1896 #endif
1897 #ifdef PUSH_RETURN_ADDRESS_P
1898 fprintf_unfiltered (file,
1899 "gdbarch_dump: %s # %s\n",
1900 "PUSH_RETURN_ADDRESS_P()",
1901 XSTRING (PUSH_RETURN_ADDRESS_P ()));
1902 fprintf_unfiltered (file,
1903 "gdbarch_dump: PUSH_RETURN_ADDRESS_P() = %d\n",
1904 PUSH_RETURN_ADDRESS_P ());
1905 #endif
1906 #ifdef PUSH_RETURN_ADDRESS
1907 fprintf_unfiltered (file,
1908 "gdbarch_dump: %s # %s\n",
1909 "PUSH_RETURN_ADDRESS(pc, sp)",
1910 XSTRING (PUSH_RETURN_ADDRESS (pc, sp)));
1911 if (GDB_MULTI_ARCH)
1912 fprintf_unfiltered (file,
1913 "gdbarch_dump: PUSH_RETURN_ADDRESS = <0x%08lx>\n",
1914 (long) current_gdbarch->push_return_address
1915 /*PUSH_RETURN_ADDRESS ()*/);
1916 #endif
1917 #ifdef REGISTER_BYTE
1918 fprintf_unfiltered (file,
1919 "gdbarch_dump: %s # %s\n",
1920 "REGISTER_BYTE(reg_nr)",
1921 XSTRING (REGISTER_BYTE (reg_nr)));
1922 if (GDB_MULTI_ARCH)
1923 fprintf_unfiltered (file,
1924 "gdbarch_dump: REGISTER_BYTE = <0x%08lx>\n",
1925 (long) current_gdbarch->register_byte
1926 /*REGISTER_BYTE ()*/);
1927 #endif
1928 #ifdef REGISTER_BYTES
1929 fprintf_unfiltered (file,
1930 "gdbarch_dump: REGISTER_BYTES # %s\n",
1931 XSTRING (REGISTER_BYTES));
1932 fprintf_unfiltered (file,
1933 "gdbarch_dump: REGISTER_BYTES = %d\n",
1934 REGISTER_BYTES);
1935 #endif
1936 #ifdef REGISTER_BYTES_OK_P
1937 fprintf_unfiltered (file,
1938 "gdbarch_dump: %s # %s\n",
1939 "REGISTER_BYTES_OK_P()",
1940 XSTRING (REGISTER_BYTES_OK_P ()));
1941 fprintf_unfiltered (file,
1942 "gdbarch_dump: REGISTER_BYTES_OK_P() = %d\n",
1943 REGISTER_BYTES_OK_P ());
1944 #endif
1945 #ifdef REGISTER_BYTES_OK
1946 fprintf_unfiltered (file,
1947 "gdbarch_dump: %s # %s\n",
1948 "REGISTER_BYTES_OK(nr_bytes)",
1949 XSTRING (REGISTER_BYTES_OK (nr_bytes)));
1950 if (GDB_MULTI_ARCH)
1951 fprintf_unfiltered (file,
1952 "gdbarch_dump: REGISTER_BYTES_OK = <0x%08lx>\n",
1953 (long) current_gdbarch->register_bytes_ok
1954 /*REGISTER_BYTES_OK ()*/);
1955 #endif
1956 #ifdef REGISTER_CONVERTIBLE
1957 fprintf_unfiltered (file,
1958 "gdbarch_dump: %s # %s\n",
1959 "REGISTER_CONVERTIBLE(nr)",
1960 XSTRING (REGISTER_CONVERTIBLE (nr)));
1961 if (GDB_MULTI_ARCH)
1962 fprintf_unfiltered (file,
1963 "gdbarch_dump: REGISTER_CONVERTIBLE = <0x%08lx>\n",
1964 (long) current_gdbarch->register_convertible
1965 /*REGISTER_CONVERTIBLE ()*/);
1966 #endif
1967 #ifdef REGISTER_CONVERT_TO_RAW
1968 #if GDB_MULTI_ARCH
1969 /* Macro might contain `[{}]' when not multi-arch */
1970 fprintf_unfiltered (file,
1971 "gdbarch_dump: %s # %s\n",
1972 "REGISTER_CONVERT_TO_RAW(type, regnum, from, to)",
1973 XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to)));
1974 #endif
1975 if (GDB_MULTI_ARCH)
1976 fprintf_unfiltered (file,
1977 "gdbarch_dump: REGISTER_CONVERT_TO_RAW = <0x%08lx>\n",
1978 (long) current_gdbarch->register_convert_to_raw
1979 /*REGISTER_CONVERT_TO_RAW ()*/);
1980 #endif
1981 #ifdef REGISTER_CONVERT_TO_VIRTUAL
1982 #if GDB_MULTI_ARCH
1983 /* Macro might contain `[{}]' when not multi-arch */
1984 fprintf_unfiltered (file,
1985 "gdbarch_dump: %s # %s\n",
1986 "REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)",
1987 XSTRING (REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to)));
1988 #endif
1989 if (GDB_MULTI_ARCH)
1990 fprintf_unfiltered (file,
1991 "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = <0x%08lx>\n",
1992 (long) current_gdbarch->register_convert_to_virtual
1993 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
1994 #endif
1995 #ifdef REGISTER_NAME
1996 fprintf_unfiltered (file,
1997 "gdbarch_dump: %s # %s\n",
1998 "REGISTER_NAME(regnr)",
1999 XSTRING (REGISTER_NAME (regnr)));
2000 if (GDB_MULTI_ARCH)
2001 fprintf_unfiltered (file,
2002 "gdbarch_dump: REGISTER_NAME = <0x%08lx>\n",
2003 (long) current_gdbarch->register_name
2004 /*REGISTER_NAME ()*/);
2005 #endif
2006 #ifdef REGISTER_RAW_SIZE
2007 fprintf_unfiltered (file,
2008 "gdbarch_dump: %s # %s\n",
2009 "REGISTER_RAW_SIZE(reg_nr)",
2010 XSTRING (REGISTER_RAW_SIZE (reg_nr)));
2011 if (GDB_MULTI_ARCH)
2012 fprintf_unfiltered (file,
2013 "gdbarch_dump: REGISTER_RAW_SIZE = <0x%08lx>\n",
2014 (long) current_gdbarch->register_raw_size
2015 /*REGISTER_RAW_SIZE ()*/);
2016 #endif
2017 #ifdef REGISTER_SIM_REGNO
2018 fprintf_unfiltered (file,
2019 "gdbarch_dump: %s # %s\n",
2020 "REGISTER_SIM_REGNO(reg_nr)",
2021 XSTRING (REGISTER_SIM_REGNO (reg_nr)));
2022 if (GDB_MULTI_ARCH)
2023 fprintf_unfiltered (file,
2024 "gdbarch_dump: REGISTER_SIM_REGNO = <0x%08lx>\n",
2025 (long) current_gdbarch->register_sim_regno
2026 /*REGISTER_SIM_REGNO ()*/);
2027 #endif
2028 #ifdef REGISTER_SIZE
2029 fprintf_unfiltered (file,
2030 "gdbarch_dump: REGISTER_SIZE # %s\n",
2031 XSTRING (REGISTER_SIZE));
2032 fprintf_unfiltered (file,
2033 "gdbarch_dump: REGISTER_SIZE = %d\n",
2034 REGISTER_SIZE);
2035 #endif
2036 #ifdef REGISTER_TO_VALUE
2037 #if GDB_MULTI_ARCH
2038 /* Macro might contain `[{}]' when not multi-arch */
2039 fprintf_unfiltered (file,
2040 "gdbarch_dump: %s # %s\n",
2041 "REGISTER_TO_VALUE(regnum, type, from, to)",
2042 XSTRING (REGISTER_TO_VALUE (regnum, type, from, to)));
2043 #endif
2044 if (GDB_MULTI_ARCH)
2045 fprintf_unfiltered (file,
2046 "gdbarch_dump: REGISTER_TO_VALUE = <0x%08lx>\n",
2047 (long) current_gdbarch->register_to_value
2048 /*REGISTER_TO_VALUE ()*/);
2049 #endif
2050 if (GDB_MULTI_ARCH)
2051 fprintf_unfiltered (file,
2052 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
2053 gdbarch_register_type_p (current_gdbarch));
2054 if (GDB_MULTI_ARCH)
2055 fprintf_unfiltered (file,
2056 "gdbarch_dump: register_type = 0x%08lx\n",
2057 (long) current_gdbarch->register_type);
2058 #ifdef REGISTER_VIRTUAL_SIZE
2059 fprintf_unfiltered (file,
2060 "gdbarch_dump: %s # %s\n",
2061 "REGISTER_VIRTUAL_SIZE(reg_nr)",
2062 XSTRING (REGISTER_VIRTUAL_SIZE (reg_nr)));
2063 if (GDB_MULTI_ARCH)
2064 fprintf_unfiltered (file,
2065 "gdbarch_dump: REGISTER_VIRTUAL_SIZE = <0x%08lx>\n",
2066 (long) current_gdbarch->register_virtual_size
2067 /*REGISTER_VIRTUAL_SIZE ()*/);
2068 #endif
2069 #ifdef REGISTER_VIRTUAL_TYPE_P
2070 fprintf_unfiltered (file,
2071 "gdbarch_dump: %s # %s\n",
2072 "REGISTER_VIRTUAL_TYPE_P()",
2073 XSTRING (REGISTER_VIRTUAL_TYPE_P ()));
2074 fprintf_unfiltered (file,
2075 "gdbarch_dump: REGISTER_VIRTUAL_TYPE_P() = %d\n",
2076 REGISTER_VIRTUAL_TYPE_P ());
2077 #endif
2078 #ifdef REGISTER_VIRTUAL_TYPE
2079 fprintf_unfiltered (file,
2080 "gdbarch_dump: %s # %s\n",
2081 "REGISTER_VIRTUAL_TYPE(reg_nr)",
2082 XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr)));
2083 if (GDB_MULTI_ARCH)
2084 fprintf_unfiltered (file,
2085 "gdbarch_dump: REGISTER_VIRTUAL_TYPE = <0x%08lx>\n",
2086 (long) current_gdbarch->register_virtual_type
2087 /*REGISTER_VIRTUAL_TYPE ()*/);
2088 #endif
2089 #ifdef REG_STRUCT_HAS_ADDR_P
2090 fprintf_unfiltered (file,
2091 "gdbarch_dump: %s # %s\n",
2092 "REG_STRUCT_HAS_ADDR_P()",
2093 XSTRING (REG_STRUCT_HAS_ADDR_P ()));
2094 fprintf_unfiltered (file,
2095 "gdbarch_dump: REG_STRUCT_HAS_ADDR_P() = %d\n",
2096 REG_STRUCT_HAS_ADDR_P ());
2097 #endif
2098 #ifdef REG_STRUCT_HAS_ADDR
2099 fprintf_unfiltered (file,
2100 "gdbarch_dump: %s # %s\n",
2101 "REG_STRUCT_HAS_ADDR(gcc_p, type)",
2102 XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type)));
2103 if (GDB_MULTI_ARCH)
2104 fprintf_unfiltered (file,
2105 "gdbarch_dump: REG_STRUCT_HAS_ADDR = <0x%08lx>\n",
2106 (long) current_gdbarch->reg_struct_has_addr
2107 /*REG_STRUCT_HAS_ADDR ()*/);
2108 #endif
2109 #ifdef REMOTE_TRANSLATE_XFER_ADDRESS
2110 #if GDB_MULTI_ARCH
2111 /* Macro might contain `[{}]' when not multi-arch */
2112 fprintf_unfiltered (file,
2113 "gdbarch_dump: %s # %s\n",
2114 "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)",
2115 XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len)));
2116 #endif
2117 if (GDB_MULTI_ARCH)
2118 fprintf_unfiltered (file,
2119 "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = <0x%08lx>\n",
2120 (long) current_gdbarch->remote_translate_xfer_address
2121 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
2122 #endif
2123 #ifdef RETURN_VALUE_ON_STACK
2124 fprintf_unfiltered (file,
2125 "gdbarch_dump: %s # %s\n",
2126 "RETURN_VALUE_ON_STACK(type)",
2127 XSTRING (RETURN_VALUE_ON_STACK (type)));
2128 if (GDB_MULTI_ARCH)
2129 fprintf_unfiltered (file,
2130 "gdbarch_dump: RETURN_VALUE_ON_STACK = <0x%08lx>\n",
2131 (long) current_gdbarch->return_value_on_stack
2132 /*RETURN_VALUE_ON_STACK ()*/);
2133 #endif
2134 #ifdef SAVED_PC_AFTER_CALL
2135 fprintf_unfiltered (file,
2136 "gdbarch_dump: %s # %s\n",
2137 "SAVED_PC_AFTER_CALL(frame)",
2138 XSTRING (SAVED_PC_AFTER_CALL (frame)));
2139 if (GDB_MULTI_ARCH)
2140 fprintf_unfiltered (file,
2141 "gdbarch_dump: SAVED_PC_AFTER_CALL = <0x%08lx>\n",
2142 (long) current_gdbarch->saved_pc_after_call
2143 /*SAVED_PC_AFTER_CALL ()*/);
2144 #endif
2145 #ifdef SAVE_DUMMY_FRAME_TOS_P
2146 fprintf_unfiltered (file,
2147 "gdbarch_dump: %s # %s\n",
2148 "SAVE_DUMMY_FRAME_TOS_P()",
2149 XSTRING (SAVE_DUMMY_FRAME_TOS_P ()));
2150 fprintf_unfiltered (file,
2151 "gdbarch_dump: SAVE_DUMMY_FRAME_TOS_P() = %d\n",
2152 SAVE_DUMMY_FRAME_TOS_P ());
2153 #endif
2154 #ifdef SAVE_DUMMY_FRAME_TOS
2155 #if GDB_MULTI_ARCH
2156 /* Macro might contain `[{}]' when not multi-arch */
2157 fprintf_unfiltered (file,
2158 "gdbarch_dump: %s # %s\n",
2159 "SAVE_DUMMY_FRAME_TOS(sp)",
2160 XSTRING (SAVE_DUMMY_FRAME_TOS (sp)));
2161 #endif
2162 if (GDB_MULTI_ARCH)
2163 fprintf_unfiltered (file,
2164 "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = <0x%08lx>\n",
2165 (long) current_gdbarch->save_dummy_frame_tos
2166 /*SAVE_DUMMY_FRAME_TOS ()*/);
2167 #endif
2168 #ifdef SDB_REG_TO_REGNUM
2169 fprintf_unfiltered (file,
2170 "gdbarch_dump: %s # %s\n",
2171 "SDB_REG_TO_REGNUM(sdb_regnr)",
2172 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
2173 if (GDB_MULTI_ARCH)
2174 fprintf_unfiltered (file,
2175 "gdbarch_dump: SDB_REG_TO_REGNUM = <0x%08lx>\n",
2176 (long) current_gdbarch->sdb_reg_to_regnum
2177 /*SDB_REG_TO_REGNUM ()*/);
2178 #endif
2179 #ifdef SIGTRAMP_END_P
2180 fprintf_unfiltered (file,
2181 "gdbarch_dump: %s # %s\n",
2182 "SIGTRAMP_END_P()",
2183 XSTRING (SIGTRAMP_END_P ()));
2184 fprintf_unfiltered (file,
2185 "gdbarch_dump: SIGTRAMP_END_P() = %d\n",
2186 SIGTRAMP_END_P ());
2187 #endif
2188 #ifdef SIGTRAMP_END
2189 fprintf_unfiltered (file,
2190 "gdbarch_dump: %s # %s\n",
2191 "SIGTRAMP_END(pc)",
2192 XSTRING (SIGTRAMP_END (pc)));
2193 if (GDB_MULTI_ARCH)
2194 fprintf_unfiltered (file,
2195 "gdbarch_dump: SIGTRAMP_END = <0x%08lx>\n",
2196 (long) current_gdbarch->sigtramp_end
2197 /*SIGTRAMP_END ()*/);
2198 #endif
2199 #ifdef SIGTRAMP_START_P
2200 fprintf_unfiltered (file,
2201 "gdbarch_dump: %s # %s\n",
2202 "SIGTRAMP_START_P()",
2203 XSTRING (SIGTRAMP_START_P ()));
2204 fprintf_unfiltered (file,
2205 "gdbarch_dump: SIGTRAMP_START_P() = %d\n",
2206 SIGTRAMP_START_P ());
2207 #endif
2208 #ifdef SIGTRAMP_START
2209 fprintf_unfiltered (file,
2210 "gdbarch_dump: %s # %s\n",
2211 "SIGTRAMP_START(pc)",
2212 XSTRING (SIGTRAMP_START (pc)));
2213 if (GDB_MULTI_ARCH)
2214 fprintf_unfiltered (file,
2215 "gdbarch_dump: SIGTRAMP_START = <0x%08lx>\n",
2216 (long) current_gdbarch->sigtramp_start
2217 /*SIGTRAMP_START ()*/);
2218 #endif
2219 #ifdef SIZEOF_CALL_DUMMY_WORDS
2220 fprintf_unfiltered (file,
2221 "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n",
2222 XSTRING (SIZEOF_CALL_DUMMY_WORDS));
2223 fprintf_unfiltered (file,
2224 "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
2225 (long) SIZEOF_CALL_DUMMY_WORDS);
2226 #endif
2227 #ifdef SKIP_PROLOGUE
2228 fprintf_unfiltered (file,
2229 "gdbarch_dump: %s # %s\n",
2230 "SKIP_PROLOGUE(ip)",
2231 XSTRING (SKIP_PROLOGUE (ip)));
2232 if (GDB_MULTI_ARCH)
2233 fprintf_unfiltered (file,
2234 "gdbarch_dump: SKIP_PROLOGUE = <0x%08lx>\n",
2235 (long) current_gdbarch->skip_prologue
2236 /*SKIP_PROLOGUE ()*/);
2237 #endif
2238 #ifdef SKIP_TRAMPOLINE_CODE
2239 fprintf_unfiltered (file,
2240 "gdbarch_dump: %s # %s\n",
2241 "SKIP_TRAMPOLINE_CODE(pc)",
2242 XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
2243 if (GDB_MULTI_ARCH)
2244 fprintf_unfiltered (file,
2245 "gdbarch_dump: SKIP_TRAMPOLINE_CODE = <0x%08lx>\n",
2246 (long) current_gdbarch->skip_trampoline_code
2247 /*SKIP_TRAMPOLINE_CODE ()*/);
2248 #endif
2249 #ifdef SMASH_TEXT_ADDRESS
2250 fprintf_unfiltered (file,
2251 "gdbarch_dump: %s # %s\n",
2252 "SMASH_TEXT_ADDRESS(addr)",
2253 XSTRING (SMASH_TEXT_ADDRESS (addr)));
2254 if (GDB_MULTI_ARCH)
2255 fprintf_unfiltered (file,
2256 "gdbarch_dump: SMASH_TEXT_ADDRESS = <0x%08lx>\n",
2257 (long) current_gdbarch->smash_text_address
2258 /*SMASH_TEXT_ADDRESS ()*/);
2259 #endif
2260 #ifdef SOFTWARE_SINGLE_STEP_P
2261 fprintf_unfiltered (file,
2262 "gdbarch_dump: %s # %s\n",
2263 "SOFTWARE_SINGLE_STEP_P()",
2264 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
2265 fprintf_unfiltered (file,
2266 "gdbarch_dump: SOFTWARE_SINGLE_STEP_P() = %d\n",
2267 SOFTWARE_SINGLE_STEP_P ());
2268 #endif
2269 #ifdef SOFTWARE_SINGLE_STEP
2270 #if GDB_MULTI_ARCH
2271 /* Macro might contain `[{}]' when not multi-arch */
2272 fprintf_unfiltered (file,
2273 "gdbarch_dump: %s # %s\n",
2274 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
2275 XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
2276 #endif
2277 if (GDB_MULTI_ARCH)
2278 fprintf_unfiltered (file,
2279 "gdbarch_dump: SOFTWARE_SINGLE_STEP = <0x%08lx>\n",
2280 (long) current_gdbarch->software_single_step
2281 /*SOFTWARE_SINGLE_STEP ()*/);
2282 #endif
2283 #ifdef SP_REGNUM
2284 fprintf_unfiltered (file,
2285 "gdbarch_dump: SP_REGNUM # %s\n",
2286 XSTRING (SP_REGNUM));
2287 fprintf_unfiltered (file,
2288 "gdbarch_dump: SP_REGNUM = %d\n",
2289 SP_REGNUM);
2290 #endif
2291 #ifdef STAB_REG_TO_REGNUM
2292 fprintf_unfiltered (file,
2293 "gdbarch_dump: %s # %s\n",
2294 "STAB_REG_TO_REGNUM(stab_regnr)",
2295 XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
2296 if (GDB_MULTI_ARCH)
2297 fprintf_unfiltered (file,
2298 "gdbarch_dump: STAB_REG_TO_REGNUM = <0x%08lx>\n",
2299 (long) current_gdbarch->stab_reg_to_regnum
2300 /*STAB_REG_TO_REGNUM ()*/);
2301 #endif
2302 #ifdef STACK_ALIGN_P
2303 fprintf_unfiltered (file,
2304 "gdbarch_dump: %s # %s\n",
2305 "STACK_ALIGN_P()",
2306 XSTRING (STACK_ALIGN_P ()));
2307 fprintf_unfiltered (file,
2308 "gdbarch_dump: STACK_ALIGN_P() = %d\n",
2309 STACK_ALIGN_P ());
2310 #endif
2311 #ifdef STACK_ALIGN
2312 fprintf_unfiltered (file,
2313 "gdbarch_dump: %s # %s\n",
2314 "STACK_ALIGN(sp)",
2315 XSTRING (STACK_ALIGN (sp)));
2316 if (GDB_MULTI_ARCH)
2317 fprintf_unfiltered (file,
2318 "gdbarch_dump: STACK_ALIGN = <0x%08lx>\n",
2319 (long) current_gdbarch->stack_align
2320 /*STACK_ALIGN ()*/);
2321 #endif
2322 #ifdef STORE_RETURN_VALUE
2323 #if GDB_MULTI_ARCH
2324 /* Macro might contain `[{}]' when not multi-arch */
2325 fprintf_unfiltered (file,
2326 "gdbarch_dump: %s # %s\n",
2327 "STORE_RETURN_VALUE(type, regcache, valbuf)",
2328 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
2329 #endif
2330 if (GDB_MULTI_ARCH)
2331 fprintf_unfiltered (file,
2332 "gdbarch_dump: STORE_RETURN_VALUE = <0x%08lx>\n",
2333 (long) current_gdbarch->store_return_value
2334 /*STORE_RETURN_VALUE ()*/);
2335 #endif
2336 #ifdef STORE_STRUCT_RETURN
2337 #if GDB_MULTI_ARCH
2338 /* Macro might contain `[{}]' when not multi-arch */
2339 fprintf_unfiltered (file,
2340 "gdbarch_dump: %s # %s\n",
2341 "STORE_STRUCT_RETURN(addr, sp)",
2342 XSTRING (STORE_STRUCT_RETURN (addr, sp)));
2343 #endif
2344 if (GDB_MULTI_ARCH)
2345 fprintf_unfiltered (file,
2346 "gdbarch_dump: STORE_STRUCT_RETURN = <0x%08lx>\n",
2347 (long) current_gdbarch->store_struct_return
2348 /*STORE_STRUCT_RETURN ()*/);
2349 #endif
2350 #ifdef TARGET_ADDR_BIT
2351 fprintf_unfiltered (file,
2352 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
2353 XSTRING (TARGET_ADDR_BIT));
2354 fprintf_unfiltered (file,
2355 "gdbarch_dump: TARGET_ADDR_BIT = %d\n",
2356 TARGET_ADDR_BIT);
2357 #endif
2358 #ifdef TARGET_ARCHITECTURE
2359 fprintf_unfiltered (file,
2360 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
2361 XSTRING (TARGET_ARCHITECTURE));
2362 if (TARGET_ARCHITECTURE != NULL)
2363 fprintf_unfiltered (file,
2364 "gdbarch_dump: TARGET_ARCHITECTURE = %s\n",
2365 TARGET_ARCHITECTURE->printable_name);
2366 #endif
2367 #ifdef TARGET_BFD_VMA_BIT
2368 fprintf_unfiltered (file,
2369 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
2370 XSTRING (TARGET_BFD_VMA_BIT));
2371 fprintf_unfiltered (file,
2372 "gdbarch_dump: TARGET_BFD_VMA_BIT = %d\n",
2373 TARGET_BFD_VMA_BIT);
2374 #endif
2375 #ifdef TARGET_BYTE_ORDER
2376 fprintf_unfiltered (file,
2377 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
2378 XSTRING (TARGET_BYTE_ORDER));
2379 fprintf_unfiltered (file,
2380 "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
2381 (long) TARGET_BYTE_ORDER);
2382 #endif
2383 #ifdef TARGET_CHAR_SIGNED
2384 fprintf_unfiltered (file,
2385 "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
2386 XSTRING (TARGET_CHAR_SIGNED));
2387 fprintf_unfiltered (file,
2388 "gdbarch_dump: TARGET_CHAR_SIGNED = %d\n",
2389 TARGET_CHAR_SIGNED);
2390 #endif
2391 #ifdef TARGET_DOUBLE_BIT
2392 fprintf_unfiltered (file,
2393 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
2394 XSTRING (TARGET_DOUBLE_BIT));
2395 fprintf_unfiltered (file,
2396 "gdbarch_dump: TARGET_DOUBLE_BIT = %d\n",
2397 TARGET_DOUBLE_BIT);
2398 #endif
2399 #ifdef TARGET_DOUBLE_FORMAT
2400 fprintf_unfiltered (file,
2401 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
2402 XSTRING (TARGET_DOUBLE_FORMAT));
2403 fprintf_unfiltered (file,
2404 "gdbarch_dump: TARGET_DOUBLE_FORMAT = %s\n",
2405 (TARGET_DOUBLE_FORMAT)->name);
2406 #endif
2407 #ifdef TARGET_FLOAT_BIT
2408 fprintf_unfiltered (file,
2409 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
2410 XSTRING (TARGET_FLOAT_BIT));
2411 fprintf_unfiltered (file,
2412 "gdbarch_dump: TARGET_FLOAT_BIT = %d\n",
2413 TARGET_FLOAT_BIT);
2414 #endif
2415 #ifdef TARGET_FLOAT_FORMAT
2416 fprintf_unfiltered (file,
2417 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
2418 XSTRING (TARGET_FLOAT_FORMAT));
2419 fprintf_unfiltered (file,
2420 "gdbarch_dump: TARGET_FLOAT_FORMAT = %s\n",
2421 (TARGET_FLOAT_FORMAT)->name);
2422 #endif
2423 #ifdef TARGET_INT_BIT
2424 fprintf_unfiltered (file,
2425 "gdbarch_dump: TARGET_INT_BIT # %s\n",
2426 XSTRING (TARGET_INT_BIT));
2427 fprintf_unfiltered (file,
2428 "gdbarch_dump: TARGET_INT_BIT = %d\n",
2429 TARGET_INT_BIT);
2430 #endif
2431 #ifdef TARGET_LONG_BIT
2432 fprintf_unfiltered (file,
2433 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
2434 XSTRING (TARGET_LONG_BIT));
2435 fprintf_unfiltered (file,
2436 "gdbarch_dump: TARGET_LONG_BIT = %d\n",
2437 TARGET_LONG_BIT);
2438 #endif
2439 #ifdef TARGET_LONG_DOUBLE_BIT
2440 fprintf_unfiltered (file,
2441 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
2442 XSTRING (TARGET_LONG_DOUBLE_BIT));
2443 fprintf_unfiltered (file,
2444 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %d\n",
2445 TARGET_LONG_DOUBLE_BIT);
2446 #endif
2447 #ifdef TARGET_LONG_DOUBLE_FORMAT
2448 fprintf_unfiltered (file,
2449 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
2450 XSTRING (TARGET_LONG_DOUBLE_FORMAT));
2451 fprintf_unfiltered (file,
2452 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %s\n",
2453 (TARGET_LONG_DOUBLE_FORMAT)->name);
2454 #endif
2455 #ifdef TARGET_LONG_LONG_BIT
2456 fprintf_unfiltered (file,
2457 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
2458 XSTRING (TARGET_LONG_LONG_BIT));
2459 fprintf_unfiltered (file,
2460 "gdbarch_dump: TARGET_LONG_LONG_BIT = %d\n",
2461 TARGET_LONG_LONG_BIT);
2462 #endif
2463 #ifdef TARGET_OSABI
2464 fprintf_unfiltered (file,
2465 "gdbarch_dump: TARGET_OSABI # %s\n",
2466 XSTRING (TARGET_OSABI));
2467 fprintf_unfiltered (file,
2468 "gdbarch_dump: TARGET_OSABI = %ld\n",
2469 (long) TARGET_OSABI);
2470 #endif
2471 #ifdef TARGET_PRINT_INSN
2472 fprintf_unfiltered (file,
2473 "gdbarch_dump: %s # %s\n",
2474 "TARGET_PRINT_INSN(vma, info)",
2475 XSTRING (TARGET_PRINT_INSN (vma, info)));
2476 if (GDB_MULTI_ARCH)
2477 fprintf_unfiltered (file,
2478 "gdbarch_dump: TARGET_PRINT_INSN = <0x%08lx>\n",
2479 (long) current_gdbarch->print_insn
2480 /*TARGET_PRINT_INSN ()*/);
2481 #endif
2482 #ifdef TARGET_PTR_BIT
2483 fprintf_unfiltered (file,
2484 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
2485 XSTRING (TARGET_PTR_BIT));
2486 fprintf_unfiltered (file,
2487 "gdbarch_dump: TARGET_PTR_BIT = %d\n",
2488 TARGET_PTR_BIT);
2489 #endif
2490 #ifdef TARGET_READ_FP
2491 fprintf_unfiltered (file,
2492 "gdbarch_dump: %s # %s\n",
2493 "TARGET_READ_FP()",
2494 XSTRING (TARGET_READ_FP ()));
2495 if (GDB_MULTI_ARCH)
2496 fprintf_unfiltered (file,
2497 "gdbarch_dump: TARGET_READ_FP = <0x%08lx>\n",
2498 (long) current_gdbarch->read_fp
2499 /*TARGET_READ_FP ()*/);
2500 #endif
2501 #ifdef TARGET_READ_PC
2502 fprintf_unfiltered (file,
2503 "gdbarch_dump: %s # %s\n",
2504 "TARGET_READ_PC(ptid)",
2505 XSTRING (TARGET_READ_PC (ptid)));
2506 if (GDB_MULTI_ARCH)
2507 fprintf_unfiltered (file,
2508 "gdbarch_dump: TARGET_READ_PC = <0x%08lx>\n",
2509 (long) current_gdbarch->read_pc
2510 /*TARGET_READ_PC ()*/);
2511 #endif
2512 #ifdef TARGET_READ_SP
2513 fprintf_unfiltered (file,
2514 "gdbarch_dump: %s # %s\n",
2515 "TARGET_READ_SP()",
2516 XSTRING (TARGET_READ_SP ()));
2517 if (GDB_MULTI_ARCH)
2518 fprintf_unfiltered (file,
2519 "gdbarch_dump: TARGET_READ_SP = <0x%08lx>\n",
2520 (long) current_gdbarch->read_sp
2521 /*TARGET_READ_SP ()*/);
2522 #endif
2523 #ifdef TARGET_SHORT_BIT
2524 fprintf_unfiltered (file,
2525 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
2526 XSTRING (TARGET_SHORT_BIT));
2527 fprintf_unfiltered (file,
2528 "gdbarch_dump: TARGET_SHORT_BIT = %d\n",
2529 TARGET_SHORT_BIT);
2530 #endif
2531 #ifdef TARGET_VIRTUAL_FRAME_POINTER
2532 #if GDB_MULTI_ARCH
2533 /* Macro might contain `[{}]' when not multi-arch */
2534 fprintf_unfiltered (file,
2535 "gdbarch_dump: %s # %s\n",
2536 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
2537 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
2538 #endif
2539 if (GDB_MULTI_ARCH)
2540 fprintf_unfiltered (file,
2541 "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = <0x%08lx>\n",
2542 (long) current_gdbarch->virtual_frame_pointer
2543 /*TARGET_VIRTUAL_FRAME_POINTER ()*/);
2544 #endif
2545 #ifdef TARGET_WRITE_PC
2546 #if GDB_MULTI_ARCH
2547 /* Macro might contain `[{}]' when not multi-arch */
2548 fprintf_unfiltered (file,
2549 "gdbarch_dump: %s # %s\n",
2550 "TARGET_WRITE_PC(val, ptid)",
2551 XSTRING (TARGET_WRITE_PC (val, ptid)));
2552 #endif
2553 if (GDB_MULTI_ARCH)
2554 fprintf_unfiltered (file,
2555 "gdbarch_dump: TARGET_WRITE_PC = <0x%08lx>\n",
2556 (long) current_gdbarch->write_pc
2557 /*TARGET_WRITE_PC ()*/);
2558 #endif
2559 #ifdef TARGET_WRITE_SP
2560 #if GDB_MULTI_ARCH
2561 /* Macro might contain `[{}]' when not multi-arch */
2562 fprintf_unfiltered (file,
2563 "gdbarch_dump: %s # %s\n",
2564 "TARGET_WRITE_SP(val)",
2565 XSTRING (TARGET_WRITE_SP (val)));
2566 #endif
2567 if (GDB_MULTI_ARCH)
2568 fprintf_unfiltered (file,
2569 "gdbarch_dump: TARGET_WRITE_SP = <0x%08lx>\n",
2570 (long) current_gdbarch->write_sp
2571 /*TARGET_WRITE_SP ()*/);
2572 #endif
2573 if (GDB_MULTI_ARCH)
2574 fprintf_unfiltered (file,
2575 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
2576 gdbarch_unwind_dummy_id_p (current_gdbarch));
2577 if (GDB_MULTI_ARCH)
2578 fprintf_unfiltered (file,
2579 "gdbarch_dump: unwind_dummy_id = 0x%08lx\n",
2580 (long) current_gdbarch->unwind_dummy_id);
2581 #ifdef USE_STRUCT_CONVENTION
2582 fprintf_unfiltered (file,
2583 "gdbarch_dump: %s # %s\n",
2584 "USE_STRUCT_CONVENTION(gcc_p, value_type)",
2585 XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type)));
2586 if (GDB_MULTI_ARCH)
2587 fprintf_unfiltered (file,
2588 "gdbarch_dump: USE_STRUCT_CONVENTION = <0x%08lx>\n",
2589 (long) current_gdbarch->use_struct_convention
2590 /*USE_STRUCT_CONVENTION ()*/);
2591 #endif
2592 #ifdef VALUE_TO_REGISTER
2593 #if GDB_MULTI_ARCH
2594 /* Macro might contain `[{}]' when not multi-arch */
2595 fprintf_unfiltered (file,
2596 "gdbarch_dump: %s # %s\n",
2597 "VALUE_TO_REGISTER(type, regnum, from, to)",
2598 XSTRING (VALUE_TO_REGISTER (type, regnum, from, to)));
2599 #endif
2600 if (GDB_MULTI_ARCH)
2601 fprintf_unfiltered (file,
2602 "gdbarch_dump: VALUE_TO_REGISTER = <0x%08lx>\n",
2603 (long) current_gdbarch->value_to_register
2604 /*VALUE_TO_REGISTER ()*/);
2605 #endif
2606 if (current_gdbarch->dump_tdep != NULL)
2607 current_gdbarch->dump_tdep (current_gdbarch, file);
2608 }
2609
2610 struct gdbarch_tdep *
2611 gdbarch_tdep (struct gdbarch *gdbarch)
2612 {
2613 if (gdbarch_debug >= 2)
2614 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
2615 return gdbarch->tdep;
2616 }
2617
2618
2619 const struct bfd_arch_info *
2620 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
2621 {
2622 gdb_assert (gdbarch != NULL);
2623 if (gdbarch_debug >= 2)
2624 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
2625 return gdbarch->bfd_arch_info;
2626 }
2627
2628 int
2629 gdbarch_byte_order (struct gdbarch *gdbarch)
2630 {
2631 gdb_assert (gdbarch != NULL);
2632 if (gdbarch_debug >= 2)
2633 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
2634 return gdbarch->byte_order;
2635 }
2636
2637 enum gdb_osabi
2638 gdbarch_osabi (struct gdbarch *gdbarch)
2639 {
2640 gdb_assert (gdbarch != NULL);
2641 if (gdbarch_debug >= 2)
2642 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
2643 return gdbarch->osabi;
2644 }
2645
2646 int
2647 gdbarch_short_bit (struct gdbarch *gdbarch)
2648 {
2649 gdb_assert (gdbarch != NULL);
2650 /* Skip verify of short_bit, invalid_p == 0 */
2651 if (gdbarch_debug >= 2)
2652 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
2653 return gdbarch->short_bit;
2654 }
2655
2656 void
2657 set_gdbarch_short_bit (struct gdbarch *gdbarch,
2658 int short_bit)
2659 {
2660 gdbarch->short_bit = short_bit;
2661 }
2662
2663 int
2664 gdbarch_int_bit (struct gdbarch *gdbarch)
2665 {
2666 gdb_assert (gdbarch != NULL);
2667 /* Skip verify of int_bit, invalid_p == 0 */
2668 if (gdbarch_debug >= 2)
2669 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
2670 return gdbarch->int_bit;
2671 }
2672
2673 void
2674 set_gdbarch_int_bit (struct gdbarch *gdbarch,
2675 int int_bit)
2676 {
2677 gdbarch->int_bit = int_bit;
2678 }
2679
2680 int
2681 gdbarch_long_bit (struct gdbarch *gdbarch)
2682 {
2683 gdb_assert (gdbarch != NULL);
2684 /* Skip verify of long_bit, invalid_p == 0 */
2685 if (gdbarch_debug >= 2)
2686 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
2687 return gdbarch->long_bit;
2688 }
2689
2690 void
2691 set_gdbarch_long_bit (struct gdbarch *gdbarch,
2692 int long_bit)
2693 {
2694 gdbarch->long_bit = long_bit;
2695 }
2696
2697 int
2698 gdbarch_long_long_bit (struct gdbarch *gdbarch)
2699 {
2700 gdb_assert (gdbarch != NULL);
2701 /* Skip verify of long_long_bit, invalid_p == 0 */
2702 if (gdbarch_debug >= 2)
2703 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
2704 return gdbarch->long_long_bit;
2705 }
2706
2707 void
2708 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
2709 int long_long_bit)
2710 {
2711 gdbarch->long_long_bit = long_long_bit;
2712 }
2713
2714 int
2715 gdbarch_float_bit (struct gdbarch *gdbarch)
2716 {
2717 gdb_assert (gdbarch != NULL);
2718 /* Skip verify of float_bit, invalid_p == 0 */
2719 if (gdbarch_debug >= 2)
2720 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
2721 return gdbarch->float_bit;
2722 }
2723
2724 void
2725 set_gdbarch_float_bit (struct gdbarch *gdbarch,
2726 int float_bit)
2727 {
2728 gdbarch->float_bit = float_bit;
2729 }
2730
2731 int
2732 gdbarch_double_bit (struct gdbarch *gdbarch)
2733 {
2734 gdb_assert (gdbarch != NULL);
2735 /* Skip verify of double_bit, invalid_p == 0 */
2736 if (gdbarch_debug >= 2)
2737 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
2738 return gdbarch->double_bit;
2739 }
2740
2741 void
2742 set_gdbarch_double_bit (struct gdbarch *gdbarch,
2743 int double_bit)
2744 {
2745 gdbarch->double_bit = double_bit;
2746 }
2747
2748 int
2749 gdbarch_long_double_bit (struct gdbarch *gdbarch)
2750 {
2751 gdb_assert (gdbarch != NULL);
2752 /* Skip verify of long_double_bit, invalid_p == 0 */
2753 if (gdbarch_debug >= 2)
2754 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
2755 return gdbarch->long_double_bit;
2756 }
2757
2758 void
2759 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
2760 int long_double_bit)
2761 {
2762 gdbarch->long_double_bit = long_double_bit;
2763 }
2764
2765 int
2766 gdbarch_ptr_bit (struct gdbarch *gdbarch)
2767 {
2768 gdb_assert (gdbarch != NULL);
2769 /* Skip verify of ptr_bit, invalid_p == 0 */
2770 if (gdbarch_debug >= 2)
2771 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
2772 return gdbarch->ptr_bit;
2773 }
2774
2775 void
2776 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
2777 int ptr_bit)
2778 {
2779 gdbarch->ptr_bit = ptr_bit;
2780 }
2781
2782 int
2783 gdbarch_addr_bit (struct gdbarch *gdbarch)
2784 {
2785 gdb_assert (gdbarch != NULL);
2786 if (gdbarch->addr_bit == 0)
2787 internal_error (__FILE__, __LINE__,
2788 "gdbarch: gdbarch_addr_bit invalid");
2789 if (gdbarch_debug >= 2)
2790 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
2791 return gdbarch->addr_bit;
2792 }
2793
2794 void
2795 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
2796 int addr_bit)
2797 {
2798 gdbarch->addr_bit = addr_bit;
2799 }
2800
2801 int
2802 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
2803 {
2804 gdb_assert (gdbarch != NULL);
2805 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
2806 if (gdbarch_debug >= 2)
2807 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
2808 return gdbarch->bfd_vma_bit;
2809 }
2810
2811 void
2812 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
2813 int bfd_vma_bit)
2814 {
2815 gdbarch->bfd_vma_bit = bfd_vma_bit;
2816 }
2817
2818 int
2819 gdbarch_char_signed (struct gdbarch *gdbarch)
2820 {
2821 gdb_assert (gdbarch != NULL);
2822 if (gdbarch->char_signed == -1)
2823 internal_error (__FILE__, __LINE__,
2824 "gdbarch: gdbarch_char_signed invalid");
2825 if (gdbarch_debug >= 2)
2826 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
2827 return gdbarch->char_signed;
2828 }
2829
2830 void
2831 set_gdbarch_char_signed (struct gdbarch *gdbarch,
2832 int char_signed)
2833 {
2834 gdbarch->char_signed = char_signed;
2835 }
2836
2837 CORE_ADDR
2838 gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
2839 {
2840 gdb_assert (gdbarch != NULL);
2841 if (gdbarch->read_pc == 0)
2842 internal_error (__FILE__, __LINE__,
2843 "gdbarch: gdbarch_read_pc invalid");
2844 if (gdbarch_debug >= 2)
2845 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
2846 return gdbarch->read_pc (ptid);
2847 }
2848
2849 void
2850 set_gdbarch_read_pc (struct gdbarch *gdbarch,
2851 gdbarch_read_pc_ftype read_pc)
2852 {
2853 gdbarch->read_pc = read_pc;
2854 }
2855
2856 void
2857 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
2858 {
2859 gdb_assert (gdbarch != NULL);
2860 if (gdbarch->write_pc == 0)
2861 internal_error (__FILE__, __LINE__,
2862 "gdbarch: gdbarch_write_pc invalid");
2863 if (gdbarch_debug >= 2)
2864 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
2865 gdbarch->write_pc (val, ptid);
2866 }
2867
2868 void
2869 set_gdbarch_write_pc (struct gdbarch *gdbarch,
2870 gdbarch_write_pc_ftype write_pc)
2871 {
2872 gdbarch->write_pc = write_pc;
2873 }
2874
2875 CORE_ADDR
2876 gdbarch_read_fp (struct gdbarch *gdbarch)
2877 {
2878 gdb_assert (gdbarch != NULL);
2879 if (gdbarch->read_fp == 0)
2880 internal_error (__FILE__, __LINE__,
2881 "gdbarch: gdbarch_read_fp invalid");
2882 if (gdbarch_debug >= 2)
2883 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n");
2884 return gdbarch->read_fp ();
2885 }
2886
2887 void
2888 set_gdbarch_read_fp (struct gdbarch *gdbarch,
2889 gdbarch_read_fp_ftype read_fp)
2890 {
2891 gdbarch->read_fp = read_fp;
2892 }
2893
2894 CORE_ADDR
2895 gdbarch_read_sp (struct gdbarch *gdbarch)
2896 {
2897 gdb_assert (gdbarch != NULL);
2898 if (gdbarch->read_sp == 0)
2899 internal_error (__FILE__, __LINE__,
2900 "gdbarch: gdbarch_read_sp invalid");
2901 if (gdbarch_debug >= 2)
2902 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
2903 return gdbarch->read_sp ();
2904 }
2905
2906 void
2907 set_gdbarch_read_sp (struct gdbarch *gdbarch,
2908 gdbarch_read_sp_ftype read_sp)
2909 {
2910 gdbarch->read_sp = read_sp;
2911 }
2912
2913 void
2914 gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
2915 {
2916 gdb_assert (gdbarch != NULL);
2917 if (gdbarch->write_sp == 0)
2918 internal_error (__FILE__, __LINE__,
2919 "gdbarch: gdbarch_write_sp invalid");
2920 if (gdbarch_debug >= 2)
2921 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n");
2922 gdbarch->write_sp (val);
2923 }
2924
2925 void
2926 set_gdbarch_write_sp (struct gdbarch *gdbarch,
2927 gdbarch_write_sp_ftype write_sp)
2928 {
2929 gdbarch->write_sp = write_sp;
2930 }
2931
2932 void
2933 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
2934 {
2935 gdb_assert (gdbarch != NULL);
2936 if (gdbarch->virtual_frame_pointer == 0)
2937 internal_error (__FILE__, __LINE__,
2938 "gdbarch: gdbarch_virtual_frame_pointer invalid");
2939 if (gdbarch_debug >= 2)
2940 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
2941 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
2942 }
2943
2944 void
2945 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
2946 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
2947 {
2948 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
2949 }
2950
2951 int
2952 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
2953 {
2954 gdb_assert (gdbarch != NULL);
2955 return gdbarch->pseudo_register_read != 0;
2956 }
2957
2958 void
2959 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf)
2960 {
2961 gdb_assert (gdbarch != NULL);
2962 if (gdbarch->pseudo_register_read == 0)
2963 internal_error (__FILE__, __LINE__,
2964 "gdbarch: gdbarch_pseudo_register_read invalid");
2965 if (gdbarch_debug >= 2)
2966 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
2967 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
2968 }
2969
2970 void
2971 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
2972 gdbarch_pseudo_register_read_ftype pseudo_register_read)
2973 {
2974 gdbarch->pseudo_register_read = pseudo_register_read;
2975 }
2976
2977 int
2978 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
2979 {
2980 gdb_assert (gdbarch != NULL);
2981 return gdbarch->pseudo_register_write != 0;
2982 }
2983
2984 void
2985 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf)
2986 {
2987 gdb_assert (gdbarch != NULL);
2988 if (gdbarch->pseudo_register_write == 0)
2989 internal_error (__FILE__, __LINE__,
2990 "gdbarch: gdbarch_pseudo_register_write invalid");
2991 if (gdbarch_debug >= 2)
2992 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
2993 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
2994 }
2995
2996 void
2997 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
2998 gdbarch_pseudo_register_write_ftype pseudo_register_write)
2999 {
3000 gdbarch->pseudo_register_write = pseudo_register_write;
3001 }
3002
3003 int
3004 gdbarch_num_regs (struct gdbarch *gdbarch)
3005 {
3006 gdb_assert (gdbarch != NULL);
3007 if (gdbarch->num_regs == -1)
3008 internal_error (__FILE__, __LINE__,
3009 "gdbarch: gdbarch_num_regs invalid");
3010 if (gdbarch_debug >= 2)
3011 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
3012 return gdbarch->num_regs;
3013 }
3014
3015 void
3016 set_gdbarch_num_regs (struct gdbarch *gdbarch,
3017 int num_regs)
3018 {
3019 gdbarch->num_regs = num_regs;
3020 }
3021
3022 int
3023 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
3024 {
3025 gdb_assert (gdbarch != NULL);
3026 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
3027 if (gdbarch_debug >= 2)
3028 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
3029 return gdbarch->num_pseudo_regs;
3030 }
3031
3032 void
3033 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
3034 int num_pseudo_regs)
3035 {
3036 gdbarch->num_pseudo_regs = num_pseudo_regs;
3037 }
3038
3039 int
3040 gdbarch_sp_regnum (struct gdbarch *gdbarch)
3041 {
3042 gdb_assert (gdbarch != NULL);
3043 /* Skip verify of sp_regnum, invalid_p == 0 */
3044 if (gdbarch_debug >= 2)
3045 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
3046 return gdbarch->sp_regnum;
3047 }
3048
3049 void
3050 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
3051 int sp_regnum)
3052 {
3053 gdbarch->sp_regnum = sp_regnum;
3054 }
3055
3056 int
3057 gdbarch_fp_regnum (struct gdbarch *gdbarch)
3058 {
3059 gdb_assert (gdbarch != NULL);
3060 /* Skip verify of fp_regnum, invalid_p == 0 */
3061 if (gdbarch_debug >= 2)
3062 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
3063 return gdbarch->fp_regnum;
3064 }
3065
3066 void
3067 set_gdbarch_fp_regnum (struct gdbarch *gdbarch,
3068 int fp_regnum)
3069 {
3070 gdbarch->fp_regnum = fp_regnum;
3071 }
3072
3073 int
3074 gdbarch_pc_regnum (struct gdbarch *gdbarch)
3075 {
3076 gdb_assert (gdbarch != NULL);
3077 /* Skip verify of pc_regnum, invalid_p == 0 */
3078 if (gdbarch_debug >= 2)
3079 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
3080 return gdbarch->pc_regnum;
3081 }
3082
3083 void
3084 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
3085 int pc_regnum)
3086 {
3087 gdbarch->pc_regnum = pc_regnum;
3088 }
3089
3090 int
3091 gdbarch_ps_regnum (struct gdbarch *gdbarch)
3092 {
3093 gdb_assert (gdbarch != NULL);
3094 /* Skip verify of ps_regnum, invalid_p == 0 */
3095 if (gdbarch_debug >= 2)
3096 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
3097 return gdbarch->ps_regnum;
3098 }
3099
3100 void
3101 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
3102 int ps_regnum)
3103 {
3104 gdbarch->ps_regnum = ps_regnum;
3105 }
3106
3107 int
3108 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
3109 {
3110 gdb_assert (gdbarch != NULL);
3111 /* Skip verify of fp0_regnum, invalid_p == 0 */
3112 if (gdbarch_debug >= 2)
3113 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
3114 return gdbarch->fp0_regnum;
3115 }
3116
3117 void
3118 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
3119 int fp0_regnum)
3120 {
3121 gdbarch->fp0_regnum = fp0_regnum;
3122 }
3123
3124 int
3125 gdbarch_npc_regnum (struct gdbarch *gdbarch)
3126 {
3127 gdb_assert (gdbarch != NULL);
3128 /* Skip verify of npc_regnum, invalid_p == 0 */
3129 if (gdbarch_debug >= 2)
3130 fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
3131 return gdbarch->npc_regnum;
3132 }
3133
3134 void
3135 set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
3136 int npc_regnum)
3137 {
3138 gdbarch->npc_regnum = npc_regnum;
3139 }
3140
3141 int
3142 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
3143 {
3144 gdb_assert (gdbarch != NULL);
3145 if (gdbarch->stab_reg_to_regnum == 0)
3146 internal_error (__FILE__, __LINE__,
3147 "gdbarch: gdbarch_stab_reg_to_regnum invalid");
3148 if (gdbarch_debug >= 2)
3149 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
3150 return gdbarch->stab_reg_to_regnum (stab_regnr);
3151 }
3152
3153 void
3154 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
3155 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
3156 {
3157 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
3158 }
3159
3160 int
3161 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
3162 {
3163 gdb_assert (gdbarch != NULL);
3164 if (gdbarch->ecoff_reg_to_regnum == 0)
3165 internal_error (__FILE__, __LINE__,
3166 "gdbarch: gdbarch_ecoff_reg_to_regnum invalid");
3167 if (gdbarch_debug >= 2)
3168 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
3169 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
3170 }
3171
3172 void
3173 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
3174 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
3175 {
3176 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
3177 }
3178
3179 int
3180 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
3181 {
3182 gdb_assert (gdbarch != NULL);
3183 if (gdbarch->dwarf_reg_to_regnum == 0)
3184 internal_error (__FILE__, __LINE__,
3185 "gdbarch: gdbarch_dwarf_reg_to_regnum invalid");
3186 if (gdbarch_debug >= 2)
3187 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
3188 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
3189 }
3190
3191 void
3192 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
3193 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
3194 {
3195 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
3196 }
3197
3198 int
3199 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
3200 {
3201 gdb_assert (gdbarch != NULL);
3202 if (gdbarch->sdb_reg_to_regnum == 0)
3203 internal_error (__FILE__, __LINE__,
3204 "gdbarch: gdbarch_sdb_reg_to_regnum invalid");
3205 if (gdbarch_debug >= 2)
3206 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
3207 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
3208 }
3209
3210 void
3211 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
3212 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
3213 {
3214 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
3215 }
3216
3217 int
3218 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
3219 {
3220 gdb_assert (gdbarch != NULL);
3221 if (gdbarch->dwarf2_reg_to_regnum == 0)
3222 internal_error (__FILE__, __LINE__,
3223 "gdbarch: gdbarch_dwarf2_reg_to_regnum invalid");
3224 if (gdbarch_debug >= 2)
3225 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
3226 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
3227 }
3228
3229 void
3230 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
3231 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
3232 {
3233 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
3234 }
3235
3236 const char *
3237 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
3238 {
3239 gdb_assert (gdbarch != NULL);
3240 if (gdbarch->register_name == 0)
3241 internal_error (__FILE__, __LINE__,
3242 "gdbarch: gdbarch_register_name invalid");
3243 if (gdbarch_debug >= 2)
3244 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
3245 return gdbarch->register_name (regnr);
3246 }
3247
3248 void
3249 set_gdbarch_register_name (struct gdbarch *gdbarch,
3250 gdbarch_register_name_ftype register_name)
3251 {
3252 gdbarch->register_name = register_name;
3253 }
3254
3255 int
3256 gdbarch_register_size (struct gdbarch *gdbarch)
3257 {
3258 gdb_assert (gdbarch != NULL);
3259 if (gdbarch->register_size == -1)
3260 internal_error (__FILE__, __LINE__,
3261 "gdbarch: gdbarch_register_size invalid");
3262 if (gdbarch_debug >= 2)
3263 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n");
3264 return gdbarch->register_size;
3265 }
3266
3267 void
3268 set_gdbarch_register_size (struct gdbarch *gdbarch,
3269 int register_size)
3270 {
3271 gdbarch->register_size = register_size;
3272 }
3273
3274 int
3275 gdbarch_register_bytes (struct gdbarch *gdbarch)
3276 {
3277 gdb_assert (gdbarch != NULL);
3278 if (gdbarch->register_bytes == -1)
3279 internal_error (__FILE__, __LINE__,
3280 "gdbarch: gdbarch_register_bytes invalid");
3281 if (gdbarch_debug >= 2)
3282 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n");
3283 return gdbarch->register_bytes;
3284 }
3285
3286 void
3287 set_gdbarch_register_bytes (struct gdbarch *gdbarch,
3288 int register_bytes)
3289 {
3290 gdbarch->register_bytes = register_bytes;
3291 }
3292
3293 int
3294 gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
3295 {
3296 gdb_assert (gdbarch != NULL);
3297 if (gdbarch->register_byte == 0)
3298 internal_error (__FILE__, __LINE__,
3299 "gdbarch: gdbarch_register_byte invalid");
3300 if (gdbarch_debug >= 2)
3301 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n");
3302 return gdbarch->register_byte (reg_nr);
3303 }
3304
3305 void
3306 set_gdbarch_register_byte (struct gdbarch *gdbarch,
3307 gdbarch_register_byte_ftype register_byte)
3308 {
3309 gdbarch->register_byte = register_byte;
3310 }
3311
3312 int
3313 gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
3314 {
3315 gdb_assert (gdbarch != NULL);
3316 if (gdbarch->register_raw_size == 0)
3317 internal_error (__FILE__, __LINE__,
3318 "gdbarch: gdbarch_register_raw_size invalid");
3319 if (gdbarch_debug >= 2)
3320 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n");
3321 return gdbarch->register_raw_size (reg_nr);
3322 }
3323
3324 void
3325 set_gdbarch_register_raw_size (struct gdbarch *gdbarch,
3326 gdbarch_register_raw_size_ftype register_raw_size)
3327 {
3328 gdbarch->register_raw_size = register_raw_size;
3329 }
3330
3331 int
3332 gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch)
3333 {
3334 gdb_assert (gdbarch != NULL);
3335 return gdbarch->deprecated_max_register_raw_size != 0;
3336 }
3337
3338 int
3339 gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch)
3340 {
3341 gdb_assert (gdbarch != NULL);
3342 if (gdbarch_debug >= 2)
3343 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_max_register_raw_size called\n");
3344 return gdbarch->deprecated_max_register_raw_size;
3345 }
3346
3347 void
3348 set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch,
3349 int deprecated_max_register_raw_size)
3350 {
3351 gdbarch->deprecated_max_register_raw_size = deprecated_max_register_raw_size;
3352 }
3353
3354 int
3355 gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
3356 {
3357 gdb_assert (gdbarch != NULL);
3358 if (gdbarch->register_virtual_size == 0)
3359 internal_error (__FILE__, __LINE__,
3360 "gdbarch: gdbarch_register_virtual_size invalid");
3361 if (gdbarch_debug >= 2)
3362 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n");
3363 return gdbarch->register_virtual_size (reg_nr);
3364 }
3365
3366 void
3367 set_gdbarch_register_virtual_size (struct gdbarch *gdbarch,
3368 gdbarch_register_virtual_size_ftype register_virtual_size)
3369 {
3370 gdbarch->register_virtual_size = register_virtual_size;
3371 }
3372
3373 int
3374 gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch)
3375 {
3376 gdb_assert (gdbarch != NULL);
3377 return gdbarch->deprecated_max_register_virtual_size != 0;
3378 }
3379
3380 int
3381 gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch)
3382 {
3383 gdb_assert (gdbarch != NULL);
3384 if (gdbarch_debug >= 2)
3385 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_max_register_virtual_size called\n");
3386 return gdbarch->deprecated_max_register_virtual_size;
3387 }
3388
3389 void
3390 set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch,
3391 int deprecated_max_register_virtual_size)
3392 {
3393 gdbarch->deprecated_max_register_virtual_size = deprecated_max_register_virtual_size;
3394 }
3395
3396 int
3397 gdbarch_register_virtual_type_p (struct gdbarch *gdbarch)
3398 {
3399 gdb_assert (gdbarch != NULL);
3400 return gdbarch->register_virtual_type != 0;
3401 }
3402
3403 struct type *
3404 gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
3405 {
3406 gdb_assert (gdbarch != NULL);
3407 if (gdbarch->register_virtual_type == 0)
3408 internal_error (__FILE__, __LINE__,
3409 "gdbarch: gdbarch_register_virtual_type invalid");
3410 if (gdbarch_debug >= 2)
3411 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n");
3412 return gdbarch->register_virtual_type (reg_nr);
3413 }
3414
3415 void
3416 set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
3417 gdbarch_register_virtual_type_ftype register_virtual_type)
3418 {
3419 gdbarch->register_virtual_type = register_virtual_type;
3420 }
3421
3422 int
3423 gdbarch_register_type_p (struct gdbarch *gdbarch)
3424 {
3425 gdb_assert (gdbarch != NULL);
3426 return gdbarch->register_type != 0;
3427 }
3428
3429 struct type *
3430 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
3431 {
3432 gdb_assert (gdbarch != NULL);
3433 if (gdbarch->register_type == 0)
3434 internal_error (__FILE__, __LINE__,
3435 "gdbarch: gdbarch_register_type invalid");
3436 if (gdbarch_debug >= 2)
3437 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
3438 return gdbarch->register_type (gdbarch, reg_nr);
3439 }
3440
3441 void
3442 set_gdbarch_register_type (struct gdbarch *gdbarch,
3443 gdbarch_register_type_ftype register_type)
3444 {
3445 gdbarch->register_type = register_type;
3446 }
3447
3448 int
3449 gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch)
3450 {
3451 gdb_assert (gdbarch != NULL);
3452 return gdbarch->deprecated_do_registers_info != 0;
3453 }
3454
3455 void
3456 gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
3457 {
3458 gdb_assert (gdbarch != NULL);
3459 if (gdbarch->deprecated_do_registers_info == 0)
3460 internal_error (__FILE__, __LINE__,
3461 "gdbarch: gdbarch_deprecated_do_registers_info invalid");
3462 if (gdbarch_debug >= 2)
3463 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_do_registers_info called\n");
3464 gdbarch->deprecated_do_registers_info (reg_nr, fpregs);
3465 }
3466
3467 void
3468 set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch,
3469 gdbarch_deprecated_do_registers_info_ftype deprecated_do_registers_info)
3470 {
3471 gdbarch->deprecated_do_registers_info = deprecated_do_registers_info;
3472 }
3473
3474 void
3475 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
3476 {
3477 gdb_assert (gdbarch != NULL);
3478 if (gdbarch->print_registers_info == 0)
3479 internal_error (__FILE__, __LINE__,
3480 "gdbarch: gdbarch_print_registers_info invalid");
3481 if (gdbarch_debug >= 2)
3482 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
3483 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
3484 }
3485
3486 void
3487 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
3488 gdbarch_print_registers_info_ftype print_registers_info)
3489 {
3490 gdbarch->print_registers_info = print_registers_info;
3491 }
3492
3493 int
3494 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
3495 {
3496 gdb_assert (gdbarch != NULL);
3497 return gdbarch->print_float_info != 0;
3498 }
3499
3500 void
3501 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
3502 {
3503 gdb_assert (gdbarch != NULL);
3504 if (gdbarch->print_float_info == 0)
3505 internal_error (__FILE__, __LINE__,
3506 "gdbarch: gdbarch_print_float_info invalid");
3507 if (gdbarch_debug >= 2)
3508 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
3509 gdbarch->print_float_info (gdbarch, file, frame, args);
3510 }
3511
3512 void
3513 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
3514 gdbarch_print_float_info_ftype print_float_info)
3515 {
3516 gdbarch->print_float_info = print_float_info;
3517 }
3518
3519 int
3520 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
3521 {
3522 gdb_assert (gdbarch != NULL);
3523 return gdbarch->print_vector_info != 0;
3524 }
3525
3526 void
3527 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
3528 {
3529 gdb_assert (gdbarch != NULL);
3530 if (gdbarch->print_vector_info == 0)
3531 internal_error (__FILE__, __LINE__,
3532 "gdbarch: gdbarch_print_vector_info invalid");
3533 if (gdbarch_debug >= 2)
3534 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
3535 gdbarch->print_vector_info (gdbarch, file, frame, args);
3536 }
3537
3538 void
3539 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
3540 gdbarch_print_vector_info_ftype print_vector_info)
3541 {
3542 gdbarch->print_vector_info = print_vector_info;
3543 }
3544
3545 int
3546 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
3547 {
3548 gdb_assert (gdbarch != NULL);
3549 if (gdbarch->register_sim_regno == 0)
3550 internal_error (__FILE__, __LINE__,
3551 "gdbarch: gdbarch_register_sim_regno invalid");
3552 if (gdbarch_debug >= 2)
3553 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
3554 return gdbarch->register_sim_regno (reg_nr);
3555 }
3556
3557 void
3558 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
3559 gdbarch_register_sim_regno_ftype register_sim_regno)
3560 {
3561 gdbarch->register_sim_regno = register_sim_regno;
3562 }
3563
3564 int
3565 gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
3566 {
3567 gdb_assert (gdbarch != NULL);
3568 return gdbarch->register_bytes_ok != 0;
3569 }
3570
3571 int
3572 gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
3573 {
3574 gdb_assert (gdbarch != NULL);
3575 if (gdbarch->register_bytes_ok == 0)
3576 internal_error (__FILE__, __LINE__,
3577 "gdbarch: gdbarch_register_bytes_ok invalid");
3578 if (gdbarch_debug >= 2)
3579 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
3580 return gdbarch->register_bytes_ok (nr_bytes);
3581 }
3582
3583 void
3584 set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
3585 gdbarch_register_bytes_ok_ftype register_bytes_ok)
3586 {
3587 gdbarch->register_bytes_ok = register_bytes_ok;
3588 }
3589
3590 int
3591 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
3592 {
3593 gdb_assert (gdbarch != NULL);
3594 if (gdbarch->cannot_fetch_register == 0)
3595 internal_error (__FILE__, __LINE__,
3596 "gdbarch: gdbarch_cannot_fetch_register invalid");
3597 if (gdbarch_debug >= 2)
3598 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
3599 return gdbarch->cannot_fetch_register (regnum);
3600 }
3601
3602 void
3603 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
3604 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
3605 {
3606 gdbarch->cannot_fetch_register = cannot_fetch_register;
3607 }
3608
3609 int
3610 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
3611 {
3612 gdb_assert (gdbarch != NULL);
3613 if (gdbarch->cannot_store_register == 0)
3614 internal_error (__FILE__, __LINE__,
3615 "gdbarch: gdbarch_cannot_store_register invalid");
3616 if (gdbarch_debug >= 2)
3617 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
3618 return gdbarch->cannot_store_register (regnum);
3619 }
3620
3621 void
3622 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
3623 gdbarch_cannot_store_register_ftype cannot_store_register)
3624 {
3625 gdbarch->cannot_store_register = cannot_store_register;
3626 }
3627
3628 int
3629 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
3630 {
3631 gdb_assert (gdbarch != NULL);
3632 return gdbarch->get_longjmp_target != 0;
3633 }
3634
3635 int
3636 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
3637 {
3638 gdb_assert (gdbarch != NULL);
3639 if (gdbarch->get_longjmp_target == 0)
3640 internal_error (__FILE__, __LINE__,
3641 "gdbarch: gdbarch_get_longjmp_target invalid");
3642 if (gdbarch_debug >= 2)
3643 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
3644 return gdbarch->get_longjmp_target (pc);
3645 }
3646
3647 void
3648 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
3649 gdbarch_get_longjmp_target_ftype get_longjmp_target)
3650 {
3651 gdbarch->get_longjmp_target = get_longjmp_target;
3652 }
3653
3654 int
3655 gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch)
3656 {
3657 gdb_assert (gdbarch != NULL);
3658 /* Skip verify of deprecated_use_generic_dummy_frames, invalid_p == 0 */
3659 if (gdbarch_debug >= 2)
3660 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_generic_dummy_frames called\n");
3661 return gdbarch->deprecated_use_generic_dummy_frames;
3662 }
3663
3664 void
3665 set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch,
3666 int deprecated_use_generic_dummy_frames)
3667 {
3668 gdbarch->deprecated_use_generic_dummy_frames = deprecated_use_generic_dummy_frames;
3669 }
3670
3671 int
3672 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
3673 {
3674 gdb_assert (gdbarch != NULL);
3675 /* Skip verify of call_dummy_location, invalid_p == 0 */
3676 if (gdbarch_debug >= 2)
3677 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
3678 return gdbarch->call_dummy_location;
3679 }
3680
3681 void
3682 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
3683 int call_dummy_location)
3684 {
3685 gdbarch->call_dummy_location = call_dummy_location;
3686 }
3687
3688 CORE_ADDR
3689 gdbarch_call_dummy_address (struct gdbarch *gdbarch)
3690 {
3691 gdb_assert (gdbarch != NULL);
3692 if (gdbarch->call_dummy_address == 0)
3693 internal_error (__FILE__, __LINE__,
3694 "gdbarch: gdbarch_call_dummy_address invalid");
3695 if (gdbarch_debug >= 2)
3696 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n");
3697 return gdbarch->call_dummy_address ();
3698 }
3699
3700 void
3701 set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
3702 gdbarch_call_dummy_address_ftype call_dummy_address)
3703 {
3704 gdbarch->call_dummy_address = call_dummy_address;
3705 }
3706
3707 CORE_ADDR
3708 gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch)
3709 {
3710 gdb_assert (gdbarch != NULL);
3711 if (gdbarch->call_dummy_start_offset == -1)
3712 internal_error (__FILE__, __LINE__,
3713 "gdbarch: gdbarch_call_dummy_start_offset invalid");
3714 if (gdbarch_debug >= 2)
3715 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n");
3716 return gdbarch->call_dummy_start_offset;
3717 }
3718
3719 void
3720 set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch,
3721 CORE_ADDR call_dummy_start_offset)
3722 {
3723 gdbarch->call_dummy_start_offset = call_dummy_start_offset;
3724 }
3725
3726 CORE_ADDR
3727 gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
3728 {
3729 gdb_assert (gdbarch != NULL);
3730 if (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1)
3731 internal_error (__FILE__, __LINE__,
3732 "gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
3733 if (gdbarch_debug >= 2)
3734 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n");
3735 return gdbarch->call_dummy_breakpoint_offset;
3736 }
3737
3738 void
3739 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
3740 CORE_ADDR call_dummy_breakpoint_offset)
3741 {
3742 gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset;
3743 }
3744
3745 int
3746 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch)
3747 {
3748 gdb_assert (gdbarch != NULL);
3749 if (gdbarch->call_dummy_breakpoint_offset_p == -1)
3750 internal_error (__FILE__, __LINE__,
3751 "gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
3752 if (gdbarch_debug >= 2)
3753 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n");
3754 return gdbarch->call_dummy_breakpoint_offset_p;
3755 }
3756
3757 void
3758 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch,
3759 int call_dummy_breakpoint_offset_p)
3760 {
3761 gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p;
3762 }
3763
3764 int
3765 gdbarch_call_dummy_length (struct gdbarch *gdbarch)
3766 {
3767 gdb_assert (gdbarch != NULL);
3768 if (gdbarch->call_dummy_length == -1)
3769 internal_error (__FILE__, __LINE__,
3770 "gdbarch: gdbarch_call_dummy_length invalid");
3771 if (gdbarch_debug >= 2)
3772 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n");
3773 return gdbarch->call_dummy_length;
3774 }
3775
3776 void
3777 set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
3778 int call_dummy_length)
3779 {
3780 gdbarch->call_dummy_length = call_dummy_length;
3781 }
3782
3783 int
3784 gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch)
3785 {
3786 gdb_assert (gdbarch != NULL);
3787 return gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy;
3788 }
3789
3790 int
3791 gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
3792 {
3793 gdb_assert (gdbarch != NULL);
3794 if (gdbarch->deprecated_pc_in_call_dummy == 0)
3795 internal_error (__FILE__, __LINE__,
3796 "gdbarch: gdbarch_deprecated_pc_in_call_dummy invalid");
3797 /* Ignore predicate (gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy). */
3798 if (gdbarch_debug >= 2)
3799 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pc_in_call_dummy called\n");
3800 return gdbarch->deprecated_pc_in_call_dummy (pc, sp, frame_address);
3801 }
3802
3803 void
3804 set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch,
3805 gdbarch_deprecated_pc_in_call_dummy_ftype deprecated_pc_in_call_dummy)
3806 {
3807 gdbarch->deprecated_pc_in_call_dummy = deprecated_pc_in_call_dummy;
3808 }
3809
3810 int
3811 gdbarch_call_dummy_p (struct gdbarch *gdbarch)
3812 {
3813 gdb_assert (gdbarch != NULL);
3814 if (gdbarch->call_dummy_p == -1)
3815 internal_error (__FILE__, __LINE__,
3816 "gdbarch: gdbarch_call_dummy_p invalid");
3817 if (gdbarch_debug >= 2)
3818 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n");
3819 return gdbarch->call_dummy_p;
3820 }
3821
3822 void
3823 set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
3824 int call_dummy_p)
3825 {
3826 gdbarch->call_dummy_p = call_dummy_p;
3827 }
3828
3829 LONGEST *
3830 gdbarch_call_dummy_words (struct gdbarch *gdbarch)
3831 {
3832 gdb_assert (gdbarch != NULL);
3833 /* Skip verify of call_dummy_words, invalid_p == 0 */
3834 if (gdbarch_debug >= 2)
3835 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
3836 return gdbarch->call_dummy_words;
3837 }
3838
3839 void
3840 set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
3841 LONGEST * call_dummy_words)
3842 {
3843 gdbarch->call_dummy_words = call_dummy_words;
3844 }
3845
3846 int
3847 gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
3848 {
3849 gdb_assert (gdbarch != NULL);
3850 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
3851 if (gdbarch_debug >= 2)
3852 fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
3853 return gdbarch->sizeof_call_dummy_words;
3854 }
3855
3856 void
3857 set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch,
3858 int sizeof_call_dummy_words)
3859 {
3860 gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words;
3861 }
3862
3863 int
3864 gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch)
3865 {
3866 gdb_assert (gdbarch != NULL);
3867 if (gdbarch->call_dummy_stack_adjust_p == -1)
3868 internal_error (__FILE__, __LINE__,
3869 "gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
3870 if (gdbarch_debug >= 2)
3871 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n");
3872 return gdbarch->call_dummy_stack_adjust_p;
3873 }
3874
3875 void
3876 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch,
3877 int call_dummy_stack_adjust_p)
3878 {
3879 gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p;
3880 }
3881
3882 int
3883 gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch)
3884 {
3885 gdb_assert (gdbarch != NULL);
3886 if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
3887 internal_error (__FILE__, __LINE__,
3888 "gdbarch: gdbarch_call_dummy_stack_adjust invalid");
3889 if (gdbarch_debug >= 2)
3890 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n");
3891 return gdbarch->call_dummy_stack_adjust;
3892 }
3893
3894 void
3895 set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch,
3896 int call_dummy_stack_adjust)
3897 {
3898 gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust;
3899 }
3900
3901 void
3902 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)
3903 {
3904 gdb_assert (gdbarch != NULL);
3905 if (gdbarch->fix_call_dummy == 0)
3906 internal_error (__FILE__, __LINE__,
3907 "gdbarch: gdbarch_fix_call_dummy invalid");
3908 if (gdbarch_debug >= 2)
3909 fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n");
3910 gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
3911 }
3912
3913 void
3914 set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
3915 gdbarch_fix_call_dummy_ftype fix_call_dummy)
3916 {
3917 gdbarch->fix_call_dummy = fix_call_dummy;
3918 }
3919
3920 int
3921 gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch)
3922 {
3923 gdb_assert (gdbarch != NULL);
3924 return gdbarch->deprecated_init_frame_pc_first != 0;
3925 }
3926
3927 CORE_ADDR
3928 gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
3929 {
3930 gdb_assert (gdbarch != NULL);
3931 if (gdbarch->deprecated_init_frame_pc_first == 0)
3932 internal_error (__FILE__, __LINE__,
3933 "gdbarch: gdbarch_deprecated_init_frame_pc_first invalid");
3934 if (gdbarch_debug >= 2)
3935 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc_first called\n");
3936 return gdbarch->deprecated_init_frame_pc_first (fromleaf, prev);
3937 }
3938
3939 void
3940 set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch,
3941 gdbarch_deprecated_init_frame_pc_first_ftype deprecated_init_frame_pc_first)
3942 {
3943 gdbarch->deprecated_init_frame_pc_first = deprecated_init_frame_pc_first;
3944 }
3945
3946 int
3947 gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch)
3948 {
3949 gdb_assert (gdbarch != NULL);
3950 return gdbarch->deprecated_init_frame_pc != 0;
3951 }
3952
3953 CORE_ADDR
3954 gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
3955 {
3956 gdb_assert (gdbarch != NULL);
3957 if (gdbarch->deprecated_init_frame_pc == 0)
3958 internal_error (__FILE__, __LINE__,
3959 "gdbarch: gdbarch_deprecated_init_frame_pc invalid");
3960 if (gdbarch_debug >= 2)
3961 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc called\n");
3962 return gdbarch->deprecated_init_frame_pc (fromleaf, prev);
3963 }
3964
3965 void
3966 set_gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch,
3967 gdbarch_deprecated_init_frame_pc_ftype deprecated_init_frame_pc)
3968 {
3969 gdbarch->deprecated_init_frame_pc = deprecated_init_frame_pc;
3970 }
3971
3972 int
3973 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
3974 {
3975 gdb_assert (gdbarch != NULL);
3976 if (gdbarch_debug >= 2)
3977 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
3978 return gdbarch->believe_pcc_promotion;
3979 }
3980
3981 void
3982 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
3983 int believe_pcc_promotion)
3984 {
3985 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
3986 }
3987
3988 int
3989 gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch)
3990 {
3991 gdb_assert (gdbarch != NULL);
3992 if (gdbarch_debug >= 2)
3993 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
3994 return gdbarch->believe_pcc_promotion_type;
3995 }
3996
3997 void
3998 set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
3999 int believe_pcc_promotion_type)
4000 {
4001 gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type;
4002 }
4003
4004 int
4005 gdbarch_get_saved_register_p (struct gdbarch *gdbarch)
4006 {
4007 gdb_assert (gdbarch != NULL);
4008 return gdbarch->get_saved_register != 0;
4009 }
4010
4011 void
4012 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)
4013 {
4014 gdb_assert (gdbarch != NULL);
4015 if (gdbarch->get_saved_register == 0)
4016 internal_error (__FILE__, __LINE__,
4017 "gdbarch: gdbarch_get_saved_register invalid");
4018 if (gdbarch_debug >= 2)
4019 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n");
4020 gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
4021 }
4022
4023 void
4024 set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
4025 gdbarch_get_saved_register_ftype get_saved_register)
4026 {
4027 gdbarch->get_saved_register = get_saved_register;
4028 }
4029
4030 int
4031 gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
4032 {
4033 gdb_assert (gdbarch != NULL);
4034 if (gdbarch->register_convertible == 0)
4035 internal_error (__FILE__, __LINE__,
4036 "gdbarch: gdbarch_register_convertible invalid");
4037 if (gdbarch_debug >= 2)
4038 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n");
4039 return gdbarch->register_convertible (nr);
4040 }
4041
4042 void
4043 set_gdbarch_register_convertible (struct gdbarch *gdbarch,
4044 gdbarch_register_convertible_ftype register_convertible)
4045 {
4046 gdbarch->register_convertible = register_convertible;
4047 }
4048
4049 void
4050 gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
4051 {
4052 gdb_assert (gdbarch != NULL);
4053 if (gdbarch->register_convert_to_virtual == 0)
4054 internal_error (__FILE__, __LINE__,
4055 "gdbarch: gdbarch_register_convert_to_virtual invalid");
4056 if (gdbarch_debug >= 2)
4057 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n");
4058 gdbarch->register_convert_to_virtual (regnum, type, from, to);
4059 }
4060
4061 void
4062 set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch,
4063 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual)
4064 {
4065 gdbarch->register_convert_to_virtual = register_convert_to_virtual;
4066 }
4067
4068 void
4069 gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
4070 {
4071 gdb_assert (gdbarch != NULL);
4072 if (gdbarch->register_convert_to_raw == 0)
4073 internal_error (__FILE__, __LINE__,
4074 "gdbarch: gdbarch_register_convert_to_raw invalid");
4075 if (gdbarch_debug >= 2)
4076 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n");
4077 gdbarch->register_convert_to_raw (type, regnum, from, to);
4078 }
4079
4080 void
4081 set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch,
4082 gdbarch_register_convert_to_raw_ftype register_convert_to_raw)
4083 {
4084 gdbarch->register_convert_to_raw = register_convert_to_raw;
4085 }
4086
4087 int
4088 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum)
4089 {
4090 gdb_assert (gdbarch != NULL);
4091 if (gdbarch->convert_register_p == 0)
4092 internal_error (__FILE__, __LINE__,
4093 "gdbarch: gdbarch_convert_register_p invalid");
4094 if (gdbarch_debug >= 2)
4095 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
4096 return gdbarch->convert_register_p (regnum);
4097 }
4098
4099 void
4100 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
4101 gdbarch_convert_register_p_ftype convert_register_p)
4102 {
4103 gdbarch->convert_register_p = convert_register_p;
4104 }
4105
4106 void
4107 gdbarch_register_to_value (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
4108 {
4109 gdb_assert (gdbarch != NULL);
4110 if (gdbarch->register_to_value == 0)
4111 internal_error (__FILE__, __LINE__,
4112 "gdbarch: gdbarch_register_to_value invalid");
4113 if (gdbarch_debug >= 2)
4114 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
4115 gdbarch->register_to_value (regnum, type, from, to);
4116 }
4117
4118 void
4119 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
4120 gdbarch_register_to_value_ftype register_to_value)
4121 {
4122 gdbarch->register_to_value = register_to_value;
4123 }
4124
4125 void
4126 gdbarch_value_to_register (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
4127 {
4128 gdb_assert (gdbarch != NULL);
4129 if (gdbarch->value_to_register == 0)
4130 internal_error (__FILE__, __LINE__,
4131 "gdbarch: gdbarch_value_to_register invalid");
4132 if (gdbarch_debug >= 2)
4133 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
4134 gdbarch->value_to_register (type, regnum, from, to);
4135 }
4136
4137 void
4138 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
4139 gdbarch_value_to_register_ftype value_to_register)
4140 {
4141 gdbarch->value_to_register = value_to_register;
4142 }
4143
4144 CORE_ADDR
4145 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf)
4146 {
4147 gdb_assert (gdbarch != NULL);
4148 if (gdbarch->pointer_to_address == 0)
4149 internal_error (__FILE__, __LINE__,
4150 "gdbarch: gdbarch_pointer_to_address invalid");
4151 if (gdbarch_debug >= 2)
4152 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
4153 return gdbarch->pointer_to_address (type, buf);
4154 }
4155
4156 void
4157 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
4158 gdbarch_pointer_to_address_ftype pointer_to_address)
4159 {
4160 gdbarch->pointer_to_address = pointer_to_address;
4161 }
4162
4163 void
4164 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
4165 {
4166 gdb_assert (gdbarch != NULL);
4167 if (gdbarch->address_to_pointer == 0)
4168 internal_error (__FILE__, __LINE__,
4169 "gdbarch: gdbarch_address_to_pointer invalid");
4170 if (gdbarch_debug >= 2)
4171 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
4172 gdbarch->address_to_pointer (type, buf, addr);
4173 }
4174
4175 void
4176 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
4177 gdbarch_address_to_pointer_ftype address_to_pointer)
4178 {
4179 gdbarch->address_to_pointer = address_to_pointer;
4180 }
4181
4182 int
4183 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
4184 {
4185 gdb_assert (gdbarch != NULL);
4186 return gdbarch->integer_to_address != 0;
4187 }
4188
4189 CORE_ADDR
4190 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
4191 {
4192 gdb_assert (gdbarch != NULL);
4193 if (gdbarch->integer_to_address == 0)
4194 internal_error (__FILE__, __LINE__,
4195 "gdbarch: gdbarch_integer_to_address invalid");
4196 if (gdbarch_debug >= 2)
4197 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
4198 return gdbarch->integer_to_address (type, buf);
4199 }
4200
4201 void
4202 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
4203 gdbarch_integer_to_address_ftype integer_to_address)
4204 {
4205 gdbarch->integer_to_address = integer_to_address;
4206 }
4207
4208 int
4209 gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type)
4210 {
4211 gdb_assert (gdbarch != NULL);
4212 if (gdbarch->return_value_on_stack == 0)
4213 internal_error (__FILE__, __LINE__,
4214 "gdbarch: gdbarch_return_value_on_stack invalid");
4215 if (gdbarch_debug >= 2)
4216 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n");
4217 return gdbarch->return_value_on_stack (type);
4218 }
4219
4220 void
4221 set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
4222 gdbarch_return_value_on_stack_ftype return_value_on_stack)
4223 {
4224 gdbarch->return_value_on_stack = return_value_on_stack;
4225 }
4226
4227 CORE_ADDR
4228 gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
4229 {
4230 gdb_assert (gdbarch != NULL);
4231 if (gdbarch->push_arguments == 0)
4232 internal_error (__FILE__, __LINE__,
4233 "gdbarch: gdbarch_push_arguments invalid");
4234 if (gdbarch_debug >= 2)
4235 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n");
4236 return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr);
4237 }
4238
4239 void
4240 set_gdbarch_push_arguments (struct gdbarch *gdbarch,
4241 gdbarch_push_arguments_ftype push_arguments)
4242 {
4243 gdbarch->push_arguments = push_arguments;
4244 }
4245
4246 int
4247 gdbarch_deprecated_push_dummy_frame_p (struct gdbarch *gdbarch)
4248 {
4249 gdb_assert (gdbarch != NULL);
4250 return gdbarch->deprecated_push_dummy_frame != 0;
4251 }
4252
4253 void
4254 gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch)
4255 {
4256 gdb_assert (gdbarch != NULL);
4257 if (gdbarch->deprecated_push_dummy_frame == 0)
4258 internal_error (__FILE__, __LINE__,
4259 "gdbarch: gdbarch_deprecated_push_dummy_frame invalid");
4260 if (gdbarch_debug >= 2)
4261 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_dummy_frame called\n");
4262 gdbarch->deprecated_push_dummy_frame ();
4263 }
4264
4265 void
4266 set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch,
4267 gdbarch_deprecated_push_dummy_frame_ftype deprecated_push_dummy_frame)
4268 {
4269 gdbarch->deprecated_push_dummy_frame = deprecated_push_dummy_frame;
4270 }
4271
4272 int
4273 gdbarch_push_return_address_p (struct gdbarch *gdbarch)
4274 {
4275 gdb_assert (gdbarch != NULL);
4276 return gdbarch->push_return_address != 0;
4277 }
4278
4279 CORE_ADDR
4280 gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
4281 {
4282 gdb_assert (gdbarch != NULL);
4283 if (gdbarch->push_return_address == 0)
4284 internal_error (__FILE__, __LINE__,
4285 "gdbarch: gdbarch_push_return_address invalid");
4286 if (gdbarch_debug >= 2)
4287 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n");
4288 return gdbarch->push_return_address (pc, sp);
4289 }
4290
4291 void
4292 set_gdbarch_push_return_address (struct gdbarch *gdbarch,
4293 gdbarch_push_return_address_ftype push_return_address)
4294 {
4295 gdbarch->push_return_address = push_return_address;
4296 }
4297
4298 int
4299 gdbarch_pop_frame_p (struct gdbarch *gdbarch)
4300 {
4301 gdb_assert (gdbarch != NULL);
4302 return gdbarch->pop_frame != 0;
4303 }
4304
4305 void
4306 gdbarch_pop_frame (struct gdbarch *gdbarch)
4307 {
4308 gdb_assert (gdbarch != NULL);
4309 if (gdbarch->pop_frame == 0)
4310 internal_error (__FILE__, __LINE__,
4311 "gdbarch: gdbarch_pop_frame invalid");
4312 if (gdbarch_debug >= 2)
4313 fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
4314 gdbarch->pop_frame ();
4315 }
4316
4317 void
4318 set_gdbarch_pop_frame (struct gdbarch *gdbarch,
4319 gdbarch_pop_frame_ftype pop_frame)
4320 {
4321 gdbarch->pop_frame = pop_frame;
4322 }
4323
4324 void
4325 gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
4326 {
4327 gdb_assert (gdbarch != NULL);
4328 if (gdbarch->store_struct_return == 0)
4329 internal_error (__FILE__, __LINE__,
4330 "gdbarch: gdbarch_store_struct_return invalid");
4331 if (gdbarch_debug >= 2)
4332 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n");
4333 gdbarch->store_struct_return (addr, sp);
4334 }
4335
4336 void
4337 set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
4338 gdbarch_store_struct_return_ftype store_struct_return)
4339 {
4340 gdbarch->store_struct_return = store_struct_return;
4341 }
4342
4343 void
4344 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf)
4345 {
4346 gdb_assert (gdbarch != NULL);
4347 if (gdbarch->extract_return_value == 0)
4348 internal_error (__FILE__, __LINE__,
4349 "gdbarch: gdbarch_extract_return_value invalid");
4350 if (gdbarch_debug >= 2)
4351 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
4352 gdbarch->extract_return_value (type, regcache, valbuf);
4353 }
4354
4355 void
4356 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
4357 gdbarch_extract_return_value_ftype extract_return_value)
4358 {
4359 gdbarch->extract_return_value = extract_return_value;
4360 }
4361
4362 void
4363 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf)
4364 {
4365 gdb_assert (gdbarch != NULL);
4366 if (gdbarch->store_return_value == 0)
4367 internal_error (__FILE__, __LINE__,
4368 "gdbarch: gdbarch_store_return_value invalid");
4369 if (gdbarch_debug >= 2)
4370 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
4371 gdbarch->store_return_value (type, regcache, valbuf);
4372 }
4373
4374 void
4375 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
4376 gdbarch_store_return_value_ftype store_return_value)
4377 {
4378 gdbarch->store_return_value = store_return_value;
4379 }
4380
4381 void
4382 gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
4383 {
4384 gdb_assert (gdbarch != NULL);
4385 if (gdbarch->deprecated_extract_return_value == 0)
4386 internal_error (__FILE__, __LINE__,
4387 "gdbarch: gdbarch_deprecated_extract_return_value invalid");
4388 if (gdbarch_debug >= 2)
4389 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n");
4390 gdbarch->deprecated_extract_return_value (type, regbuf, valbuf);
4391 }
4392
4393 void
4394 set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch,
4395 gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value)
4396 {
4397 gdbarch->deprecated_extract_return_value = deprecated_extract_return_value;
4398 }
4399
4400 void
4401 gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
4402 {
4403 gdb_assert (gdbarch != NULL);
4404 if (gdbarch->deprecated_store_return_value == 0)
4405 internal_error (__FILE__, __LINE__,
4406 "gdbarch: gdbarch_deprecated_store_return_value invalid");
4407 if (gdbarch_debug >= 2)
4408 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n");
4409 gdbarch->deprecated_store_return_value (type, valbuf);
4410 }
4411
4412 void
4413 set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch,
4414 gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value)
4415 {
4416 gdbarch->deprecated_store_return_value = deprecated_store_return_value;
4417 }
4418
4419 int
4420 gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
4421 {
4422 gdb_assert (gdbarch != NULL);
4423 return gdbarch->extract_struct_value_address != 0;
4424 }
4425
4426 CORE_ADDR
4427 gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
4428 {
4429 gdb_assert (gdbarch != NULL);
4430 if (gdbarch->extract_struct_value_address == 0)
4431 internal_error (__FILE__, __LINE__,
4432 "gdbarch: gdbarch_extract_struct_value_address invalid");
4433 if (gdbarch_debug >= 2)
4434 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
4435 return gdbarch->extract_struct_value_address (regcache);
4436 }
4437
4438 void
4439 set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
4440 gdbarch_extract_struct_value_address_ftype extract_struct_value_address)
4441 {
4442 gdbarch->extract_struct_value_address = extract_struct_value_address;
4443 }
4444
4445 int
4446 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
4447 {
4448 gdb_assert (gdbarch != NULL);
4449 return gdbarch->deprecated_extract_struct_value_address != 0;
4450 }
4451
4452 CORE_ADDR
4453 gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
4454 {
4455 gdb_assert (gdbarch != NULL);
4456 if (gdbarch->deprecated_extract_struct_value_address == 0)
4457 internal_error (__FILE__, __LINE__,
4458 "gdbarch: gdbarch_deprecated_extract_struct_value_address invalid");
4459 if (gdbarch_debug >= 2)
4460 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
4461 return gdbarch->deprecated_extract_struct_value_address (regbuf);
4462 }
4463
4464 void
4465 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
4466 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
4467 {
4468 gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
4469 }
4470
4471 int
4472 gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
4473 {
4474 gdb_assert (gdbarch != NULL);
4475 if (gdbarch->use_struct_convention == 0)
4476 internal_error (__FILE__, __LINE__,
4477 "gdbarch: gdbarch_use_struct_convention invalid");
4478 if (gdbarch_debug >= 2)
4479 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
4480 return gdbarch->use_struct_convention (gcc_p, value_type);
4481 }
4482
4483 void
4484 set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
4485 gdbarch_use_struct_convention_ftype use_struct_convention)
4486 {
4487 gdbarch->use_struct_convention = use_struct_convention;
4488 }
4489
4490 int
4491 gdbarch_deprecated_frame_init_saved_regs_p (struct gdbarch *gdbarch)
4492 {
4493 gdb_assert (gdbarch != NULL);
4494 return gdbarch->deprecated_frame_init_saved_regs != 0;
4495 }
4496
4497 void
4498 gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
4499 {
4500 gdb_assert (gdbarch != NULL);
4501 if (gdbarch->deprecated_frame_init_saved_regs == 0)
4502 internal_error (__FILE__, __LINE__,
4503 "gdbarch: gdbarch_deprecated_frame_init_saved_regs invalid");
4504 if (gdbarch_debug >= 2)
4505 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_init_saved_regs called\n");
4506 gdbarch->deprecated_frame_init_saved_regs (frame);
4507 }
4508
4509 void
4510 set_gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch,
4511 gdbarch_deprecated_frame_init_saved_regs_ftype deprecated_frame_init_saved_regs)
4512 {
4513 gdbarch->deprecated_frame_init_saved_regs = deprecated_frame_init_saved_regs;
4514 }
4515
4516 int
4517 gdbarch_deprecated_init_extra_frame_info_p (struct gdbarch *gdbarch)
4518 {
4519 gdb_assert (gdbarch != NULL);
4520 return gdbarch->deprecated_init_extra_frame_info != 0;
4521 }
4522
4523 void
4524 gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
4525 {
4526 gdb_assert (gdbarch != NULL);
4527 if (gdbarch->deprecated_init_extra_frame_info == 0)
4528 internal_error (__FILE__, __LINE__,
4529 "gdbarch: gdbarch_deprecated_init_extra_frame_info invalid");
4530 if (gdbarch_debug >= 2)
4531 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_extra_frame_info called\n");
4532 gdbarch->deprecated_init_extra_frame_info (fromleaf, frame);
4533 }
4534
4535 void
4536 set_gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch,
4537 gdbarch_deprecated_init_extra_frame_info_ftype deprecated_init_extra_frame_info)
4538 {
4539 gdbarch->deprecated_init_extra_frame_info = deprecated_init_extra_frame_info;
4540 }
4541
4542 CORE_ADDR
4543 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
4544 {
4545 gdb_assert (gdbarch != NULL);
4546 if (gdbarch->skip_prologue == 0)
4547 internal_error (__FILE__, __LINE__,
4548 "gdbarch: gdbarch_skip_prologue invalid");
4549 if (gdbarch_debug >= 2)
4550 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
4551 return gdbarch->skip_prologue (ip);
4552 }
4553
4554 void
4555 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
4556 gdbarch_skip_prologue_ftype skip_prologue)
4557 {
4558 gdbarch->skip_prologue = skip_prologue;
4559 }
4560
4561 int
4562 gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip)
4563 {
4564 gdb_assert (gdbarch != NULL);
4565 if (gdbarch->prologue_frameless_p == 0)
4566 internal_error (__FILE__, __LINE__,
4567 "gdbarch: gdbarch_prologue_frameless_p invalid");
4568 if (gdbarch_debug >= 2)
4569 fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n");
4570 return gdbarch->prologue_frameless_p (ip);
4571 }
4572
4573 void
4574 set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch,
4575 gdbarch_prologue_frameless_p_ftype prologue_frameless_p)
4576 {
4577 gdbarch->prologue_frameless_p = prologue_frameless_p;
4578 }
4579
4580 int
4581 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
4582 {
4583 gdb_assert (gdbarch != NULL);
4584 if (gdbarch->inner_than == 0)
4585 internal_error (__FILE__, __LINE__,
4586 "gdbarch: gdbarch_inner_than invalid");
4587 if (gdbarch_debug >= 2)
4588 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
4589 return gdbarch->inner_than (lhs, rhs);
4590 }
4591
4592 void
4593 set_gdbarch_inner_than (struct gdbarch *gdbarch,
4594 gdbarch_inner_than_ftype inner_than)
4595 {
4596 gdbarch->inner_than = inner_than;
4597 }
4598
4599 const unsigned char *
4600 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
4601 {
4602 gdb_assert (gdbarch != NULL);
4603 if (gdbarch->breakpoint_from_pc == 0)
4604 internal_error (__FILE__, __LINE__,
4605 "gdbarch: gdbarch_breakpoint_from_pc invalid");
4606 if (gdbarch_debug >= 2)
4607 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
4608 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
4609 }
4610
4611 void
4612 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
4613 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
4614 {
4615 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
4616 }
4617
4618 int
4619 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
4620 {
4621 gdb_assert (gdbarch != NULL);
4622 if (gdbarch->memory_insert_breakpoint == 0)
4623 internal_error (__FILE__, __LINE__,
4624 "gdbarch: gdbarch_memory_insert_breakpoint invalid");
4625 if (gdbarch_debug >= 2)
4626 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
4627 return gdbarch->memory_insert_breakpoint (addr, contents_cache);
4628 }
4629
4630 void
4631 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
4632 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
4633 {
4634 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
4635 }
4636
4637 int
4638 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
4639 {
4640 gdb_assert (gdbarch != NULL);
4641 if (gdbarch->memory_remove_breakpoint == 0)
4642 internal_error (__FILE__, __LINE__,
4643 "gdbarch: gdbarch_memory_remove_breakpoint invalid");
4644 if (gdbarch_debug >= 2)
4645 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
4646 return gdbarch->memory_remove_breakpoint (addr, contents_cache);
4647 }
4648
4649 void
4650 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
4651 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
4652 {
4653 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
4654 }
4655
4656 CORE_ADDR
4657 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
4658 {
4659 gdb_assert (gdbarch != NULL);
4660 if (gdbarch->decr_pc_after_break == -1)
4661 internal_error (__FILE__, __LINE__,
4662 "gdbarch: gdbarch_decr_pc_after_break invalid");
4663 if (gdbarch_debug >= 2)
4664 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
4665 return gdbarch->decr_pc_after_break;
4666 }
4667
4668 void
4669 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
4670 CORE_ADDR decr_pc_after_break)
4671 {
4672 gdbarch->decr_pc_after_break = decr_pc_after_break;
4673 }
4674
4675 int
4676 gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it)
4677 {
4678 gdb_assert (gdbarch != NULL);
4679 if (gdbarch->prepare_to_proceed == 0)
4680 internal_error (__FILE__, __LINE__,
4681 "gdbarch: gdbarch_prepare_to_proceed invalid");
4682 if (gdbarch_debug >= 2)
4683 fprintf_unfiltered (gdb_stdlog, "gdbarch_prepare_to_proceed called\n");
4684 return gdbarch->prepare_to_proceed (select_it);
4685 }
4686
4687 void
4688 set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch,
4689 gdbarch_prepare_to_proceed_ftype prepare_to_proceed)
4690 {
4691 gdbarch->prepare_to_proceed = prepare_to_proceed;
4692 }
4693
4694 CORE_ADDR
4695 gdbarch_function_start_offset (struct gdbarch *gdbarch)
4696 {
4697 gdb_assert (gdbarch != NULL);
4698 if (gdbarch->function_start_offset == -1)
4699 internal_error (__FILE__, __LINE__,
4700 "gdbarch: gdbarch_function_start_offset invalid");
4701 if (gdbarch_debug >= 2)
4702 fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
4703 return gdbarch->function_start_offset;
4704 }
4705
4706 void
4707 set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
4708 CORE_ADDR function_start_offset)
4709 {
4710 gdbarch->function_start_offset = function_start_offset;
4711 }
4712
4713 void
4714 gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
4715 {
4716 gdb_assert (gdbarch != NULL);
4717 if (gdbarch->remote_translate_xfer_address == 0)
4718 internal_error (__FILE__, __LINE__,
4719 "gdbarch: gdbarch_remote_translate_xfer_address invalid");
4720 if (gdbarch_debug >= 2)
4721 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
4722 gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len);
4723 }
4724
4725 void
4726 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
4727 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
4728 {
4729 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
4730 }
4731
4732 CORE_ADDR
4733 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
4734 {
4735 gdb_assert (gdbarch != NULL);
4736 if (gdbarch->frame_args_skip == -1)
4737 internal_error (__FILE__, __LINE__,
4738 "gdbarch: gdbarch_frame_args_skip invalid");
4739 if (gdbarch_debug >= 2)
4740 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
4741 return gdbarch->frame_args_skip;
4742 }
4743
4744 void
4745 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
4746 CORE_ADDR frame_args_skip)
4747 {
4748 gdbarch->frame_args_skip = frame_args_skip;
4749 }
4750
4751 int
4752 gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
4753 {
4754 gdb_assert (gdbarch != NULL);
4755 if (gdbarch->frameless_function_invocation == 0)
4756 internal_error (__FILE__, __LINE__,
4757 "gdbarch: gdbarch_frameless_function_invocation invalid");
4758 if (gdbarch_debug >= 2)
4759 fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n");
4760 return gdbarch->frameless_function_invocation (fi);
4761 }
4762
4763 void
4764 set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
4765 gdbarch_frameless_function_invocation_ftype frameless_function_invocation)
4766 {
4767 gdbarch->frameless_function_invocation = frameless_function_invocation;
4768 }
4769
4770 int
4771 gdbarch_frame_chain_p (struct gdbarch *gdbarch)
4772 {
4773 gdb_assert (gdbarch != NULL);
4774 return gdbarch->frame_chain != 0;
4775 }
4776
4777 CORE_ADDR
4778 gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
4779 {
4780 gdb_assert (gdbarch != NULL);
4781 if (gdbarch->frame_chain == 0)
4782 internal_error (__FILE__, __LINE__,
4783 "gdbarch: gdbarch_frame_chain invalid");
4784 if (gdbarch_debug >= 2)
4785 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n");
4786 return gdbarch->frame_chain (frame);
4787 }
4788
4789 void
4790 set_gdbarch_frame_chain (struct gdbarch *gdbarch,
4791 gdbarch_frame_chain_ftype frame_chain)
4792 {
4793 gdbarch->frame_chain = frame_chain;
4794 }
4795
4796 int
4797 gdbarch_frame_chain_valid_p (struct gdbarch *gdbarch)
4798 {
4799 gdb_assert (gdbarch != NULL);
4800 return gdbarch->frame_chain_valid != 0;
4801 }
4802
4803 int
4804 gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
4805 {
4806 gdb_assert (gdbarch != NULL);
4807 if (gdbarch->frame_chain_valid == 0)
4808 internal_error (__FILE__, __LINE__,
4809 "gdbarch: gdbarch_frame_chain_valid invalid");
4810 if (gdbarch_debug >= 2)
4811 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n");
4812 return gdbarch->frame_chain_valid (chain, thisframe);
4813 }
4814
4815 void
4816 set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
4817 gdbarch_frame_chain_valid_ftype frame_chain_valid)
4818 {
4819 gdbarch->frame_chain_valid = frame_chain_valid;
4820 }
4821
4822 int
4823 gdbarch_frame_saved_pc_p (struct gdbarch *gdbarch)
4824 {
4825 gdb_assert (gdbarch != NULL);
4826 return gdbarch->frame_saved_pc != 0;
4827 }
4828
4829 CORE_ADDR
4830 gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
4831 {
4832 gdb_assert (gdbarch != NULL);
4833 if (gdbarch->frame_saved_pc == 0)
4834 internal_error (__FILE__, __LINE__,
4835 "gdbarch: gdbarch_frame_saved_pc invalid");
4836 if (gdbarch_debug >= 2)
4837 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n");
4838 return gdbarch->frame_saved_pc (fi);
4839 }
4840
4841 void
4842 set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
4843 gdbarch_frame_saved_pc_ftype frame_saved_pc)
4844 {
4845 gdbarch->frame_saved_pc = frame_saved_pc;
4846 }
4847
4848 CORE_ADDR
4849 gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
4850 {
4851 gdb_assert (gdbarch != NULL);
4852 if (gdbarch->frame_args_address == 0)
4853 internal_error (__FILE__, __LINE__,
4854 "gdbarch: gdbarch_frame_args_address invalid");
4855 if (gdbarch_debug >= 2)
4856 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n");
4857 return gdbarch->frame_args_address (fi);
4858 }
4859
4860 void
4861 set_gdbarch_frame_args_address (struct gdbarch *gdbarch,
4862 gdbarch_frame_args_address_ftype frame_args_address)
4863 {
4864 gdbarch->frame_args_address = frame_args_address;
4865 }
4866
4867 CORE_ADDR
4868 gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
4869 {
4870 gdb_assert (gdbarch != NULL);
4871 if (gdbarch->frame_locals_address == 0)
4872 internal_error (__FILE__, __LINE__,
4873 "gdbarch: gdbarch_frame_locals_address invalid");
4874 if (gdbarch_debug >= 2)
4875 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n");
4876 return gdbarch->frame_locals_address (fi);
4877 }
4878
4879 void
4880 set_gdbarch_frame_locals_address (struct gdbarch *gdbarch,
4881 gdbarch_frame_locals_address_ftype frame_locals_address)
4882 {
4883 gdbarch->frame_locals_address = frame_locals_address;
4884 }
4885
4886 CORE_ADDR
4887 gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
4888 {
4889 gdb_assert (gdbarch != NULL);
4890 if (gdbarch->saved_pc_after_call == 0)
4891 internal_error (__FILE__, __LINE__,
4892 "gdbarch: gdbarch_saved_pc_after_call invalid");
4893 if (gdbarch_debug >= 2)
4894 fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n");
4895 return gdbarch->saved_pc_after_call (frame);
4896 }
4897
4898 void
4899 set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch,
4900 gdbarch_saved_pc_after_call_ftype saved_pc_after_call)
4901 {
4902 gdbarch->saved_pc_after_call = saved_pc_after_call;
4903 }
4904
4905 int
4906 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
4907 {
4908 gdb_assert (gdbarch != NULL);
4909 if (gdbarch->frame_num_args == 0)
4910 internal_error (__FILE__, __LINE__,
4911 "gdbarch: gdbarch_frame_num_args invalid");
4912 if (gdbarch_debug >= 2)
4913 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
4914 return gdbarch->frame_num_args (frame);
4915 }
4916
4917 void
4918 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
4919 gdbarch_frame_num_args_ftype frame_num_args)
4920 {
4921 gdbarch->frame_num_args = frame_num_args;
4922 }
4923
4924 int
4925 gdbarch_stack_align_p (struct gdbarch *gdbarch)
4926 {
4927 gdb_assert (gdbarch != NULL);
4928 return gdbarch->stack_align != 0;
4929 }
4930
4931 CORE_ADDR
4932 gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
4933 {
4934 gdb_assert (gdbarch != NULL);
4935 if (gdbarch->stack_align == 0)
4936 internal_error (__FILE__, __LINE__,
4937 "gdbarch: gdbarch_stack_align invalid");
4938 if (gdbarch_debug >= 2)
4939 fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n");
4940 return gdbarch->stack_align (sp);
4941 }
4942
4943 void
4944 set_gdbarch_stack_align (struct gdbarch *gdbarch,
4945 gdbarch_stack_align_ftype stack_align)
4946 {
4947 gdbarch->stack_align = stack_align;
4948 }
4949
4950 int
4951 gdbarch_frame_align_p (struct gdbarch *gdbarch)
4952 {
4953 gdb_assert (gdbarch != NULL);
4954 return gdbarch->frame_align != 0;
4955 }
4956
4957 CORE_ADDR
4958 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
4959 {
4960 gdb_assert (gdbarch != NULL);
4961 if (gdbarch->frame_align == 0)
4962 internal_error (__FILE__, __LINE__,
4963 "gdbarch: gdbarch_frame_align invalid");
4964 if (gdbarch_debug >= 2)
4965 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
4966 return gdbarch->frame_align (gdbarch, address);
4967 }
4968
4969 void
4970 set_gdbarch_frame_align (struct gdbarch *gdbarch,
4971 gdbarch_frame_align_ftype frame_align)
4972 {
4973 gdbarch->frame_align = frame_align;
4974 }
4975
4976 int
4977 gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
4978 {
4979 gdb_assert (gdbarch != NULL);
4980 /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
4981 if (gdbarch_debug >= 2)
4982 fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n");
4983 return gdbarch->extra_stack_alignment_needed;
4984 }
4985
4986 void
4987 set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch,
4988 int extra_stack_alignment_needed)
4989 {
4990 gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed;
4991 }
4992
4993 int
4994 gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
4995 {
4996 gdb_assert (gdbarch != NULL);
4997 return gdbarch->reg_struct_has_addr != 0;
4998 }
4999
5000 int
5001 gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
5002 {
5003 gdb_assert (gdbarch != NULL);
5004 if (gdbarch->reg_struct_has_addr == 0)
5005 internal_error (__FILE__, __LINE__,
5006 "gdbarch: gdbarch_reg_struct_has_addr invalid");
5007 if (gdbarch_debug >= 2)
5008 fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n");
5009 return gdbarch->reg_struct_has_addr (gcc_p, type);
5010 }
5011
5012 void
5013 set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
5014 gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr)
5015 {
5016 gdbarch->reg_struct_has_addr = reg_struct_has_addr;
5017 }
5018
5019 int
5020 gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
5021 {
5022 gdb_assert (gdbarch != NULL);
5023 return gdbarch->save_dummy_frame_tos != 0;
5024 }
5025
5026 void
5027 gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
5028 {
5029 gdb_assert (gdbarch != NULL);
5030 if (gdbarch->save_dummy_frame_tos == 0)
5031 internal_error (__FILE__, __LINE__,
5032 "gdbarch: gdbarch_save_dummy_frame_tos invalid");
5033 if (gdbarch_debug >= 2)
5034 fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n");
5035 gdbarch->save_dummy_frame_tos (sp);
5036 }
5037
5038 void
5039 set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
5040 gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos)
5041 {
5042 gdbarch->save_dummy_frame_tos = save_dummy_frame_tos;
5043 }
5044
5045 int
5046 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
5047 {
5048 gdb_assert (gdbarch != NULL);
5049 return gdbarch->unwind_dummy_id != 0;
5050 }
5051
5052 struct frame_id
5053 gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
5054 {
5055 gdb_assert (gdbarch != NULL);
5056 if (gdbarch->unwind_dummy_id == 0)
5057 internal_error (__FILE__, __LINE__,
5058 "gdbarch: gdbarch_unwind_dummy_id invalid");
5059 if (gdbarch_debug >= 2)
5060 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
5061 return gdbarch->unwind_dummy_id (gdbarch, info);
5062 }
5063
5064 void
5065 set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
5066 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
5067 {
5068 gdbarch->unwind_dummy_id = unwind_dummy_id;
5069 }
5070
5071 int
5072 gdbarch_parm_boundary (struct gdbarch *gdbarch)
5073 {
5074 gdb_assert (gdbarch != NULL);
5075 if (gdbarch_debug >= 2)
5076 fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n");
5077 return gdbarch->parm_boundary;
5078 }
5079
5080 void
5081 set_gdbarch_parm_boundary (struct gdbarch *gdbarch,
5082 int parm_boundary)
5083 {
5084 gdbarch->parm_boundary = parm_boundary;
5085 }
5086
5087 const struct floatformat *
5088 gdbarch_float_format (struct gdbarch *gdbarch)
5089 {
5090 gdb_assert (gdbarch != NULL);
5091 if (gdbarch_debug >= 2)
5092 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
5093 return gdbarch->float_format;
5094 }
5095
5096 void
5097 set_gdbarch_float_format (struct gdbarch *gdbarch,
5098 const struct floatformat * float_format)
5099 {
5100 gdbarch->float_format = float_format;
5101 }
5102
5103 const struct floatformat *
5104 gdbarch_double_format (struct gdbarch *gdbarch)
5105 {
5106 gdb_assert (gdbarch != NULL);
5107 if (gdbarch_debug >= 2)
5108 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
5109 return gdbarch->double_format;
5110 }
5111
5112 void
5113 set_gdbarch_double_format (struct gdbarch *gdbarch,
5114 const struct floatformat * double_format)
5115 {
5116 gdbarch->double_format = double_format;
5117 }
5118
5119 const struct floatformat *
5120 gdbarch_long_double_format (struct gdbarch *gdbarch)
5121 {
5122 gdb_assert (gdbarch != NULL);
5123 if (gdbarch_debug >= 2)
5124 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
5125 return gdbarch->long_double_format;
5126 }
5127
5128 void
5129 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
5130 const struct floatformat * long_double_format)
5131 {
5132 gdbarch->long_double_format = long_double_format;
5133 }
5134
5135 CORE_ADDR
5136 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
5137 {
5138 gdb_assert (gdbarch != NULL);
5139 if (gdbarch->convert_from_func_ptr_addr == 0)
5140 internal_error (__FILE__, __LINE__,
5141 "gdbarch: gdbarch_convert_from_func_ptr_addr invalid");
5142 if (gdbarch_debug >= 2)
5143 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
5144 return gdbarch->convert_from_func_ptr_addr (addr);
5145 }
5146
5147 void
5148 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
5149 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
5150 {
5151 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
5152 }
5153
5154 CORE_ADDR
5155 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
5156 {
5157 gdb_assert (gdbarch != NULL);
5158 if (gdbarch->addr_bits_remove == 0)
5159 internal_error (__FILE__, __LINE__,
5160 "gdbarch: gdbarch_addr_bits_remove invalid");
5161 if (gdbarch_debug >= 2)
5162 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
5163 return gdbarch->addr_bits_remove (addr);
5164 }
5165
5166 void
5167 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
5168 gdbarch_addr_bits_remove_ftype addr_bits_remove)
5169 {
5170 gdbarch->addr_bits_remove = addr_bits_remove;
5171 }
5172
5173 CORE_ADDR
5174 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
5175 {
5176 gdb_assert (gdbarch != NULL);
5177 if (gdbarch->smash_text_address == 0)
5178 internal_error (__FILE__, __LINE__,
5179 "gdbarch: gdbarch_smash_text_address invalid");
5180 if (gdbarch_debug >= 2)
5181 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
5182 return gdbarch->smash_text_address (addr);
5183 }
5184
5185 void
5186 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
5187 gdbarch_smash_text_address_ftype smash_text_address)
5188 {
5189 gdbarch->smash_text_address = smash_text_address;
5190 }
5191
5192 int
5193 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
5194 {
5195 gdb_assert (gdbarch != NULL);
5196 return gdbarch->software_single_step != 0;
5197 }
5198
5199 void
5200 gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
5201 {
5202 gdb_assert (gdbarch != NULL);
5203 if (gdbarch->software_single_step == 0)
5204 internal_error (__FILE__, __LINE__,
5205 "gdbarch: gdbarch_software_single_step invalid");
5206 if (gdbarch_debug >= 2)
5207 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
5208 gdbarch->software_single_step (sig, insert_breakpoints_p);
5209 }
5210
5211 void
5212 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
5213 gdbarch_software_single_step_ftype software_single_step)
5214 {
5215 gdbarch->software_single_step = software_single_step;
5216 }
5217
5218 int
5219 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info)
5220 {
5221 gdb_assert (gdbarch != NULL);
5222 if (gdbarch->print_insn == 0)
5223 internal_error (__FILE__, __LINE__,
5224 "gdbarch: gdbarch_print_insn invalid");
5225 if (gdbarch_debug >= 2)
5226 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
5227 return gdbarch->print_insn (vma, info);
5228 }
5229
5230 void
5231 set_gdbarch_print_insn (struct gdbarch *gdbarch,
5232 gdbarch_print_insn_ftype print_insn)
5233 {
5234 gdbarch->print_insn = print_insn;
5235 }
5236
5237 CORE_ADDR
5238 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
5239 {
5240 gdb_assert (gdbarch != NULL);
5241 if (gdbarch->skip_trampoline_code == 0)
5242 internal_error (__FILE__, __LINE__,
5243 "gdbarch: gdbarch_skip_trampoline_code invalid");
5244 if (gdbarch_debug >= 2)
5245 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
5246 return gdbarch->skip_trampoline_code (pc);
5247 }
5248
5249 void
5250 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
5251 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
5252 {
5253 gdbarch->skip_trampoline_code = skip_trampoline_code;
5254 }
5255
5256 int
5257 gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
5258 {
5259 gdb_assert (gdbarch != NULL);
5260 if (gdbarch->in_solib_call_trampoline == 0)
5261 internal_error (__FILE__, __LINE__,
5262 "gdbarch: gdbarch_in_solib_call_trampoline invalid");
5263 if (gdbarch_debug >= 2)
5264 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_call_trampoline called\n");
5265 return gdbarch->in_solib_call_trampoline (pc, name);
5266 }
5267
5268 void
5269 set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
5270 gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline)
5271 {
5272 gdbarch->in_solib_call_trampoline = in_solib_call_trampoline;
5273 }
5274
5275 int
5276 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
5277 {
5278 gdb_assert (gdbarch != NULL);
5279 if (gdbarch->in_solib_return_trampoline == 0)
5280 internal_error (__FILE__, __LINE__,
5281 "gdbarch: gdbarch_in_solib_return_trampoline invalid");
5282 if (gdbarch_debug >= 2)
5283 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
5284 return gdbarch->in_solib_return_trampoline (pc, name);
5285 }
5286
5287 void
5288 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
5289 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
5290 {
5291 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
5292 }
5293
5294 int
5295 gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
5296 {
5297 gdb_assert (gdbarch != NULL);
5298 if (gdbarch->pc_in_sigtramp == 0)
5299 internal_error (__FILE__, __LINE__,
5300 "gdbarch: gdbarch_pc_in_sigtramp invalid");
5301 if (gdbarch_debug >= 2)
5302 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_sigtramp called\n");
5303 return gdbarch->pc_in_sigtramp (pc, name);
5304 }
5305
5306 void
5307 set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch,
5308 gdbarch_pc_in_sigtramp_ftype pc_in_sigtramp)
5309 {
5310 gdbarch->pc_in_sigtramp = pc_in_sigtramp;
5311 }
5312
5313 int
5314 gdbarch_sigtramp_start_p (struct gdbarch *gdbarch)
5315 {
5316 gdb_assert (gdbarch != NULL);
5317 return gdbarch->sigtramp_start != 0;
5318 }
5319
5320 CORE_ADDR
5321 gdbarch_sigtramp_start (struct gdbarch *gdbarch, CORE_ADDR pc)
5322 {
5323 gdb_assert (gdbarch != NULL);
5324 if (gdbarch->sigtramp_start == 0)
5325 internal_error (__FILE__, __LINE__,
5326 "gdbarch: gdbarch_sigtramp_start invalid");
5327 if (gdbarch_debug >= 2)
5328 fprintf_unfiltered (gdb_stdlog, "gdbarch_sigtramp_start called\n");
5329 return gdbarch->sigtramp_start (pc);
5330 }
5331
5332 void
5333 set_gdbarch_sigtramp_start (struct gdbarch *gdbarch,
5334 gdbarch_sigtramp_start_ftype sigtramp_start)
5335 {
5336 gdbarch->sigtramp_start = sigtramp_start;
5337 }
5338
5339 int
5340 gdbarch_sigtramp_end_p (struct gdbarch *gdbarch)
5341 {
5342 gdb_assert (gdbarch != NULL);
5343 return gdbarch->sigtramp_end != 0;
5344 }
5345
5346 CORE_ADDR
5347 gdbarch_sigtramp_end (struct gdbarch *gdbarch, CORE_ADDR pc)
5348 {
5349 gdb_assert (gdbarch != NULL);
5350 if (gdbarch->sigtramp_end == 0)
5351 internal_error (__FILE__, __LINE__,
5352 "gdbarch: gdbarch_sigtramp_end invalid");
5353 if (gdbarch_debug >= 2)
5354 fprintf_unfiltered (gdb_stdlog, "gdbarch_sigtramp_end called\n");
5355 return gdbarch->sigtramp_end (pc);
5356 }
5357
5358 void
5359 set_gdbarch_sigtramp_end (struct gdbarch *gdbarch,
5360 gdbarch_sigtramp_end_ftype sigtramp_end)
5361 {
5362 gdbarch->sigtramp_end = sigtramp_end;
5363 }
5364
5365 int
5366 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
5367 {
5368 gdb_assert (gdbarch != NULL);
5369 if (gdbarch->in_function_epilogue_p == 0)
5370 internal_error (__FILE__, __LINE__,
5371 "gdbarch: gdbarch_in_function_epilogue_p invalid");
5372 if (gdbarch_debug >= 2)
5373 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
5374 return gdbarch->in_function_epilogue_p (gdbarch, addr);
5375 }
5376
5377 void
5378 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
5379 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
5380 {
5381 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
5382 }
5383
5384 char *
5385 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
5386 {
5387 gdb_assert (gdbarch != NULL);
5388 if (gdbarch->construct_inferior_arguments == 0)
5389 internal_error (__FILE__, __LINE__,
5390 "gdbarch: gdbarch_construct_inferior_arguments invalid");
5391 if (gdbarch_debug >= 2)
5392 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
5393 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
5394 }
5395
5396 void
5397 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
5398 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
5399 {
5400 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
5401 }
5402
5403 int
5404 gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch)
5405 {
5406 gdb_assert (gdbarch != NULL);
5407 return gdbarch->dwarf2_build_frame_info != 0;
5408 }
5409
5410 void
5411 gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile)
5412 {
5413 gdb_assert (gdbarch != NULL);
5414 if (gdbarch->dwarf2_build_frame_info == 0)
5415 internal_error (__FILE__, __LINE__,
5416 "gdbarch: gdbarch_dwarf2_build_frame_info invalid");
5417 if (gdbarch_debug >= 2)
5418 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_build_frame_info called\n");
5419 gdbarch->dwarf2_build_frame_info (objfile);
5420 }
5421
5422 void
5423 set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch,
5424 gdbarch_dwarf2_build_frame_info_ftype dwarf2_build_frame_info)
5425 {
5426 gdbarch->dwarf2_build_frame_info = dwarf2_build_frame_info;
5427 }
5428
5429 void
5430 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
5431 {
5432 gdb_assert (gdbarch != NULL);
5433 if (gdbarch->elf_make_msymbol_special == 0)
5434 internal_error (__FILE__, __LINE__,
5435 "gdbarch: gdbarch_elf_make_msymbol_special invalid");
5436 if (gdbarch_debug >= 2)
5437 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
5438 gdbarch->elf_make_msymbol_special (sym, msym);
5439 }
5440
5441 void
5442 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
5443 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
5444 {
5445 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
5446 }
5447
5448 void
5449 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
5450 {
5451 gdb_assert (gdbarch != NULL);
5452 if (gdbarch->coff_make_msymbol_special == 0)
5453 internal_error (__FILE__, __LINE__,
5454 "gdbarch: gdbarch_coff_make_msymbol_special invalid");
5455 if (gdbarch_debug >= 2)
5456 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
5457 gdbarch->coff_make_msymbol_special (val, msym);
5458 }
5459
5460 void
5461 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
5462 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
5463 {
5464 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
5465 }
5466
5467 const char *
5468 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
5469 {
5470 gdb_assert (gdbarch != NULL);
5471 /* Skip verify of name_of_malloc, invalid_p == 0 */
5472 if (gdbarch_debug >= 2)
5473 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
5474 return gdbarch->name_of_malloc;
5475 }
5476
5477 void
5478 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
5479 const char * name_of_malloc)
5480 {
5481 gdbarch->name_of_malloc = name_of_malloc;
5482 }
5483
5484 int
5485 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
5486 {
5487 gdb_assert (gdbarch != NULL);
5488 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
5489 if (gdbarch_debug >= 2)
5490 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
5491 return gdbarch->cannot_step_breakpoint;
5492 }
5493
5494 void
5495 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
5496 int cannot_step_breakpoint)
5497 {
5498 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
5499 }
5500
5501 int
5502 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
5503 {
5504 gdb_assert (gdbarch != NULL);
5505 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
5506 if (gdbarch_debug >= 2)
5507 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
5508 return gdbarch->have_nonsteppable_watchpoint;
5509 }
5510
5511 void
5512 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
5513 int have_nonsteppable_watchpoint)
5514 {
5515 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
5516 }
5517
5518 int
5519 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
5520 {
5521 gdb_assert (gdbarch != NULL);
5522 return gdbarch->address_class_type_flags != 0;
5523 }
5524
5525 int
5526 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
5527 {
5528 gdb_assert (gdbarch != NULL);
5529 if (gdbarch->address_class_type_flags == 0)
5530 internal_error (__FILE__, __LINE__,
5531 "gdbarch: gdbarch_address_class_type_flags invalid");
5532 if (gdbarch_debug >= 2)
5533 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
5534 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
5535 }
5536
5537 void
5538 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
5539 gdbarch_address_class_type_flags_ftype address_class_type_flags)
5540 {
5541 gdbarch->address_class_type_flags = address_class_type_flags;
5542 }
5543
5544 int
5545 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
5546 {
5547 gdb_assert (gdbarch != NULL);
5548 return gdbarch->address_class_type_flags_to_name != 0;
5549 }
5550
5551 const char *
5552 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
5553 {
5554 gdb_assert (gdbarch != NULL);
5555 if (gdbarch->address_class_type_flags_to_name == 0)
5556 internal_error (__FILE__, __LINE__,
5557 "gdbarch: gdbarch_address_class_type_flags_to_name invalid");
5558 if (gdbarch_debug >= 2)
5559 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
5560 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
5561 }
5562
5563 void
5564 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
5565 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
5566 {
5567 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
5568 }
5569
5570 int
5571 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
5572 {
5573 gdb_assert (gdbarch != NULL);
5574 return gdbarch->address_class_name_to_type_flags != 0;
5575 }
5576
5577 int
5578 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
5579 {
5580 gdb_assert (gdbarch != NULL);
5581 if (gdbarch->address_class_name_to_type_flags == 0)
5582 internal_error (__FILE__, __LINE__,
5583 "gdbarch: gdbarch_address_class_name_to_type_flags invalid");
5584 if (gdbarch_debug >= 2)
5585 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
5586 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
5587 }
5588
5589 void
5590 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
5591 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
5592 {
5593 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
5594 }
5595
5596 int
5597 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
5598 {
5599 gdb_assert (gdbarch != NULL);
5600 if (gdbarch->register_reggroup_p == 0)
5601 internal_error (__FILE__, __LINE__,
5602 "gdbarch: gdbarch_register_reggroup_p invalid");
5603 if (gdbarch_debug >= 2)
5604 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
5605 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
5606 }
5607
5608 void
5609 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
5610 gdbarch_register_reggroup_p_ftype register_reggroup_p)
5611 {
5612 gdbarch->register_reggroup_p = register_reggroup_p;
5613 }
5614
5615
5616 /* Keep a registry of per-architecture data-pointers required by GDB
5617 modules. */
5618
5619 struct gdbarch_data
5620 {
5621 unsigned index;
5622 int init_p;
5623 gdbarch_data_init_ftype *init;
5624 gdbarch_data_free_ftype *free;
5625 };
5626
5627 struct gdbarch_data_registration
5628 {
5629 struct gdbarch_data *data;
5630 struct gdbarch_data_registration *next;
5631 };
5632
5633 struct gdbarch_data_registry
5634 {
5635 unsigned nr;
5636 struct gdbarch_data_registration *registrations;
5637 };
5638
5639 struct gdbarch_data_registry gdbarch_data_registry =
5640 {
5641 0, NULL,
5642 };
5643
5644 struct gdbarch_data *
5645 register_gdbarch_data (gdbarch_data_init_ftype *init,
5646 gdbarch_data_free_ftype *free)
5647 {
5648 struct gdbarch_data_registration **curr;
5649 /* Append the new registraration. */
5650 for (curr = &gdbarch_data_registry.registrations;
5651 (*curr) != NULL;
5652 curr = &(*curr)->next);
5653 (*curr) = XMALLOC (struct gdbarch_data_registration);
5654 (*curr)->next = NULL;
5655 (*curr)->data = XMALLOC (struct gdbarch_data);
5656 (*curr)->data->index = gdbarch_data_registry.nr++;
5657 (*curr)->data->init = init;
5658 (*curr)->data->init_p = 1;
5659 (*curr)->data->free = free;
5660 return (*curr)->data;
5661 }
5662
5663
5664 /* Create/delete the gdbarch data vector. */
5665
5666 static void
5667 alloc_gdbarch_data (struct gdbarch *gdbarch)
5668 {
5669 gdb_assert (gdbarch->data == NULL);
5670 gdbarch->nr_data = gdbarch_data_registry.nr;
5671 gdbarch->data = xcalloc (gdbarch->nr_data, sizeof (void*));
5672 }
5673
5674 static void
5675 free_gdbarch_data (struct gdbarch *gdbarch)
5676 {
5677 struct gdbarch_data_registration *rego;
5678 gdb_assert (gdbarch->data != NULL);
5679 for (rego = gdbarch_data_registry.registrations;
5680 rego != NULL;
5681 rego = rego->next)
5682 {
5683 struct gdbarch_data *data = rego->data;
5684 gdb_assert (data->index < gdbarch->nr_data);
5685 if (data->free != NULL && gdbarch->data[data->index] != NULL)
5686 {
5687 data->free (gdbarch, gdbarch->data[data->index]);
5688 gdbarch->data[data->index] = NULL;
5689 }
5690 }
5691 xfree (gdbarch->data);
5692 gdbarch->data = NULL;
5693 }
5694
5695
5696 /* Initialize the current value of the specified per-architecture
5697 data-pointer. */
5698
5699 void
5700 set_gdbarch_data (struct gdbarch *gdbarch,
5701 struct gdbarch_data *data,
5702 void *pointer)
5703 {
5704 gdb_assert (data->index < gdbarch->nr_data);
5705 if (gdbarch->data[data->index] != NULL)
5706 {
5707 gdb_assert (data->free != NULL);
5708 data->free (gdbarch, gdbarch->data[data->index]);
5709 }
5710 gdbarch->data[data->index] = pointer;
5711 }
5712
5713 /* Return the current value of the specified per-architecture
5714 data-pointer. */
5715
5716 void *
5717 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
5718 {
5719 gdb_assert (data->index < gdbarch->nr_data);
5720 /* The data-pointer isn't initialized, call init() to get a value but
5721 only if the architecture initializaiton has completed. Otherwise
5722 punt - hope that the caller knows what they are doing. */
5723 if (gdbarch->data[data->index] == NULL
5724 && gdbarch->initialized_p)
5725 {
5726 /* Be careful to detect an initialization cycle. */
5727 gdb_assert (data->init_p);
5728 data->init_p = 0;
5729 gdb_assert (data->init != NULL);
5730 gdbarch->data[data->index] = data->init (gdbarch);
5731 data->init_p = 1;
5732 gdb_assert (gdbarch->data[data->index] != NULL);
5733 }
5734 return gdbarch->data[data->index];
5735 }
5736
5737
5738
5739 /* Keep a registry of swapped data required by GDB modules. */
5740
5741 struct gdbarch_swap
5742 {
5743 void *swap;
5744 struct gdbarch_swap_registration *source;
5745 struct gdbarch_swap *next;
5746 };
5747
5748 struct gdbarch_swap_registration
5749 {
5750 void *data;
5751 unsigned long sizeof_data;
5752 gdbarch_swap_ftype *init;
5753 struct gdbarch_swap_registration *next;
5754 };
5755
5756 struct gdbarch_swap_registry
5757 {
5758 int nr;
5759 struct gdbarch_swap_registration *registrations;
5760 };
5761
5762 struct gdbarch_swap_registry gdbarch_swap_registry =
5763 {
5764 0, NULL,
5765 };
5766
5767 void
5768 register_gdbarch_swap (void *data,
5769 unsigned long sizeof_data,
5770 gdbarch_swap_ftype *init)
5771 {
5772 struct gdbarch_swap_registration **rego;
5773 for (rego = &gdbarch_swap_registry.registrations;
5774 (*rego) != NULL;
5775 rego = &(*rego)->next);
5776 (*rego) = XMALLOC (struct gdbarch_swap_registration);
5777 (*rego)->next = NULL;
5778 (*rego)->init = init;
5779 (*rego)->data = data;
5780 (*rego)->sizeof_data = sizeof_data;
5781 }
5782
5783 static void
5784 clear_gdbarch_swap (struct gdbarch *gdbarch)
5785 {
5786 struct gdbarch_swap *curr;
5787 for (curr = gdbarch->swap;
5788 curr != NULL;
5789 curr = curr->next)
5790 {
5791 memset (curr->source->data, 0, curr->source->sizeof_data);
5792 }
5793 }
5794
5795 static void
5796 init_gdbarch_swap (struct gdbarch *gdbarch)
5797 {
5798 struct gdbarch_swap_registration *rego;
5799 struct gdbarch_swap **curr = &gdbarch->swap;
5800 for (rego = gdbarch_swap_registry.registrations;
5801 rego != NULL;
5802 rego = rego->next)
5803 {
5804 if (rego->data != NULL)
5805 {
5806 (*curr) = XMALLOC (struct gdbarch_swap);
5807 (*curr)->source = rego;
5808 (*curr)->swap = xmalloc (rego->sizeof_data);
5809 (*curr)->next = NULL;
5810 curr = &(*curr)->next;
5811 }
5812 if (rego->init != NULL)
5813 rego->init ();
5814 }
5815 }
5816
5817 static void
5818 swapout_gdbarch_swap (struct gdbarch *gdbarch)
5819 {
5820 struct gdbarch_swap *curr;
5821 for (curr = gdbarch->swap;
5822 curr != NULL;
5823 curr = curr->next)
5824 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
5825 }
5826
5827 static void
5828 swapin_gdbarch_swap (struct gdbarch *gdbarch)
5829 {
5830 struct gdbarch_swap *curr;
5831 for (curr = gdbarch->swap;
5832 curr != NULL;
5833 curr = curr->next)
5834 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
5835 }
5836
5837
5838 /* Keep a registry of the architectures known by GDB. */
5839
5840 struct gdbarch_registration
5841 {
5842 enum bfd_architecture bfd_architecture;
5843 gdbarch_init_ftype *init;
5844 gdbarch_dump_tdep_ftype *dump_tdep;
5845 struct gdbarch_list *arches;
5846 struct gdbarch_registration *next;
5847 };
5848
5849 static struct gdbarch_registration *gdbarch_registry = NULL;
5850
5851 static void
5852 append_name (const char ***buf, int *nr, const char *name)
5853 {
5854 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
5855 (*buf)[*nr] = name;
5856 *nr += 1;
5857 }
5858
5859 const char **
5860 gdbarch_printable_names (void)
5861 {
5862 if (GDB_MULTI_ARCH)
5863 {
5864 /* Accumulate a list of names based on the registed list of
5865 architectures. */
5866 enum bfd_architecture a;
5867 int nr_arches = 0;
5868 const char **arches = NULL;
5869 struct gdbarch_registration *rego;
5870 for (rego = gdbarch_registry;
5871 rego != NULL;
5872 rego = rego->next)
5873 {
5874 const struct bfd_arch_info *ap;
5875 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
5876 if (ap == NULL)
5877 internal_error (__FILE__, __LINE__,
5878 "gdbarch_architecture_names: multi-arch unknown");
5879 do
5880 {
5881 append_name (&arches, &nr_arches, ap->printable_name);
5882 ap = ap->next;
5883 }
5884 while (ap != NULL);
5885 }
5886 append_name (&arches, &nr_arches, NULL);
5887 return arches;
5888 }
5889 else
5890 /* Just return all the architectures that BFD knows. Assume that
5891 the legacy architecture framework supports them. */
5892 return bfd_arch_list ();
5893 }
5894
5895
5896 void
5897 gdbarch_register (enum bfd_architecture bfd_architecture,
5898 gdbarch_init_ftype *init,
5899 gdbarch_dump_tdep_ftype *dump_tdep)
5900 {
5901 struct gdbarch_registration **curr;
5902 const struct bfd_arch_info *bfd_arch_info;
5903 /* Check that BFD recognizes this architecture */
5904 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
5905 if (bfd_arch_info == NULL)
5906 {
5907 internal_error (__FILE__, __LINE__,
5908 "gdbarch: Attempt to register unknown architecture (%d)",
5909 bfd_architecture);
5910 }
5911 /* Check that we haven't seen this architecture before */
5912 for (curr = &gdbarch_registry;
5913 (*curr) != NULL;
5914 curr = &(*curr)->next)
5915 {
5916 if (bfd_architecture == (*curr)->bfd_architecture)
5917 internal_error (__FILE__, __LINE__,
5918 "gdbarch: Duplicate registraration of architecture (%s)",
5919 bfd_arch_info->printable_name);
5920 }
5921 /* log it */
5922 if (gdbarch_debug)
5923 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
5924 bfd_arch_info->printable_name,
5925 (long) init);
5926 /* Append it */
5927 (*curr) = XMALLOC (struct gdbarch_registration);
5928 (*curr)->bfd_architecture = bfd_architecture;
5929 (*curr)->init = init;
5930 (*curr)->dump_tdep = dump_tdep;
5931 (*curr)->arches = NULL;
5932 (*curr)->next = NULL;
5933 /* When non- multi-arch, install whatever target dump routine we've
5934 been provided - hopefully that routine has been written correctly
5935 and works regardless of multi-arch. */
5936 if (!GDB_MULTI_ARCH && dump_tdep != NULL
5937 && startup_gdbarch.dump_tdep == NULL)
5938 startup_gdbarch.dump_tdep = dump_tdep;
5939 }
5940
5941 void
5942 register_gdbarch_init (enum bfd_architecture bfd_architecture,
5943 gdbarch_init_ftype *init)
5944 {
5945 gdbarch_register (bfd_architecture, init, NULL);
5946 }
5947
5948
5949 /* Look for an architecture using gdbarch_info. Base search on only
5950 BFD_ARCH_INFO and BYTE_ORDER. */
5951
5952 struct gdbarch_list *
5953 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
5954 const struct gdbarch_info *info)
5955 {
5956 for (; arches != NULL; arches = arches->next)
5957 {
5958 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
5959 continue;
5960 if (info->byte_order != arches->gdbarch->byte_order)
5961 continue;
5962 if (info->osabi != arches->gdbarch->osabi)
5963 continue;
5964 return arches;
5965 }
5966 return NULL;
5967 }
5968
5969
5970 /* Update the current architecture. Return ZERO if the update request
5971 failed. */
5972
5973 int
5974 gdbarch_update_p (struct gdbarch_info info)
5975 {
5976 struct gdbarch *new_gdbarch;
5977 struct gdbarch *old_gdbarch;
5978 struct gdbarch_registration *rego;
5979
5980 /* Fill in missing parts of the INFO struct using a number of
5981 sources: ``set ...''; INFOabfd supplied; existing target. */
5982
5983 /* ``(gdb) set architecture ...'' */
5984 if (info.bfd_arch_info == NULL
5985 && !TARGET_ARCHITECTURE_AUTO)
5986 info.bfd_arch_info = TARGET_ARCHITECTURE;
5987 if (info.bfd_arch_info == NULL
5988 && info.abfd != NULL
5989 && bfd_get_arch (info.abfd) != bfd_arch_unknown
5990 && bfd_get_arch (info.abfd) != bfd_arch_obscure)
5991 info.bfd_arch_info = bfd_get_arch_info (info.abfd);
5992 if (info.bfd_arch_info == NULL)
5993 info.bfd_arch_info = TARGET_ARCHITECTURE;
5994
5995 /* ``(gdb) set byte-order ...'' */
5996 if (info.byte_order == BFD_ENDIAN_UNKNOWN
5997 && !TARGET_BYTE_ORDER_AUTO)
5998 info.byte_order = TARGET_BYTE_ORDER;
5999 /* From the INFO struct. */
6000 if (info.byte_order == BFD_ENDIAN_UNKNOWN
6001 && info.abfd != NULL)
6002 info.byte_order = (bfd_big_endian (info.abfd) ? BFD_ENDIAN_BIG
6003 : bfd_little_endian (info.abfd) ? BFD_ENDIAN_LITTLE
6004 : BFD_ENDIAN_UNKNOWN);
6005 /* From the current target. */
6006 if (info.byte_order == BFD_ENDIAN_UNKNOWN)
6007 info.byte_order = TARGET_BYTE_ORDER;
6008
6009 /* ``(gdb) set osabi ...'' is handled by gdbarch_lookup_osabi. */
6010 if (info.osabi == GDB_OSABI_UNINITIALIZED)
6011 info.osabi = gdbarch_lookup_osabi (info.abfd);
6012 if (info.osabi == GDB_OSABI_UNINITIALIZED)
6013 info.osabi = current_gdbarch->osabi;
6014
6015 /* Must have found some sort of architecture. */
6016 gdb_assert (info.bfd_arch_info != NULL);
6017
6018 if (gdbarch_debug)
6019 {
6020 fprintf_unfiltered (gdb_stdlog,
6021 "gdbarch_update: info.bfd_arch_info %s\n",
6022 (info.bfd_arch_info != NULL
6023 ? info.bfd_arch_info->printable_name
6024 : "(null)"));
6025 fprintf_unfiltered (gdb_stdlog,
6026 "gdbarch_update: info.byte_order %d (%s)\n",
6027 info.byte_order,
6028 (info.byte_order == BFD_ENDIAN_BIG ? "big"
6029 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
6030 : "default"));
6031 fprintf_unfiltered (gdb_stdlog,
6032 "gdbarch_update: info.osabi %d (%s)\n",
6033 info.osabi, gdbarch_osabi_name (info.osabi));
6034 fprintf_unfiltered (gdb_stdlog,
6035 "gdbarch_update: info.abfd 0x%lx\n",
6036 (long) info.abfd);
6037 fprintf_unfiltered (gdb_stdlog,
6038 "gdbarch_update: info.tdep_info 0x%lx\n",
6039 (long) info.tdep_info);
6040 }
6041
6042 /* Find the target that knows about this architecture. */
6043 for (rego = gdbarch_registry;
6044 rego != NULL;
6045 rego = rego->next)
6046 if (rego->bfd_architecture == info.bfd_arch_info->arch)
6047 break;
6048 if (rego == NULL)
6049 {
6050 if (gdbarch_debug)
6051 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n");
6052 return 0;
6053 }
6054
6055 /* Swap the data belonging to the old target out setting the
6056 installed data to zero. This stops the ->init() function trying
6057 to refer to the previous architecture's global data structures. */
6058 swapout_gdbarch_swap (current_gdbarch);
6059 clear_gdbarch_swap (current_gdbarch);
6060
6061 /* Save the previously selected architecture, setting the global to
6062 NULL. This stops ->init() trying to use the previous
6063 architecture's configuration. The previous architecture may not
6064 even be of the same architecture family. The most recent
6065 architecture of the same family is found at the head of the
6066 rego->arches list. */
6067 old_gdbarch = current_gdbarch;
6068 current_gdbarch = NULL;
6069
6070 /* Ask the target for a replacement architecture. */
6071 new_gdbarch = rego->init (info, rego->arches);
6072
6073 /* Did the target like it? No. Reject the change and revert to the
6074 old architecture. */
6075 if (new_gdbarch == NULL)
6076 {
6077 if (gdbarch_debug)
6078 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n");
6079 swapin_gdbarch_swap (old_gdbarch);
6080 current_gdbarch = old_gdbarch;
6081 return 0;
6082 }
6083
6084 /* Did the architecture change? No. Oops, put the old architecture
6085 back. */
6086 if (old_gdbarch == new_gdbarch)
6087 {
6088 if (gdbarch_debug)
6089 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
6090 (long) new_gdbarch,
6091 new_gdbarch->bfd_arch_info->printable_name);
6092 swapin_gdbarch_swap (old_gdbarch);
6093 current_gdbarch = old_gdbarch;
6094 return 1;
6095 }
6096
6097 /* Is this a pre-existing architecture? Yes. Move it to the front
6098 of the list of architectures (keeping the list sorted Most
6099 Recently Used) and then copy it in. */
6100 {
6101 struct gdbarch_list **list;
6102 for (list = &rego->arches;
6103 (*list) != NULL;
6104 list = &(*list)->next)
6105 {
6106 if ((*list)->gdbarch == new_gdbarch)
6107 {
6108 struct gdbarch_list *this;
6109 if (gdbarch_debug)
6110 fprintf_unfiltered (gdb_stdlog,
6111 "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
6112 (long) new_gdbarch,
6113 new_gdbarch->bfd_arch_info->printable_name);
6114 /* Unlink this. */
6115 this = (*list);
6116 (*list) = this->next;
6117 /* Insert in the front. */
6118 this->next = rego->arches;
6119 rego->arches = this;
6120 /* Copy the new architecture in. */
6121 current_gdbarch = new_gdbarch;
6122 swapin_gdbarch_swap (new_gdbarch);
6123 architecture_changed_event ();
6124 return 1;
6125 }
6126 }
6127 }
6128
6129 /* Prepend this new architecture to the architecture list (keep the
6130 list sorted Most Recently Used). */
6131 {
6132 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
6133 this->next = rego->arches;
6134 this->gdbarch = new_gdbarch;
6135 rego->arches = this;
6136 }
6137
6138 /* Switch to this new architecture marking it initialized. */
6139 current_gdbarch = new_gdbarch;
6140 current_gdbarch->initialized_p = 1;
6141 if (gdbarch_debug)
6142 {
6143 fprintf_unfiltered (gdb_stdlog,
6144 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
6145 (long) new_gdbarch,
6146 new_gdbarch->bfd_arch_info->printable_name);
6147 }
6148
6149 /* Check that the newly installed architecture is valid. Plug in
6150 any post init values. */
6151 new_gdbarch->dump_tdep = rego->dump_tdep;
6152 verify_gdbarch (new_gdbarch);
6153
6154 /* Initialize the per-architecture memory (swap) areas.
6155 CURRENT_GDBARCH must be update before these modules are
6156 called. */
6157 init_gdbarch_swap (new_gdbarch);
6158
6159 /* Initialize the per-architecture data. CURRENT_GDBARCH
6160 must be updated before these modules are called. */
6161 architecture_changed_event ();
6162
6163 if (gdbarch_debug)
6164 gdbarch_dump (current_gdbarch, gdb_stdlog);
6165
6166 return 1;
6167 }
6168
6169
6170 /* Disassembler */
6171
6172 /* Pointer to the target-dependent disassembly function. */
6173 int (*tm_print_insn) (bfd_vma, disassemble_info *);
6174 disassemble_info tm_print_insn_info;
6175
6176
6177 extern void _initialize_gdbarch (void);
6178
6179 void
6180 _initialize_gdbarch (void)
6181 {
6182 struct cmd_list_element *c;
6183
6184 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
6185 tm_print_insn_info.flavour = bfd_target_unknown_flavour;
6186 tm_print_insn_info.read_memory_func = dis_asm_read_memory;
6187 tm_print_insn_info.memory_error_func = dis_asm_memory_error;
6188 tm_print_insn_info.print_address_func = dis_asm_print_address;
6189
6190 add_show_from_set (add_set_cmd ("arch",
6191 class_maintenance,
6192 var_zinteger,
6193 (char *)&gdbarch_debug,
6194 "Set architecture debugging.\n\
6195 When non-zero, architecture debugging is enabled.", &setdebuglist),
6196 &showdebuglist);
6197 c = add_set_cmd ("archdebug",
6198 class_maintenance,
6199 var_zinteger,
6200 (char *)&gdbarch_debug,
6201 "Set architecture debugging.\n\
6202 When non-zero, architecture debugging is enabled.", &setlist);
6203
6204 deprecate_cmd (c, "set debug arch");
6205 deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch");
6206 }
This page took 0.162688 seconds and 4 git commands to generate.