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