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