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