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