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