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