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