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