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