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