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