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