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