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