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