6c8cf664f9b9626708b10f70a369c8547f1dd43b
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
2
3 /* Dynamic architecture support for GDB, the GNU debugger.
4 Copyright 1998, 1999, 2000, 2001 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 #endif
59 #include "symcat.h"
60
61 #include "floatformat.h"
62
63 #include "gdb_assert.h"
64 #include "gdb-events.h"
65
66 /* Static function declarations */
67
68 static void verify_gdbarch (struct gdbarch *gdbarch);
69 static void alloc_gdbarch_data (struct gdbarch *);
70 static void init_gdbarch_data (struct gdbarch *);
71 static void free_gdbarch_data (struct gdbarch *);
72 static void init_gdbarch_swap (struct gdbarch *);
73 static void swapout_gdbarch_swap (struct gdbarch *);
74 static void swapin_gdbarch_swap (struct gdbarch *);
75
76 /* Convenience macro for allocting typesafe memory. */
77
78 #ifndef XMALLOC
79 #define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
80 #endif
81
82
83 /* Non-zero if we want to trace architecture code. */
84
85 #ifndef GDBARCH_DEBUG
86 #define GDBARCH_DEBUG 0
87 #endif
88 int gdbarch_debug = GDBARCH_DEBUG;
89
90
91 /* Maintain the struct gdbarch object */
92
93 struct gdbarch
94 {
95 /* basic architectural information */
96 const struct bfd_arch_info * bfd_arch_info;
97 int byte_order;
98
99 /* target specific vector. */
100 struct gdbarch_tdep *tdep;
101 gdbarch_dump_tdep_ftype *dump_tdep;
102
103 /* per-architecture data-pointers */
104 unsigned nr_data;
105 void **data;
106
107 /* per-architecture swap-regions */
108 struct gdbarch_swap *swap;
109
110 /* Multi-arch values.
111
112 When extending this structure you must:
113
114 Add the field below.
115
116 Declare set/get functions and define the corresponding
117 macro in gdbarch.h.
118
119 gdbarch_alloc(): If zero/NULL is not a suitable default,
120 initialize the new field.
121
122 verify_gdbarch(): Confirm that the target updated the field
123 correctly.
124
125 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
126 field is dumped out
127
128 ``startup_gdbarch()'': Append an initial value to the static
129 variable (base values on the host's c-type system).
130
131 get_gdbarch(): Implement the set/get functions (probably using
132 the macro's as shortcuts).
133
134 */
135
136 int short_bit;
137 int int_bit;
138 int long_bit;
139 int long_long_bit;
140 int float_bit;
141 int double_bit;
142 int long_double_bit;
143 int ptr_bit;
144 int addr_bit;
145 int bfd_vma_bit;
146 int ieee_float;
147 gdbarch_read_pc_ftype *read_pc;
148 gdbarch_write_pc_ftype *write_pc;
149 gdbarch_read_fp_ftype *read_fp;
150 gdbarch_write_fp_ftype *write_fp;
151 gdbarch_read_sp_ftype *read_sp;
152 gdbarch_write_sp_ftype *write_sp;
153 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
154 gdbarch_register_read_ftype *register_read;
155 gdbarch_register_write_ftype *register_write;
156 int num_regs;
157 int num_pseudo_regs;
158 int sp_regnum;
159 int fp_regnum;
160 int pc_regnum;
161 int fp0_regnum;
162 int npc_regnum;
163 int nnpc_regnum;
164 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
165 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
166 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
167 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
168 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
169 gdbarch_register_name_ftype *register_name;
170 int register_size;
171 int register_bytes;
172 gdbarch_register_byte_ftype *register_byte;
173 gdbarch_register_raw_size_ftype *register_raw_size;
174 int max_register_raw_size;
175 gdbarch_register_virtual_size_ftype *register_virtual_size;
176 int max_register_virtual_size;
177 gdbarch_register_virtual_type_ftype *register_virtual_type;
178 gdbarch_do_registers_info_ftype *do_registers_info;
179 gdbarch_register_sim_regno_ftype *register_sim_regno;
180 gdbarch_register_bytes_ok_ftype *register_bytes_ok;
181 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
182 gdbarch_cannot_store_register_ftype *cannot_store_register;
183 int use_generic_dummy_frames;
184 int call_dummy_location;
185 gdbarch_call_dummy_address_ftype *call_dummy_address;
186 CORE_ADDR call_dummy_start_offset;
187 CORE_ADDR call_dummy_breakpoint_offset;
188 int call_dummy_breakpoint_offset_p;
189 int call_dummy_length;
190 gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy;
191 int call_dummy_p;
192 LONGEST * call_dummy_words;
193 int sizeof_call_dummy_words;
194 int call_dummy_stack_adjust_p;
195 int call_dummy_stack_adjust;
196 gdbarch_fix_call_dummy_ftype *fix_call_dummy;
197 gdbarch_init_frame_pc_first_ftype *init_frame_pc_first;
198 gdbarch_init_frame_pc_ftype *init_frame_pc;
199 int believe_pcc_promotion;
200 int believe_pcc_promotion_type;
201 gdbarch_coerce_float_to_double_ftype *coerce_float_to_double;
202 gdbarch_get_saved_register_ftype *get_saved_register;
203 gdbarch_register_convertible_ftype *register_convertible;
204 gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
205 gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
206 gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register;
207 gdbarch_store_pseudo_register_ftype *store_pseudo_register;
208 gdbarch_pointer_to_address_ftype *pointer_to_address;
209 gdbarch_address_to_pointer_ftype *address_to_pointer;
210 gdbarch_return_value_on_stack_ftype *return_value_on_stack;
211 gdbarch_extract_return_value_ftype *extract_return_value;
212 gdbarch_push_arguments_ftype *push_arguments;
213 gdbarch_push_dummy_frame_ftype *push_dummy_frame;
214 gdbarch_push_return_address_ftype *push_return_address;
215 gdbarch_pop_frame_ftype *pop_frame;
216 gdbarch_store_struct_return_ftype *store_struct_return;
217 gdbarch_store_return_value_ftype *store_return_value;
218 gdbarch_extract_struct_value_address_ftype *extract_struct_value_address;
219 gdbarch_use_struct_convention_ftype *use_struct_convention;
220 gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs;
221 gdbarch_init_extra_frame_info_ftype *init_extra_frame_info;
222 gdbarch_skip_prologue_ftype *skip_prologue;
223 gdbarch_prologue_frameless_p_ftype *prologue_frameless_p;
224 gdbarch_inner_than_ftype *inner_than;
225 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
226 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
227 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
228 CORE_ADDR decr_pc_after_break;
229 gdbarch_prepare_to_proceed_ftype *prepare_to_proceed;
230 CORE_ADDR function_start_offset;
231 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
232 CORE_ADDR frame_args_skip;
233 gdbarch_frameless_function_invocation_ftype *frameless_function_invocation;
234 gdbarch_frame_chain_ftype *frame_chain;
235 gdbarch_frame_chain_valid_ftype *frame_chain_valid;
236 gdbarch_frame_saved_pc_ftype *frame_saved_pc;
237 gdbarch_frame_args_address_ftype *frame_args_address;
238 gdbarch_frame_locals_address_ftype *frame_locals_address;
239 gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
240 gdbarch_frame_num_args_ftype *frame_num_args;
241 gdbarch_stack_align_ftype *stack_align;
242 int extra_stack_alignment_needed;
243 gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
244 gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
245 int parm_boundary;
246 const struct floatformat * float_format;
247 const struct floatformat * double_format;
248 const struct floatformat * long_double_format;
249 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
250 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
251 gdbarch_software_single_step_ftype *software_single_step;
252 gdbarch_print_insn_ftype *print_insn;
253 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
254 };
255
256
257 /* The default architecture uses host values (for want of a better
258 choice). */
259
260 extern const struct bfd_arch_info bfd_default_arch_struct;
261
262 struct gdbarch startup_gdbarch =
263 {
264 /* basic architecture information */
265 &bfd_default_arch_struct,
266 BIG_ENDIAN,
267 /* target specific vector and its dump routine */
268 NULL, NULL,
269 /*per-architecture data-pointers and swap regions */
270 0, NULL, NULL,
271 /* Multi-arch values */
272 8 * sizeof (short),
273 8 * sizeof (int),
274 8 * sizeof (long),
275 8 * sizeof (LONGEST),
276 8 * sizeof (float),
277 8 * sizeof (double),
278 8 * sizeof (long double),
279 8 * sizeof (void*),
280 8 * sizeof (void*),
281 8 * sizeof (void*),
282 0,
283 0,
284 0,
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 generic_get_saved_register,
339 0,
340 0,
341 0,
342 0,
343 0,
344 0,
345 0,
346 0,
347 0,
348 0,
349 0,
350 0,
351 0,
352 0,
353 0,
354 0,
355 0,
356 0,
357 0,
358 0,
359 0,
360 0,
361 0,
362 0,
363 0,
364 0,
365 0,
366 0,
367 0,
368 0,
369 0,
370 0,
371 0,
372 0,
373 0,
374 0,
375 0,
376 0,
377 0,
378 0,
379 0,
380 0,
381 0,
382 0,
383 0,
384 0,
385 0,
386 0,
387 0,
388 0,
389 0,
390 /* startup_gdbarch() */
391 };
392
393 struct gdbarch *current_gdbarch = &startup_gdbarch;
394
395 /* Do any initialization needed for a non-multiarch configuration
396 after the _initialize_MODULE functions have been run. */
397 void
398 initialize_non_multiarch ()
399 {
400 alloc_gdbarch_data (&startup_gdbarch);
401 init_gdbarch_data (&startup_gdbarch);
402 }
403
404
405 /* Create a new ``struct gdbarch'' based on information provided by
406 ``struct gdbarch_info''. */
407
408 struct gdbarch *
409 gdbarch_alloc (const struct gdbarch_info *info,
410 struct gdbarch_tdep *tdep)
411 {
412 struct gdbarch *gdbarch = XMALLOC (struct gdbarch);
413 memset (gdbarch, 0, sizeof (*gdbarch));
414
415 alloc_gdbarch_data (gdbarch);
416
417 gdbarch->tdep = tdep;
418
419 gdbarch->bfd_arch_info = info->bfd_arch_info;
420 gdbarch->byte_order = info->byte_order;
421
422 /* Force the explicit initialization of these. */
423 gdbarch->short_bit = 2*TARGET_CHAR_BIT;
424 gdbarch->int_bit = 4*TARGET_CHAR_BIT;
425 gdbarch->long_bit = 4*TARGET_CHAR_BIT;
426 gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
427 gdbarch->float_bit = 4*TARGET_CHAR_BIT;
428 gdbarch->double_bit = 8*TARGET_CHAR_BIT;
429 gdbarch->long_double_bit = 2*TARGET_DOUBLE_BIT;
430 gdbarch->ptr_bit = TARGET_INT_BIT;
431 gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
432 gdbarch->read_pc = generic_target_read_pc;
433 gdbarch->write_pc = generic_target_write_pc;
434 gdbarch->read_fp = generic_target_read_fp;
435 gdbarch->write_fp = generic_target_write_fp;
436 gdbarch->read_sp = generic_target_read_sp;
437 gdbarch->write_sp = generic_target_write_sp;
438 gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
439 gdbarch->num_regs = -1;
440 gdbarch->sp_regnum = -1;
441 gdbarch->fp_regnum = -1;
442 gdbarch->pc_regnum = -1;
443 gdbarch->fp0_regnum = -1;
444 gdbarch->npc_regnum = -1;
445 gdbarch->nnpc_regnum = -1;
446 gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
447 gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
448 gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
449 gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
450 gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
451 gdbarch->register_name = legacy_register_name;
452 gdbarch->register_size = -1;
453 gdbarch->register_bytes = -1;
454 gdbarch->max_register_raw_size = -1;
455 gdbarch->max_register_virtual_size = -1;
456 gdbarch->do_registers_info = do_registers_info;
457 gdbarch->register_sim_regno = default_register_sim_regno;
458 gdbarch->cannot_fetch_register = cannot_register_not;
459 gdbarch->cannot_store_register = cannot_register_not;
460 gdbarch->use_generic_dummy_frames = -1;
461 gdbarch->call_dummy_start_offset = -1;
462 gdbarch->call_dummy_breakpoint_offset = -1;
463 gdbarch->call_dummy_breakpoint_offset_p = -1;
464 gdbarch->call_dummy_length = -1;
465 gdbarch->call_dummy_p = -1;
466 gdbarch->call_dummy_words = legacy_call_dummy_words;
467 gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
468 gdbarch->call_dummy_stack_adjust_p = -1;
469 gdbarch->init_frame_pc_first = init_frame_pc_noop;
470 gdbarch->init_frame_pc = init_frame_pc_default;
471 gdbarch->coerce_float_to_double = default_coerce_float_to_double;
472 gdbarch->register_convertible = generic_register_convertible_not;
473 gdbarch->pointer_to_address = unsigned_pointer_to_address;
474 gdbarch->address_to_pointer = unsigned_address_to_pointer;
475 gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
476 gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
477 gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
478 gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
479 gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
480 gdbarch->decr_pc_after_break = -1;
481 gdbarch->prepare_to_proceed = default_prepare_to_proceed;
482 gdbarch->function_start_offset = -1;
483 gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
484 gdbarch->frame_args_skip = -1;
485 gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
486 gdbarch->extra_stack_alignment_needed = 1;
487 gdbarch->convert_from_func_ptr_addr = core_addr_identity;
488 gdbarch->addr_bits_remove = core_addr_identity;
489 gdbarch->print_insn = legacy_print_insn;
490 gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
491 /* gdbarch_alloc() */
492
493 return gdbarch;
494 }
495
496
497 /* Free a gdbarch struct. This should never happen in normal
498 operation --- once you've created a gdbarch, you keep it around.
499 However, if an architecture's init function encounters an error
500 building the structure, it may need to clean up a partially
501 constructed gdbarch. */
502
503 void
504 gdbarch_free (struct gdbarch *arch)
505 {
506 gdb_assert (arch != NULL);
507 free_gdbarch_data (arch);
508 xfree (arch);
509 }
510
511
512 /* Ensure that all values in a GDBARCH are reasonable. */
513
514 static void
515 verify_gdbarch (struct gdbarch *gdbarch)
516 {
517 /* Only perform sanity checks on a multi-arch target. */
518 if (!GDB_MULTI_ARCH)
519 return;
520 /* fundamental */
521 if (gdbarch->byte_order == 0)
522 internal_error (__FILE__, __LINE__,
523 "verify_gdbarch: byte-order unset");
524 if (gdbarch->bfd_arch_info == NULL)
525 internal_error (__FILE__, __LINE__,
526 "verify_gdbarch: bfd_arch_info unset");
527 /* Check those that need to be defined for the given multi-arch level. */
528 /* Skip verify of short_bit, invalid_p == 0 */
529 /* Skip verify of int_bit, invalid_p == 0 */
530 /* Skip verify of long_bit, invalid_p == 0 */
531 /* Skip verify of long_long_bit, invalid_p == 0 */
532 /* Skip verify of float_bit, invalid_p == 0 */
533 /* Skip verify of double_bit, invalid_p == 0 */
534 /* Skip verify of long_double_bit, invalid_p == 0 */
535 /* Skip verify of ptr_bit, invalid_p == 0 */
536 if (gdbarch->addr_bit == 0)
537 gdbarch->addr_bit = TARGET_PTR_BIT;
538 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
539 /* Skip verify of ieee_float, invalid_p == 0 */
540 /* Skip verify of read_pc, invalid_p == 0 */
541 /* Skip verify of write_pc, invalid_p == 0 */
542 /* Skip verify of read_fp, invalid_p == 0 */
543 /* Skip verify of write_fp, invalid_p == 0 */
544 /* Skip verify of read_sp, invalid_p == 0 */
545 /* Skip verify of write_sp, invalid_p == 0 */
546 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
547 /* Skip verify of register_read, has predicate */
548 /* Skip verify of register_write, has predicate */
549 if ((GDB_MULTI_ARCH >= 2)
550 && (gdbarch->num_regs == -1))
551 internal_error (__FILE__, __LINE__,
552 "gdbarch: verify_gdbarch: num_regs invalid");
553 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
554 if ((GDB_MULTI_ARCH >= 2)
555 && (gdbarch->sp_regnum == -1))
556 internal_error (__FILE__, __LINE__,
557 "gdbarch: verify_gdbarch: sp_regnum invalid");
558 if ((GDB_MULTI_ARCH >= 2)
559 && (gdbarch->fp_regnum == -1))
560 internal_error (__FILE__, __LINE__,
561 "gdbarch: verify_gdbarch: fp_regnum invalid");
562 if ((GDB_MULTI_ARCH >= 2)
563 && (gdbarch->pc_regnum == -1))
564 internal_error (__FILE__, __LINE__,
565 "gdbarch: verify_gdbarch: pc_regnum invalid");
566 /* Skip verify of fp0_regnum, invalid_p == 0 */
567 /* Skip verify of npc_regnum, invalid_p == 0 */
568 /* Skip verify of nnpc_regnum, invalid_p == 0 */
569 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
570 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
571 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
572 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
573 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
574 /* Skip verify of register_name, invalid_p == 0 */
575 if ((GDB_MULTI_ARCH >= 2)
576 && (gdbarch->register_size == -1))
577 internal_error (__FILE__, __LINE__,
578 "gdbarch: verify_gdbarch: register_size invalid");
579 if ((GDB_MULTI_ARCH >= 2)
580 && (gdbarch->register_bytes == -1))
581 internal_error (__FILE__, __LINE__,
582 "gdbarch: verify_gdbarch: register_bytes invalid");
583 if ((GDB_MULTI_ARCH >= 2)
584 && (gdbarch->register_byte == 0))
585 internal_error (__FILE__, __LINE__,
586 "gdbarch: verify_gdbarch: register_byte invalid");
587 if ((GDB_MULTI_ARCH >= 2)
588 && (gdbarch->register_raw_size == 0))
589 internal_error (__FILE__, __LINE__,
590 "gdbarch: verify_gdbarch: register_raw_size invalid");
591 if ((GDB_MULTI_ARCH >= 2)
592 && (gdbarch->max_register_raw_size == -1))
593 internal_error (__FILE__, __LINE__,
594 "gdbarch: verify_gdbarch: max_register_raw_size invalid");
595 if ((GDB_MULTI_ARCH >= 2)
596 && (gdbarch->register_virtual_size == 0))
597 internal_error (__FILE__, __LINE__,
598 "gdbarch: verify_gdbarch: register_virtual_size invalid");
599 if ((GDB_MULTI_ARCH >= 2)
600 && (gdbarch->max_register_virtual_size == -1))
601 internal_error (__FILE__, __LINE__,
602 "gdbarch: verify_gdbarch: max_register_virtual_size invalid");
603 if ((GDB_MULTI_ARCH >= 2)
604 && (gdbarch->register_virtual_type == 0))
605 internal_error (__FILE__, __LINE__,
606 "gdbarch: verify_gdbarch: register_virtual_type invalid");
607 /* Skip verify of do_registers_info, invalid_p == 0 */
608 /* Skip verify of register_sim_regno, invalid_p == 0 */
609 /* Skip verify of register_bytes_ok, has predicate */
610 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
611 /* Skip verify of cannot_store_register, invalid_p == 0 */
612 if ((GDB_MULTI_ARCH >= 1)
613 && (gdbarch->use_generic_dummy_frames == -1))
614 internal_error (__FILE__, __LINE__,
615 "gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
616 if ((GDB_MULTI_ARCH >= 2)
617 && (gdbarch->call_dummy_location == 0))
618 internal_error (__FILE__, __LINE__,
619 "gdbarch: verify_gdbarch: call_dummy_location invalid");
620 if ((GDB_MULTI_ARCH >= 2)
621 && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
622 internal_error (__FILE__, __LINE__,
623 "gdbarch: verify_gdbarch: call_dummy_address invalid");
624 if ((GDB_MULTI_ARCH >= 2)
625 && (gdbarch->call_dummy_start_offset == -1))
626 internal_error (__FILE__, __LINE__,
627 "gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
628 if ((GDB_MULTI_ARCH >= 2)
629 && (gdbarch->call_dummy_breakpoint_offset == -1))
630 internal_error (__FILE__, __LINE__,
631 "gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
632 if ((GDB_MULTI_ARCH >= 1)
633 && (gdbarch->call_dummy_breakpoint_offset_p == -1))
634 internal_error (__FILE__, __LINE__,
635 "gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
636 if ((GDB_MULTI_ARCH >= 2)
637 && (gdbarch->call_dummy_length == -1))
638 internal_error (__FILE__, __LINE__,
639 "gdbarch: verify_gdbarch: call_dummy_length invalid");
640 if ((GDB_MULTI_ARCH >= 2)
641 && (gdbarch->pc_in_call_dummy == 0))
642 internal_error (__FILE__, __LINE__,
643 "gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
644 if ((GDB_MULTI_ARCH >= 1)
645 && (gdbarch->call_dummy_p == -1))
646 internal_error (__FILE__, __LINE__,
647 "gdbarch: verify_gdbarch: call_dummy_p invalid");
648 /* Skip verify of call_dummy_words, invalid_p == 0 */
649 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
650 if ((GDB_MULTI_ARCH >= 1)
651 && (gdbarch->call_dummy_stack_adjust_p == -1))
652 internal_error (__FILE__, __LINE__,
653 "gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
654 if ((GDB_MULTI_ARCH >= 2)
655 && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0))
656 internal_error (__FILE__, __LINE__,
657 "gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
658 if ((GDB_MULTI_ARCH >= 2)
659 && (gdbarch->fix_call_dummy == 0))
660 internal_error (__FILE__, __LINE__,
661 "gdbarch: verify_gdbarch: fix_call_dummy invalid");
662 /* Skip verify of init_frame_pc_first, invalid_p == 0 */
663 /* Skip verify of init_frame_pc, invalid_p == 0 */
664 /* Skip verify of coerce_float_to_double, invalid_p == 0 */
665 if ((GDB_MULTI_ARCH >= 1)
666 && (gdbarch->get_saved_register == 0))
667 internal_error (__FILE__, __LINE__,
668 "gdbarch: verify_gdbarch: get_saved_register invalid");
669 /* Skip verify of register_convertible, invalid_p == 0 */
670 /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
671 /* Skip verify of register_convert_to_raw, invalid_p == 0 */
672 /* Skip verify of fetch_pseudo_register, invalid_p == 0 */
673 /* Skip verify of store_pseudo_register, invalid_p == 0 */
674 /* Skip verify of pointer_to_address, invalid_p == 0 */
675 /* Skip verify of address_to_pointer, invalid_p == 0 */
676 /* Skip verify of return_value_on_stack, invalid_p == 0 */
677 if ((GDB_MULTI_ARCH >= 2)
678 && (gdbarch->extract_return_value == 0))
679 internal_error (__FILE__, __LINE__,
680 "gdbarch: verify_gdbarch: extract_return_value invalid");
681 if ((GDB_MULTI_ARCH >= 1)
682 && (gdbarch->push_arguments == 0))
683 internal_error (__FILE__, __LINE__,
684 "gdbarch: verify_gdbarch: push_arguments invalid");
685 if ((GDB_MULTI_ARCH >= 2)
686 && (gdbarch->push_dummy_frame == 0))
687 internal_error (__FILE__, __LINE__,
688 "gdbarch: verify_gdbarch: push_dummy_frame invalid");
689 if ((GDB_MULTI_ARCH >= 1)
690 && (gdbarch->push_return_address == 0))
691 internal_error (__FILE__, __LINE__,
692 "gdbarch: verify_gdbarch: push_return_address invalid");
693 if ((GDB_MULTI_ARCH >= 2)
694 && (gdbarch->pop_frame == 0))
695 internal_error (__FILE__, __LINE__,
696 "gdbarch: verify_gdbarch: pop_frame invalid");
697 if ((GDB_MULTI_ARCH >= 2)
698 && (gdbarch->store_struct_return == 0))
699 internal_error (__FILE__, __LINE__,
700 "gdbarch: verify_gdbarch: store_struct_return invalid");
701 if ((GDB_MULTI_ARCH >= 2)
702 && (gdbarch->store_return_value == 0))
703 internal_error (__FILE__, __LINE__,
704 "gdbarch: verify_gdbarch: store_return_value invalid");
705 /* Skip verify of extract_struct_value_address, has predicate */
706 if ((GDB_MULTI_ARCH >= 2)
707 && (gdbarch->use_struct_convention == 0))
708 internal_error (__FILE__, __LINE__,
709 "gdbarch: verify_gdbarch: use_struct_convention invalid");
710 if ((GDB_MULTI_ARCH >= 2)
711 && (gdbarch->frame_init_saved_regs == 0))
712 internal_error (__FILE__, __LINE__,
713 "gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
714 if ((GDB_MULTI_ARCH >= 2)
715 && (gdbarch->init_extra_frame_info == 0))
716 internal_error (__FILE__, __LINE__,
717 "gdbarch: verify_gdbarch: init_extra_frame_info invalid");
718 if ((GDB_MULTI_ARCH >= 2)
719 && (gdbarch->skip_prologue == 0))
720 internal_error (__FILE__, __LINE__,
721 "gdbarch: verify_gdbarch: skip_prologue invalid");
722 /* Skip verify of prologue_frameless_p, invalid_p == 0 */
723 if ((GDB_MULTI_ARCH >= 2)
724 && (gdbarch->inner_than == 0))
725 internal_error (__FILE__, __LINE__,
726 "gdbarch: verify_gdbarch: inner_than invalid");
727 /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
728 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
729 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
730 if ((GDB_MULTI_ARCH >= 2)
731 && (gdbarch->decr_pc_after_break == -1))
732 internal_error (__FILE__, __LINE__,
733 "gdbarch: verify_gdbarch: decr_pc_after_break invalid");
734 /* Skip verify of prepare_to_proceed, invalid_p == 0 */
735 if ((GDB_MULTI_ARCH >= 2)
736 && (gdbarch->function_start_offset == -1))
737 internal_error (__FILE__, __LINE__,
738 "gdbarch: verify_gdbarch: function_start_offset invalid");
739 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
740 if ((GDB_MULTI_ARCH >= 2)
741 && (gdbarch->frame_args_skip == -1))
742 internal_error (__FILE__, __LINE__,
743 "gdbarch: verify_gdbarch: frame_args_skip invalid");
744 /* Skip verify of frameless_function_invocation, invalid_p == 0 */
745 if ((GDB_MULTI_ARCH >= 2)
746 && (gdbarch->frame_chain == 0))
747 internal_error (__FILE__, __LINE__,
748 "gdbarch: verify_gdbarch: frame_chain invalid");
749 if ((GDB_MULTI_ARCH >= 1)
750 && (gdbarch->frame_chain_valid == 0))
751 internal_error (__FILE__, __LINE__,
752 "gdbarch: verify_gdbarch: frame_chain_valid invalid");
753 if ((GDB_MULTI_ARCH >= 2)
754 && (gdbarch->frame_saved_pc == 0))
755 internal_error (__FILE__, __LINE__,
756 "gdbarch: verify_gdbarch: frame_saved_pc invalid");
757 if ((GDB_MULTI_ARCH >= 2)
758 && (gdbarch->frame_args_address == 0))
759 internal_error (__FILE__, __LINE__,
760 "gdbarch: verify_gdbarch: frame_args_address invalid");
761 if ((GDB_MULTI_ARCH >= 2)
762 && (gdbarch->frame_locals_address == 0))
763 internal_error (__FILE__, __LINE__,
764 "gdbarch: verify_gdbarch: frame_locals_address invalid");
765 if ((GDB_MULTI_ARCH >= 2)
766 && (gdbarch->saved_pc_after_call == 0))
767 internal_error (__FILE__, __LINE__,
768 "gdbarch: verify_gdbarch: saved_pc_after_call invalid");
769 if ((GDB_MULTI_ARCH >= 2)
770 && (gdbarch->frame_num_args == 0))
771 internal_error (__FILE__, __LINE__,
772 "gdbarch: verify_gdbarch: frame_num_args invalid");
773 /* Skip verify of stack_align, has predicate */
774 /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
775 /* Skip verify of reg_struct_has_addr, has predicate */
776 /* Skip verify of save_dummy_frame_tos, has predicate */
777 if (gdbarch->float_format == 0)
778 gdbarch->float_format = default_float_format (gdbarch);
779 if (gdbarch->double_format == 0)
780 gdbarch->double_format = default_double_format (gdbarch);
781 if (gdbarch->long_double_format == 0)
782 gdbarch->long_double_format = &floatformat_unknown;
783 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
784 /* Skip verify of addr_bits_remove, invalid_p == 0 */
785 /* Skip verify of software_single_step, has predicate */
786 /* Skip verify of print_insn, invalid_p == 0 */
787 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
788 }
789
790
791 /* Print out the details of the current architecture. */
792
793 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
794 just happens to match the global variable ``current_gdbarch''. That
795 way macros refering to that variable get the local and not the global
796 version - ulgh. Once everything is parameterised with gdbarch, this
797 will go away. */
798
799 void
800 gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
801 {
802 fprintf_unfiltered (file,
803 "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
804 GDB_MULTI_ARCH);
805 if (GDB_MULTI_ARCH)
806 fprintf_unfiltered (file,
807 "gdbarch_dump: register_read = 0x%08lx\n",
808 (long) current_gdbarch->register_read);
809 if (GDB_MULTI_ARCH)
810 fprintf_unfiltered (file,
811 "gdbarch_dump: register_write = 0x%08lx\n",
812 (long) current_gdbarch->register_write);
813 #ifdef ADDRESS_TO_POINTER
814 #if GDB_MULTI_ARCH
815 /* Macro might contain `[{}]' when not multi-arch */
816 fprintf_unfiltered (file,
817 "gdbarch_dump: %s # %s\n",
818 "ADDRESS_TO_POINTER(type, buf, addr)",
819 XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
820 #endif
821 if (GDB_MULTI_ARCH)
822 fprintf_unfiltered (file,
823 "gdbarch_dump: ADDRESS_TO_POINTER = 0x%08lx\n",
824 (long) current_gdbarch->address_to_pointer
825 /*ADDRESS_TO_POINTER ()*/);
826 #endif
827 #ifdef ADDR_BITS_REMOVE
828 fprintf_unfiltered (file,
829 "gdbarch_dump: %s # %s\n",
830 "ADDR_BITS_REMOVE(addr)",
831 XSTRING (ADDR_BITS_REMOVE (addr)));
832 if (GDB_MULTI_ARCH)
833 fprintf_unfiltered (file,
834 "gdbarch_dump: ADDR_BITS_REMOVE = 0x%08lx\n",
835 (long) current_gdbarch->addr_bits_remove
836 /*ADDR_BITS_REMOVE ()*/);
837 #endif
838 #ifdef BELIEVE_PCC_PROMOTION
839 fprintf_unfiltered (file,
840 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
841 XSTRING (BELIEVE_PCC_PROMOTION));
842 fprintf_unfiltered (file,
843 "gdbarch_dump: BELIEVE_PCC_PROMOTION = %ld\n",
844 (long) BELIEVE_PCC_PROMOTION);
845 #endif
846 #ifdef BELIEVE_PCC_PROMOTION_TYPE
847 fprintf_unfiltered (file,
848 "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n",
849 XSTRING (BELIEVE_PCC_PROMOTION_TYPE));
850 fprintf_unfiltered (file,
851 "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
852 (long) BELIEVE_PCC_PROMOTION_TYPE);
853 #endif
854 #ifdef BREAKPOINT_FROM_PC
855 fprintf_unfiltered (file,
856 "gdbarch_dump: %s # %s\n",
857 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
858 XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
859 if (GDB_MULTI_ARCH)
860 fprintf_unfiltered (file,
861 "gdbarch_dump: BREAKPOINT_FROM_PC = 0x%08lx\n",
862 (long) current_gdbarch->breakpoint_from_pc
863 /*BREAKPOINT_FROM_PC ()*/);
864 #endif
865 #ifdef CALL_DUMMY_ADDRESS
866 fprintf_unfiltered (file,
867 "gdbarch_dump: %s # %s\n",
868 "CALL_DUMMY_ADDRESS()",
869 XSTRING (CALL_DUMMY_ADDRESS ()));
870 if (GDB_MULTI_ARCH)
871 fprintf_unfiltered (file,
872 "gdbarch_dump: CALL_DUMMY_ADDRESS = 0x%08lx\n",
873 (long) current_gdbarch->call_dummy_address
874 /*CALL_DUMMY_ADDRESS ()*/);
875 #endif
876 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
877 fprintf_unfiltered (file,
878 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
879 XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET));
880 if (CALL_DUMMY_BREAKPOINT_OFFSET_P)
881 fprintf_unfiltered (file,
882 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
883 (long) CALL_DUMMY_BREAKPOINT_OFFSET);
884 #endif
885 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
886 fprintf_unfiltered (file,
887 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P # %s\n",
888 XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET_P));
889 fprintf_unfiltered (file,
890 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
891 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P);
892 #endif
893 #ifdef CALL_DUMMY_LENGTH
894 fprintf_unfiltered (file,
895 "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n",
896 XSTRING (CALL_DUMMY_LENGTH));
897 if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END)
898 fprintf_unfiltered (file,
899 "gdbarch_dump: CALL_DUMMY_LENGTH = %ld\n",
900 (long) CALL_DUMMY_LENGTH);
901 #endif
902 #ifdef CALL_DUMMY_LOCATION
903 fprintf_unfiltered (file,
904 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
905 XSTRING (CALL_DUMMY_LOCATION));
906 fprintf_unfiltered (file,
907 "gdbarch_dump: CALL_DUMMY_LOCATION = %ld\n",
908 (long) CALL_DUMMY_LOCATION);
909 #endif
910 #ifdef CALL_DUMMY_P
911 fprintf_unfiltered (file,
912 "gdbarch_dump: CALL_DUMMY_P # %s\n",
913 XSTRING (CALL_DUMMY_P));
914 fprintf_unfiltered (file,
915 "gdbarch_dump: CALL_DUMMY_P = %ld\n",
916 (long) CALL_DUMMY_P);
917 #endif
918 #ifdef CALL_DUMMY_STACK_ADJUST
919 fprintf_unfiltered (file,
920 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n",
921 XSTRING (CALL_DUMMY_STACK_ADJUST));
922 if (CALL_DUMMY_STACK_ADJUST_P)
923 fprintf_unfiltered (file,
924 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
925 (long) CALL_DUMMY_STACK_ADJUST);
926 #endif
927 #ifdef CALL_DUMMY_STACK_ADJUST_P
928 fprintf_unfiltered (file,
929 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P # %s\n",
930 XSTRING (CALL_DUMMY_STACK_ADJUST_P));
931 fprintf_unfiltered (file,
932 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
933 (long) CALL_DUMMY_STACK_ADJUST_P);
934 #endif
935 #ifdef CALL_DUMMY_START_OFFSET
936 fprintf_unfiltered (file,
937 "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n",
938 XSTRING (CALL_DUMMY_START_OFFSET));
939 fprintf_unfiltered (file,
940 "gdbarch_dump: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
941 (long) CALL_DUMMY_START_OFFSET);
942 #endif
943 #ifdef CALL_DUMMY_WORDS
944 fprintf_unfiltered (file,
945 "gdbarch_dump: CALL_DUMMY_WORDS # %s\n",
946 XSTRING (CALL_DUMMY_WORDS));
947 fprintf_unfiltered (file,
948 "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n",
949 (long) CALL_DUMMY_WORDS);
950 #endif
951 #ifdef CANNOT_FETCH_REGISTER
952 fprintf_unfiltered (file,
953 "gdbarch_dump: %s # %s\n",
954 "CANNOT_FETCH_REGISTER(regnum)",
955 XSTRING (CANNOT_FETCH_REGISTER (regnum)));
956 if (GDB_MULTI_ARCH)
957 fprintf_unfiltered (file,
958 "gdbarch_dump: CANNOT_FETCH_REGISTER = 0x%08lx\n",
959 (long) current_gdbarch->cannot_fetch_register
960 /*CANNOT_FETCH_REGISTER ()*/);
961 #endif
962 #ifdef CANNOT_STORE_REGISTER
963 fprintf_unfiltered (file,
964 "gdbarch_dump: %s # %s\n",
965 "CANNOT_STORE_REGISTER(regnum)",
966 XSTRING (CANNOT_STORE_REGISTER (regnum)));
967 if (GDB_MULTI_ARCH)
968 fprintf_unfiltered (file,
969 "gdbarch_dump: CANNOT_STORE_REGISTER = 0x%08lx\n",
970 (long) current_gdbarch->cannot_store_register
971 /*CANNOT_STORE_REGISTER ()*/);
972 #endif
973 #ifdef COERCE_FLOAT_TO_DOUBLE
974 fprintf_unfiltered (file,
975 "gdbarch_dump: %s # %s\n",
976 "COERCE_FLOAT_TO_DOUBLE(formal, actual)",
977 XSTRING (COERCE_FLOAT_TO_DOUBLE (formal, actual)));
978 if (GDB_MULTI_ARCH)
979 fprintf_unfiltered (file,
980 "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
981 (long) current_gdbarch->coerce_float_to_double
982 /*COERCE_FLOAT_TO_DOUBLE ()*/);
983 #endif
984 #ifdef CONVERT_FROM_FUNC_PTR_ADDR
985 fprintf_unfiltered (file,
986 "gdbarch_dump: %s # %s\n",
987 "CONVERT_FROM_FUNC_PTR_ADDR(addr)",
988 XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr)));
989 if (GDB_MULTI_ARCH)
990 fprintf_unfiltered (file,
991 "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = 0x%08lx\n",
992 (long) current_gdbarch->convert_from_func_ptr_addr
993 /*CONVERT_FROM_FUNC_PTR_ADDR ()*/);
994 #endif
995 #ifdef DECR_PC_AFTER_BREAK
996 fprintf_unfiltered (file,
997 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
998 XSTRING (DECR_PC_AFTER_BREAK));
999 fprintf_unfiltered (file,
1000 "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
1001 (long) DECR_PC_AFTER_BREAK);
1002 #endif
1003 #ifdef DO_REGISTERS_INFO
1004 #if GDB_MULTI_ARCH
1005 /* Macro might contain `[{}]' when not multi-arch */
1006 fprintf_unfiltered (file,
1007 "gdbarch_dump: %s # %s\n",
1008 "DO_REGISTERS_INFO(reg_nr, fpregs)",
1009 XSTRING (DO_REGISTERS_INFO (reg_nr, fpregs)));
1010 #endif
1011 if (GDB_MULTI_ARCH)
1012 fprintf_unfiltered (file,
1013 "gdbarch_dump: DO_REGISTERS_INFO = 0x%08lx\n",
1014 (long) current_gdbarch->do_registers_info
1015 /*DO_REGISTERS_INFO ()*/);
1016 #endif
1017 #ifdef DWARF2_REG_TO_REGNUM
1018 fprintf_unfiltered (file,
1019 "gdbarch_dump: %s # %s\n",
1020 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
1021 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
1022 if (GDB_MULTI_ARCH)
1023 fprintf_unfiltered (file,
1024 "gdbarch_dump: DWARF2_REG_TO_REGNUM = 0x%08lx\n",
1025 (long) current_gdbarch->dwarf2_reg_to_regnum
1026 /*DWARF2_REG_TO_REGNUM ()*/);
1027 #endif
1028 #ifdef DWARF_REG_TO_REGNUM
1029 fprintf_unfiltered (file,
1030 "gdbarch_dump: %s # %s\n",
1031 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1032 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
1033 if (GDB_MULTI_ARCH)
1034 fprintf_unfiltered (file,
1035 "gdbarch_dump: DWARF_REG_TO_REGNUM = 0x%08lx\n",
1036 (long) current_gdbarch->dwarf_reg_to_regnum
1037 /*DWARF_REG_TO_REGNUM ()*/);
1038 #endif
1039 #ifdef ECOFF_REG_TO_REGNUM
1040 fprintf_unfiltered (file,
1041 "gdbarch_dump: %s # %s\n",
1042 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1043 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
1044 if (GDB_MULTI_ARCH)
1045 fprintf_unfiltered (file,
1046 "gdbarch_dump: ECOFF_REG_TO_REGNUM = 0x%08lx\n",
1047 (long) current_gdbarch->ecoff_reg_to_regnum
1048 /*ECOFF_REG_TO_REGNUM ()*/);
1049 #endif
1050 #ifdef EXTRACT_RETURN_VALUE
1051 #if GDB_MULTI_ARCH
1052 /* Macro might contain `[{}]' when not multi-arch */
1053 fprintf_unfiltered (file,
1054 "gdbarch_dump: %s # %s\n",
1055 "EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
1056 XSTRING (EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
1057 #endif
1058 if (GDB_MULTI_ARCH)
1059 fprintf_unfiltered (file,
1060 "gdbarch_dump: EXTRACT_RETURN_VALUE = 0x%08lx\n",
1061 (long) current_gdbarch->extract_return_value
1062 /*EXTRACT_RETURN_VALUE ()*/);
1063 #endif
1064 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1065 fprintf_unfiltered (file,
1066 "gdbarch_dump: %s # %s\n",
1067 "EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
1068 XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
1069 if (GDB_MULTI_ARCH)
1070 fprintf_unfiltered (file,
1071 "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
1072 (long) current_gdbarch->extract_struct_value_address
1073 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
1074 #endif
1075 #ifdef EXTRA_STACK_ALIGNMENT_NEEDED
1076 fprintf_unfiltered (file,
1077 "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n",
1078 XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED));
1079 fprintf_unfiltered (file,
1080 "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %ld\n",
1081 (long) EXTRA_STACK_ALIGNMENT_NEEDED);
1082 #endif
1083 #ifdef FETCH_PSEUDO_REGISTER
1084 #if GDB_MULTI_ARCH
1085 /* Macro might contain `[{}]' when not multi-arch */
1086 fprintf_unfiltered (file,
1087 "gdbarch_dump: %s # %s\n",
1088 "FETCH_PSEUDO_REGISTER(regnum)",
1089 XSTRING (FETCH_PSEUDO_REGISTER (regnum)));
1090 #endif
1091 if (GDB_MULTI_ARCH)
1092 fprintf_unfiltered (file,
1093 "gdbarch_dump: FETCH_PSEUDO_REGISTER = 0x%08lx\n",
1094 (long) current_gdbarch->fetch_pseudo_register
1095 /*FETCH_PSEUDO_REGISTER ()*/);
1096 #endif
1097 #ifdef FIX_CALL_DUMMY
1098 #if GDB_MULTI_ARCH
1099 /* Macro might contain `[{}]' when not multi-arch */
1100 fprintf_unfiltered (file,
1101 "gdbarch_dump: %s # %s\n",
1102 "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
1103 XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
1104 #endif
1105 if (GDB_MULTI_ARCH)
1106 fprintf_unfiltered (file,
1107 "gdbarch_dump: FIX_CALL_DUMMY = 0x%08lx\n",
1108 (long) current_gdbarch->fix_call_dummy
1109 /*FIX_CALL_DUMMY ()*/);
1110 #endif
1111 #ifdef FP0_REGNUM
1112 fprintf_unfiltered (file,
1113 "gdbarch_dump: FP0_REGNUM # %s\n",
1114 XSTRING (FP0_REGNUM));
1115 fprintf_unfiltered (file,
1116 "gdbarch_dump: FP0_REGNUM = %ld\n",
1117 (long) FP0_REGNUM);
1118 #endif
1119 #ifdef FP_REGNUM
1120 fprintf_unfiltered (file,
1121 "gdbarch_dump: FP_REGNUM # %s\n",
1122 XSTRING (FP_REGNUM));
1123 fprintf_unfiltered (file,
1124 "gdbarch_dump: FP_REGNUM = %ld\n",
1125 (long) FP_REGNUM);
1126 #endif
1127 #ifdef FRAMELESS_FUNCTION_INVOCATION
1128 fprintf_unfiltered (file,
1129 "gdbarch_dump: %s # %s\n",
1130 "FRAMELESS_FUNCTION_INVOCATION(fi)",
1131 XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi)));
1132 if (GDB_MULTI_ARCH)
1133 fprintf_unfiltered (file,
1134 "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
1135 (long) current_gdbarch->frameless_function_invocation
1136 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
1137 #endif
1138 #ifdef FRAME_ARGS_ADDRESS
1139 fprintf_unfiltered (file,
1140 "gdbarch_dump: %s # %s\n",
1141 "FRAME_ARGS_ADDRESS(fi)",
1142 XSTRING (FRAME_ARGS_ADDRESS (fi)));
1143 if (GDB_MULTI_ARCH)
1144 fprintf_unfiltered (file,
1145 "gdbarch_dump: FRAME_ARGS_ADDRESS = 0x%08lx\n",
1146 (long) current_gdbarch->frame_args_address
1147 /*FRAME_ARGS_ADDRESS ()*/);
1148 #endif
1149 #ifdef FRAME_ARGS_SKIP
1150 fprintf_unfiltered (file,
1151 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1152 XSTRING (FRAME_ARGS_SKIP));
1153 fprintf_unfiltered (file,
1154 "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n",
1155 (long) FRAME_ARGS_SKIP);
1156 #endif
1157 #ifdef FRAME_CHAIN
1158 fprintf_unfiltered (file,
1159 "gdbarch_dump: %s # %s\n",
1160 "FRAME_CHAIN(frame)",
1161 XSTRING (FRAME_CHAIN (frame)));
1162 if (GDB_MULTI_ARCH)
1163 fprintf_unfiltered (file,
1164 "gdbarch_dump: FRAME_CHAIN = 0x%08lx\n",
1165 (long) current_gdbarch->frame_chain
1166 /*FRAME_CHAIN ()*/);
1167 #endif
1168 #ifdef FRAME_CHAIN_VALID
1169 fprintf_unfiltered (file,
1170 "gdbarch_dump: %s # %s\n",
1171 "FRAME_CHAIN_VALID(chain, thisframe)",
1172 XSTRING (FRAME_CHAIN_VALID (chain, thisframe)));
1173 if (GDB_MULTI_ARCH)
1174 fprintf_unfiltered (file,
1175 "gdbarch_dump: FRAME_CHAIN_VALID = 0x%08lx\n",
1176 (long) current_gdbarch->frame_chain_valid
1177 /*FRAME_CHAIN_VALID ()*/);
1178 #endif
1179 #ifdef FRAME_INIT_SAVED_REGS
1180 #if GDB_MULTI_ARCH
1181 /* Macro might contain `[{}]' when not multi-arch */
1182 fprintf_unfiltered (file,
1183 "gdbarch_dump: %s # %s\n",
1184 "FRAME_INIT_SAVED_REGS(frame)",
1185 XSTRING (FRAME_INIT_SAVED_REGS (frame)));
1186 #endif
1187 if (GDB_MULTI_ARCH)
1188 fprintf_unfiltered (file,
1189 "gdbarch_dump: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
1190 (long) current_gdbarch->frame_init_saved_regs
1191 /*FRAME_INIT_SAVED_REGS ()*/);
1192 #endif
1193 #ifdef FRAME_LOCALS_ADDRESS
1194 fprintf_unfiltered (file,
1195 "gdbarch_dump: %s # %s\n",
1196 "FRAME_LOCALS_ADDRESS(fi)",
1197 XSTRING (FRAME_LOCALS_ADDRESS (fi)));
1198 if (GDB_MULTI_ARCH)
1199 fprintf_unfiltered (file,
1200 "gdbarch_dump: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
1201 (long) current_gdbarch->frame_locals_address
1202 /*FRAME_LOCALS_ADDRESS ()*/);
1203 #endif
1204 #ifdef FRAME_NUM_ARGS
1205 fprintf_unfiltered (file,
1206 "gdbarch_dump: %s # %s\n",
1207 "FRAME_NUM_ARGS(frame)",
1208 XSTRING (FRAME_NUM_ARGS (frame)));
1209 if (GDB_MULTI_ARCH)
1210 fprintf_unfiltered (file,
1211 "gdbarch_dump: FRAME_NUM_ARGS = 0x%08lx\n",
1212 (long) current_gdbarch->frame_num_args
1213 /*FRAME_NUM_ARGS ()*/);
1214 #endif
1215 #ifdef FRAME_SAVED_PC
1216 fprintf_unfiltered (file,
1217 "gdbarch_dump: %s # %s\n",
1218 "FRAME_SAVED_PC(fi)",
1219 XSTRING (FRAME_SAVED_PC (fi)));
1220 if (GDB_MULTI_ARCH)
1221 fprintf_unfiltered (file,
1222 "gdbarch_dump: FRAME_SAVED_PC = 0x%08lx\n",
1223 (long) current_gdbarch->frame_saved_pc
1224 /*FRAME_SAVED_PC ()*/);
1225 #endif
1226 #ifdef FUNCTION_START_OFFSET
1227 fprintf_unfiltered (file,
1228 "gdbarch_dump: FUNCTION_START_OFFSET # %s\n",
1229 XSTRING (FUNCTION_START_OFFSET));
1230 fprintf_unfiltered (file,
1231 "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n",
1232 (long) FUNCTION_START_OFFSET);
1233 #endif
1234 #ifdef GET_SAVED_REGISTER
1235 #if GDB_MULTI_ARCH
1236 /* Macro might contain `[{}]' when not multi-arch */
1237 fprintf_unfiltered (file,
1238 "gdbarch_dump: %s # %s\n",
1239 "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
1240 XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
1241 #endif
1242 if (GDB_MULTI_ARCH)
1243 fprintf_unfiltered (file,
1244 "gdbarch_dump: GET_SAVED_REGISTER = 0x%08lx\n",
1245 (long) current_gdbarch->get_saved_register
1246 /*GET_SAVED_REGISTER ()*/);
1247 #endif
1248 #ifdef IEEE_FLOAT
1249 fprintf_unfiltered (file,
1250 "gdbarch_dump: IEEE_FLOAT # %s\n",
1251 XSTRING (IEEE_FLOAT));
1252 fprintf_unfiltered (file,
1253 "gdbarch_dump: IEEE_FLOAT = %ld\n",
1254 (long) IEEE_FLOAT);
1255 #endif
1256 #ifdef INIT_EXTRA_FRAME_INFO
1257 #if GDB_MULTI_ARCH
1258 /* Macro might contain `[{}]' when not multi-arch */
1259 fprintf_unfiltered (file,
1260 "gdbarch_dump: %s # %s\n",
1261 "INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
1262 XSTRING (INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
1263 #endif
1264 if (GDB_MULTI_ARCH)
1265 fprintf_unfiltered (file,
1266 "gdbarch_dump: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
1267 (long) current_gdbarch->init_extra_frame_info
1268 /*INIT_EXTRA_FRAME_INFO ()*/);
1269 #endif
1270 #ifdef INIT_FRAME_PC
1271 #if GDB_MULTI_ARCH
1272 /* Macro might contain `[{}]' when not multi-arch */
1273 fprintf_unfiltered (file,
1274 "gdbarch_dump: %s # %s\n",
1275 "INIT_FRAME_PC(fromleaf, prev)",
1276 XSTRING (INIT_FRAME_PC (fromleaf, prev)));
1277 #endif
1278 if (GDB_MULTI_ARCH)
1279 fprintf_unfiltered (file,
1280 "gdbarch_dump: INIT_FRAME_PC = 0x%08lx\n",
1281 (long) current_gdbarch->init_frame_pc
1282 /*INIT_FRAME_PC ()*/);
1283 #endif
1284 #ifdef INIT_FRAME_PC_FIRST
1285 #if GDB_MULTI_ARCH
1286 /* Macro might contain `[{}]' when not multi-arch */
1287 fprintf_unfiltered (file,
1288 "gdbarch_dump: %s # %s\n",
1289 "INIT_FRAME_PC_FIRST(fromleaf, prev)",
1290 XSTRING (INIT_FRAME_PC_FIRST (fromleaf, prev)));
1291 #endif
1292 if (GDB_MULTI_ARCH)
1293 fprintf_unfiltered (file,
1294 "gdbarch_dump: INIT_FRAME_PC_FIRST = 0x%08lx\n",
1295 (long) current_gdbarch->init_frame_pc_first
1296 /*INIT_FRAME_PC_FIRST ()*/);
1297 #endif
1298 #ifdef INNER_THAN
1299 fprintf_unfiltered (file,
1300 "gdbarch_dump: %s # %s\n",
1301 "INNER_THAN(lhs, rhs)",
1302 XSTRING (INNER_THAN (lhs, rhs)));
1303 if (GDB_MULTI_ARCH)
1304 fprintf_unfiltered (file,
1305 "gdbarch_dump: INNER_THAN = 0x%08lx\n",
1306 (long) current_gdbarch->inner_than
1307 /*INNER_THAN ()*/);
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 == -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_return_value_on_stack (struct gdbarch *gdbarch, struct type *type)
3392 {
3393 if (gdbarch->return_value_on_stack == 0)
3394 internal_error (__FILE__, __LINE__,
3395 "gdbarch: gdbarch_return_value_on_stack invalid");
3396 if (gdbarch_debug >= 2)
3397 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n");
3398 return gdbarch->return_value_on_stack (type);
3399 }
3400
3401 void
3402 set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
3403 gdbarch_return_value_on_stack_ftype return_value_on_stack)
3404 {
3405 gdbarch->return_value_on_stack = return_value_on_stack;
3406 }
3407
3408 void
3409 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
3410 {
3411 if (gdbarch->extract_return_value == 0)
3412 internal_error (__FILE__, __LINE__,
3413 "gdbarch: gdbarch_extract_return_value invalid");
3414 if (gdbarch_debug >= 2)
3415 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
3416 gdbarch->extract_return_value (type, regbuf, valbuf);
3417 }
3418
3419 void
3420 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
3421 gdbarch_extract_return_value_ftype extract_return_value)
3422 {
3423 gdbarch->extract_return_value = extract_return_value;
3424 }
3425
3426 CORE_ADDR
3427 gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
3428 {
3429 if (gdbarch->push_arguments == 0)
3430 internal_error (__FILE__, __LINE__,
3431 "gdbarch: gdbarch_push_arguments invalid");
3432 if (gdbarch_debug >= 2)
3433 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n");
3434 return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr);
3435 }
3436
3437 void
3438 set_gdbarch_push_arguments (struct gdbarch *gdbarch,
3439 gdbarch_push_arguments_ftype push_arguments)
3440 {
3441 gdbarch->push_arguments = push_arguments;
3442 }
3443
3444 void
3445 gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
3446 {
3447 if (gdbarch->push_dummy_frame == 0)
3448 internal_error (__FILE__, __LINE__,
3449 "gdbarch: gdbarch_push_dummy_frame invalid");
3450 if (gdbarch_debug >= 2)
3451 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n");
3452 gdbarch->push_dummy_frame ();
3453 }
3454
3455 void
3456 set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch,
3457 gdbarch_push_dummy_frame_ftype push_dummy_frame)
3458 {
3459 gdbarch->push_dummy_frame = push_dummy_frame;
3460 }
3461
3462 CORE_ADDR
3463 gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
3464 {
3465 if (gdbarch->push_return_address == 0)
3466 internal_error (__FILE__, __LINE__,
3467 "gdbarch: gdbarch_push_return_address invalid");
3468 if (gdbarch_debug >= 2)
3469 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n");
3470 return gdbarch->push_return_address (pc, sp);
3471 }
3472
3473 void
3474 set_gdbarch_push_return_address (struct gdbarch *gdbarch,
3475 gdbarch_push_return_address_ftype push_return_address)
3476 {
3477 gdbarch->push_return_address = push_return_address;
3478 }
3479
3480 void
3481 gdbarch_pop_frame (struct gdbarch *gdbarch)
3482 {
3483 if (gdbarch->pop_frame == 0)
3484 internal_error (__FILE__, __LINE__,
3485 "gdbarch: gdbarch_pop_frame invalid");
3486 if (gdbarch_debug >= 2)
3487 fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
3488 gdbarch->pop_frame ();
3489 }
3490
3491 void
3492 set_gdbarch_pop_frame (struct gdbarch *gdbarch,
3493 gdbarch_pop_frame_ftype pop_frame)
3494 {
3495 gdbarch->pop_frame = pop_frame;
3496 }
3497
3498 void
3499 gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
3500 {
3501 if (gdbarch->store_struct_return == 0)
3502 internal_error (__FILE__, __LINE__,
3503 "gdbarch: gdbarch_store_struct_return invalid");
3504 if (gdbarch_debug >= 2)
3505 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n");
3506 gdbarch->store_struct_return (addr, sp);
3507 }
3508
3509 void
3510 set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
3511 gdbarch_store_struct_return_ftype store_struct_return)
3512 {
3513 gdbarch->store_struct_return = store_struct_return;
3514 }
3515
3516 void
3517 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
3518 {
3519 if (gdbarch->store_return_value == 0)
3520 internal_error (__FILE__, __LINE__,
3521 "gdbarch: gdbarch_store_return_value invalid");
3522 if (gdbarch_debug >= 2)
3523 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
3524 gdbarch->store_return_value (type, valbuf);
3525 }
3526
3527 void
3528 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
3529 gdbarch_store_return_value_ftype store_return_value)
3530 {
3531 gdbarch->store_return_value = store_return_value;
3532 }
3533
3534 int
3535 gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
3536 {
3537 return gdbarch->extract_struct_value_address != 0;
3538 }
3539
3540 CORE_ADDR
3541 gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
3542 {
3543 if (gdbarch->extract_struct_value_address == 0)
3544 internal_error (__FILE__, __LINE__,
3545 "gdbarch: gdbarch_extract_struct_value_address invalid");
3546 if (gdbarch_debug >= 2)
3547 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
3548 return gdbarch->extract_struct_value_address (regbuf);
3549 }
3550
3551 void
3552 set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
3553 gdbarch_extract_struct_value_address_ftype extract_struct_value_address)
3554 {
3555 gdbarch->extract_struct_value_address = extract_struct_value_address;
3556 }
3557
3558 int
3559 gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
3560 {
3561 if (gdbarch->use_struct_convention == 0)
3562 internal_error (__FILE__, __LINE__,
3563 "gdbarch: gdbarch_use_struct_convention invalid");
3564 if (gdbarch_debug >= 2)
3565 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
3566 return gdbarch->use_struct_convention (gcc_p, value_type);
3567 }
3568
3569 void
3570 set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
3571 gdbarch_use_struct_convention_ftype use_struct_convention)
3572 {
3573 gdbarch->use_struct_convention = use_struct_convention;
3574 }
3575
3576 void
3577 gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
3578 {
3579 if (gdbarch->frame_init_saved_regs == 0)
3580 internal_error (__FILE__, __LINE__,
3581 "gdbarch: gdbarch_frame_init_saved_regs invalid");
3582 if (gdbarch_debug >= 2)
3583 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n");
3584 gdbarch->frame_init_saved_regs (frame);
3585 }
3586
3587 void
3588 set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch,
3589 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs)
3590 {
3591 gdbarch->frame_init_saved_regs = frame_init_saved_regs;
3592 }
3593
3594 void
3595 gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
3596 {
3597 if (gdbarch->init_extra_frame_info == 0)
3598 internal_error (__FILE__, __LINE__,
3599 "gdbarch: gdbarch_init_extra_frame_info invalid");
3600 if (gdbarch_debug >= 2)
3601 fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n");
3602 gdbarch->init_extra_frame_info (fromleaf, frame);
3603 }
3604
3605 void
3606 set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch,
3607 gdbarch_init_extra_frame_info_ftype init_extra_frame_info)
3608 {
3609 gdbarch->init_extra_frame_info = init_extra_frame_info;
3610 }
3611
3612 CORE_ADDR
3613 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
3614 {
3615 if (gdbarch->skip_prologue == 0)
3616 internal_error (__FILE__, __LINE__,
3617 "gdbarch: gdbarch_skip_prologue invalid");
3618 if (gdbarch_debug >= 2)
3619 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
3620 return gdbarch->skip_prologue (ip);
3621 }
3622
3623 void
3624 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
3625 gdbarch_skip_prologue_ftype skip_prologue)
3626 {
3627 gdbarch->skip_prologue = skip_prologue;
3628 }
3629
3630 int
3631 gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip)
3632 {
3633 if (gdbarch->prologue_frameless_p == 0)
3634 internal_error (__FILE__, __LINE__,
3635 "gdbarch: gdbarch_prologue_frameless_p invalid");
3636 if (gdbarch_debug >= 2)
3637 fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n");
3638 return gdbarch->prologue_frameless_p (ip);
3639 }
3640
3641 void
3642 set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch,
3643 gdbarch_prologue_frameless_p_ftype prologue_frameless_p)
3644 {
3645 gdbarch->prologue_frameless_p = prologue_frameless_p;
3646 }
3647
3648 int
3649 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
3650 {
3651 if (gdbarch->inner_than == 0)
3652 internal_error (__FILE__, __LINE__,
3653 "gdbarch: gdbarch_inner_than invalid");
3654 if (gdbarch_debug >= 2)
3655 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
3656 return gdbarch->inner_than (lhs, rhs);
3657 }
3658
3659 void
3660 set_gdbarch_inner_than (struct gdbarch *gdbarch,
3661 gdbarch_inner_than_ftype inner_than)
3662 {
3663 gdbarch->inner_than = inner_than;
3664 }
3665
3666 unsigned char *
3667 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
3668 {
3669 if (gdbarch->breakpoint_from_pc == 0)
3670 internal_error (__FILE__, __LINE__,
3671 "gdbarch: gdbarch_breakpoint_from_pc invalid");
3672 if (gdbarch_debug >= 2)
3673 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
3674 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
3675 }
3676
3677 void
3678 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
3679 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
3680 {
3681 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
3682 }
3683
3684 int
3685 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3686 {
3687 if (gdbarch->memory_insert_breakpoint == 0)
3688 internal_error (__FILE__, __LINE__,
3689 "gdbarch: gdbarch_memory_insert_breakpoint invalid");
3690 if (gdbarch_debug >= 2)
3691 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
3692 return gdbarch->memory_insert_breakpoint (addr, contents_cache);
3693 }
3694
3695 void
3696 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
3697 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
3698 {
3699 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
3700 }
3701
3702 int
3703 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3704 {
3705 if (gdbarch->memory_remove_breakpoint == 0)
3706 internal_error (__FILE__, __LINE__,
3707 "gdbarch: gdbarch_memory_remove_breakpoint invalid");
3708 if (gdbarch_debug >= 2)
3709 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
3710 return gdbarch->memory_remove_breakpoint (addr, contents_cache);
3711 }
3712
3713 void
3714 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
3715 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
3716 {
3717 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
3718 }
3719
3720 CORE_ADDR
3721 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
3722 {
3723 if (gdbarch->decr_pc_after_break == -1)
3724 internal_error (__FILE__, __LINE__,
3725 "gdbarch: gdbarch_decr_pc_after_break invalid");
3726 if (gdbarch_debug >= 2)
3727 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
3728 return gdbarch->decr_pc_after_break;
3729 }
3730
3731 void
3732 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
3733 CORE_ADDR decr_pc_after_break)
3734 {
3735 gdbarch->decr_pc_after_break = decr_pc_after_break;
3736 }
3737
3738 int
3739 gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it)
3740 {
3741 if (gdbarch->prepare_to_proceed == 0)
3742 internal_error (__FILE__, __LINE__,
3743 "gdbarch: gdbarch_prepare_to_proceed invalid");
3744 if (gdbarch_debug >= 2)
3745 fprintf_unfiltered (gdb_stdlog, "gdbarch_prepare_to_proceed called\n");
3746 return gdbarch->prepare_to_proceed (select_it);
3747 }
3748
3749 void
3750 set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch,
3751 gdbarch_prepare_to_proceed_ftype prepare_to_proceed)
3752 {
3753 gdbarch->prepare_to_proceed = prepare_to_proceed;
3754 }
3755
3756 CORE_ADDR
3757 gdbarch_function_start_offset (struct gdbarch *gdbarch)
3758 {
3759 if (gdbarch->function_start_offset == -1)
3760 internal_error (__FILE__, __LINE__,
3761 "gdbarch: gdbarch_function_start_offset invalid");
3762 if (gdbarch_debug >= 2)
3763 fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
3764 return gdbarch->function_start_offset;
3765 }
3766
3767 void
3768 set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
3769 CORE_ADDR function_start_offset)
3770 {
3771 gdbarch->function_start_offset = function_start_offset;
3772 }
3773
3774 void
3775 gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
3776 {
3777 if (gdbarch->remote_translate_xfer_address == 0)
3778 internal_error (__FILE__, __LINE__,
3779 "gdbarch: gdbarch_remote_translate_xfer_address invalid");
3780 if (gdbarch_debug >= 2)
3781 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
3782 gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len);
3783 }
3784
3785 void
3786 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
3787 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
3788 {
3789 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
3790 }
3791
3792 CORE_ADDR
3793 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
3794 {
3795 if (gdbarch->frame_args_skip == -1)
3796 internal_error (__FILE__, __LINE__,
3797 "gdbarch: gdbarch_frame_args_skip invalid");
3798 if (gdbarch_debug >= 2)
3799 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
3800 return gdbarch->frame_args_skip;
3801 }
3802
3803 void
3804 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
3805 CORE_ADDR frame_args_skip)
3806 {
3807 gdbarch->frame_args_skip = frame_args_skip;
3808 }
3809
3810 int
3811 gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
3812 {
3813 if (gdbarch->frameless_function_invocation == 0)
3814 internal_error (__FILE__, __LINE__,
3815 "gdbarch: gdbarch_frameless_function_invocation invalid");
3816 if (gdbarch_debug >= 2)
3817 fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n");
3818 return gdbarch->frameless_function_invocation (fi);
3819 }
3820
3821 void
3822 set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
3823 gdbarch_frameless_function_invocation_ftype frameless_function_invocation)
3824 {
3825 gdbarch->frameless_function_invocation = frameless_function_invocation;
3826 }
3827
3828 CORE_ADDR
3829 gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
3830 {
3831 if (gdbarch->frame_chain == 0)
3832 internal_error (__FILE__, __LINE__,
3833 "gdbarch: gdbarch_frame_chain invalid");
3834 if (gdbarch_debug >= 2)
3835 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n");
3836 return gdbarch->frame_chain (frame);
3837 }
3838
3839 void
3840 set_gdbarch_frame_chain (struct gdbarch *gdbarch,
3841 gdbarch_frame_chain_ftype frame_chain)
3842 {
3843 gdbarch->frame_chain = frame_chain;
3844 }
3845
3846 int
3847 gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
3848 {
3849 if (gdbarch->frame_chain_valid == 0)
3850 internal_error (__FILE__, __LINE__,
3851 "gdbarch: gdbarch_frame_chain_valid invalid");
3852 if (gdbarch_debug >= 2)
3853 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n");
3854 return gdbarch->frame_chain_valid (chain, thisframe);
3855 }
3856
3857 void
3858 set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
3859 gdbarch_frame_chain_valid_ftype frame_chain_valid)
3860 {
3861 gdbarch->frame_chain_valid = frame_chain_valid;
3862 }
3863
3864 CORE_ADDR
3865 gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
3866 {
3867 if (gdbarch->frame_saved_pc == 0)
3868 internal_error (__FILE__, __LINE__,
3869 "gdbarch: gdbarch_frame_saved_pc invalid");
3870 if (gdbarch_debug >= 2)
3871 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n");
3872 return gdbarch->frame_saved_pc (fi);
3873 }
3874
3875 void
3876 set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
3877 gdbarch_frame_saved_pc_ftype frame_saved_pc)
3878 {
3879 gdbarch->frame_saved_pc = frame_saved_pc;
3880 }
3881
3882 CORE_ADDR
3883 gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
3884 {
3885 if (gdbarch->frame_args_address == 0)
3886 internal_error (__FILE__, __LINE__,
3887 "gdbarch: gdbarch_frame_args_address invalid");
3888 if (gdbarch_debug >= 2)
3889 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n");
3890 return gdbarch->frame_args_address (fi);
3891 }
3892
3893 void
3894 set_gdbarch_frame_args_address (struct gdbarch *gdbarch,
3895 gdbarch_frame_args_address_ftype frame_args_address)
3896 {
3897 gdbarch->frame_args_address = frame_args_address;
3898 }
3899
3900 CORE_ADDR
3901 gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
3902 {
3903 if (gdbarch->frame_locals_address == 0)
3904 internal_error (__FILE__, __LINE__,
3905 "gdbarch: gdbarch_frame_locals_address invalid");
3906 if (gdbarch_debug >= 2)
3907 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n");
3908 return gdbarch->frame_locals_address (fi);
3909 }
3910
3911 void
3912 set_gdbarch_frame_locals_address (struct gdbarch *gdbarch,
3913 gdbarch_frame_locals_address_ftype frame_locals_address)
3914 {
3915 gdbarch->frame_locals_address = frame_locals_address;
3916 }
3917
3918 CORE_ADDR
3919 gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
3920 {
3921 if (gdbarch->saved_pc_after_call == 0)
3922 internal_error (__FILE__, __LINE__,
3923 "gdbarch: gdbarch_saved_pc_after_call invalid");
3924 if (gdbarch_debug >= 2)
3925 fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n");
3926 return gdbarch->saved_pc_after_call (frame);
3927 }
3928
3929 void
3930 set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch,
3931 gdbarch_saved_pc_after_call_ftype saved_pc_after_call)
3932 {
3933 gdbarch->saved_pc_after_call = saved_pc_after_call;
3934 }
3935
3936 int
3937 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
3938 {
3939 if (gdbarch->frame_num_args == 0)
3940 internal_error (__FILE__, __LINE__,
3941 "gdbarch: gdbarch_frame_num_args invalid");
3942 if (gdbarch_debug >= 2)
3943 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
3944 return gdbarch->frame_num_args (frame);
3945 }
3946
3947 void
3948 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
3949 gdbarch_frame_num_args_ftype frame_num_args)
3950 {
3951 gdbarch->frame_num_args = frame_num_args;
3952 }
3953
3954 int
3955 gdbarch_stack_align_p (struct gdbarch *gdbarch)
3956 {
3957 return gdbarch->stack_align != 0;
3958 }
3959
3960 CORE_ADDR
3961 gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
3962 {
3963 if (gdbarch->stack_align == 0)
3964 internal_error (__FILE__, __LINE__,
3965 "gdbarch: gdbarch_stack_align invalid");
3966 if (gdbarch_debug >= 2)
3967 fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n");
3968 return gdbarch->stack_align (sp);
3969 }
3970
3971 void
3972 set_gdbarch_stack_align (struct gdbarch *gdbarch,
3973 gdbarch_stack_align_ftype stack_align)
3974 {
3975 gdbarch->stack_align = stack_align;
3976 }
3977
3978 int
3979 gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
3980 {
3981 /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
3982 if (gdbarch_debug >= 2)
3983 fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n");
3984 return gdbarch->extra_stack_alignment_needed;
3985 }
3986
3987 void
3988 set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch,
3989 int extra_stack_alignment_needed)
3990 {
3991 gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed;
3992 }
3993
3994 int
3995 gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
3996 {
3997 return gdbarch->reg_struct_has_addr != 0;
3998 }
3999
4000 int
4001 gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
4002 {
4003 if (gdbarch->reg_struct_has_addr == 0)
4004 internal_error (__FILE__, __LINE__,
4005 "gdbarch: gdbarch_reg_struct_has_addr invalid");
4006 if (gdbarch_debug >= 2)
4007 fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n");
4008 return gdbarch->reg_struct_has_addr (gcc_p, type);
4009 }
4010
4011 void
4012 set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
4013 gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr)
4014 {
4015 gdbarch->reg_struct_has_addr = reg_struct_has_addr;
4016 }
4017
4018 int
4019 gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
4020 {
4021 return gdbarch->save_dummy_frame_tos != 0;
4022 }
4023
4024 void
4025 gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
4026 {
4027 if (gdbarch->save_dummy_frame_tos == 0)
4028 internal_error (__FILE__, __LINE__,
4029 "gdbarch: gdbarch_save_dummy_frame_tos invalid");
4030 if (gdbarch_debug >= 2)
4031 fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n");
4032 gdbarch->save_dummy_frame_tos (sp);
4033 }
4034
4035 void
4036 set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
4037 gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos)
4038 {
4039 gdbarch->save_dummy_frame_tos = save_dummy_frame_tos;
4040 }
4041
4042 int
4043 gdbarch_parm_boundary (struct gdbarch *gdbarch)
4044 {
4045 if (gdbarch_debug >= 2)
4046 fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n");
4047 return gdbarch->parm_boundary;
4048 }
4049
4050 void
4051 set_gdbarch_parm_boundary (struct gdbarch *gdbarch,
4052 int parm_boundary)
4053 {
4054 gdbarch->parm_boundary = parm_boundary;
4055 }
4056
4057 const struct floatformat *
4058 gdbarch_float_format (struct gdbarch *gdbarch)
4059 {
4060 if (gdbarch_debug >= 2)
4061 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
4062 return gdbarch->float_format;
4063 }
4064
4065 void
4066 set_gdbarch_float_format (struct gdbarch *gdbarch,
4067 const struct floatformat * float_format)
4068 {
4069 gdbarch->float_format = float_format;
4070 }
4071
4072 const struct floatformat *
4073 gdbarch_double_format (struct gdbarch *gdbarch)
4074 {
4075 if (gdbarch_debug >= 2)
4076 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
4077 return gdbarch->double_format;
4078 }
4079
4080 void
4081 set_gdbarch_double_format (struct gdbarch *gdbarch,
4082 const struct floatformat * double_format)
4083 {
4084 gdbarch->double_format = double_format;
4085 }
4086
4087 const struct floatformat *
4088 gdbarch_long_double_format (struct gdbarch *gdbarch)
4089 {
4090 if (gdbarch_debug >= 2)
4091 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
4092 return gdbarch->long_double_format;
4093 }
4094
4095 void
4096 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
4097 const struct floatformat * long_double_format)
4098 {
4099 gdbarch->long_double_format = long_double_format;
4100 }
4101
4102 CORE_ADDR
4103 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
4104 {
4105 if (gdbarch->convert_from_func_ptr_addr == 0)
4106 internal_error (__FILE__, __LINE__,
4107 "gdbarch: gdbarch_convert_from_func_ptr_addr invalid");
4108 if (gdbarch_debug >= 2)
4109 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
4110 return gdbarch->convert_from_func_ptr_addr (addr);
4111 }
4112
4113 void
4114 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
4115 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
4116 {
4117 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
4118 }
4119
4120 CORE_ADDR
4121 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
4122 {
4123 if (gdbarch->addr_bits_remove == 0)
4124 internal_error (__FILE__, __LINE__,
4125 "gdbarch: gdbarch_addr_bits_remove invalid");
4126 if (gdbarch_debug >= 2)
4127 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
4128 return gdbarch->addr_bits_remove (addr);
4129 }
4130
4131 void
4132 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
4133 gdbarch_addr_bits_remove_ftype addr_bits_remove)
4134 {
4135 gdbarch->addr_bits_remove = addr_bits_remove;
4136 }
4137
4138 int
4139 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
4140 {
4141 return gdbarch->software_single_step != 0;
4142 }
4143
4144 void
4145 gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
4146 {
4147 if (gdbarch->software_single_step == 0)
4148 internal_error (__FILE__, __LINE__,
4149 "gdbarch: gdbarch_software_single_step invalid");
4150 if (gdbarch_debug >= 2)
4151 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
4152 gdbarch->software_single_step (sig, insert_breakpoints_p);
4153 }
4154
4155 void
4156 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
4157 gdbarch_software_single_step_ftype software_single_step)
4158 {
4159 gdbarch->software_single_step = software_single_step;
4160 }
4161
4162 int
4163 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info)
4164 {
4165 if (gdbarch->print_insn == 0)
4166 internal_error (__FILE__, __LINE__,
4167 "gdbarch: gdbarch_print_insn invalid");
4168 if (gdbarch_debug >= 2)
4169 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
4170 return gdbarch->print_insn (vma, info);
4171 }
4172
4173 void
4174 set_gdbarch_print_insn (struct gdbarch *gdbarch,
4175 gdbarch_print_insn_ftype print_insn)
4176 {
4177 gdbarch->print_insn = print_insn;
4178 }
4179
4180 CORE_ADDR
4181 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
4182 {
4183 if (gdbarch->skip_trampoline_code == 0)
4184 internal_error (__FILE__, __LINE__,
4185 "gdbarch: gdbarch_skip_trampoline_code invalid");
4186 if (gdbarch_debug >= 2)
4187 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
4188 return gdbarch->skip_trampoline_code (pc);
4189 }
4190
4191 void
4192 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
4193 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
4194 {
4195 gdbarch->skip_trampoline_code = skip_trampoline_code;
4196 }
4197
4198
4199 /* Keep a registry of per-architecture data-pointers required by GDB
4200 modules. */
4201
4202 struct gdbarch_data
4203 {
4204 unsigned index;
4205 gdbarch_data_init_ftype *init;
4206 gdbarch_data_free_ftype *free;
4207 };
4208
4209 struct gdbarch_data_registration
4210 {
4211 struct gdbarch_data *data;
4212 struct gdbarch_data_registration *next;
4213 };
4214
4215 struct gdbarch_data_registry
4216 {
4217 unsigned nr;
4218 struct gdbarch_data_registration *registrations;
4219 };
4220
4221 struct gdbarch_data_registry gdbarch_data_registry =
4222 {
4223 0, NULL,
4224 };
4225
4226 struct gdbarch_data *
4227 register_gdbarch_data (gdbarch_data_init_ftype *init,
4228 gdbarch_data_free_ftype *free)
4229 {
4230 struct gdbarch_data_registration **curr;
4231 for (curr = &gdbarch_data_registry.registrations;
4232 (*curr) != NULL;
4233 curr = &(*curr)->next);
4234 (*curr) = XMALLOC (struct gdbarch_data_registration);
4235 (*curr)->next = NULL;
4236 (*curr)->data = XMALLOC (struct gdbarch_data);
4237 (*curr)->data->index = gdbarch_data_registry.nr++;
4238 (*curr)->data->init = init;
4239 (*curr)->data->free = free;
4240 return (*curr)->data;
4241 }
4242
4243
4244 /* Walk through all the registered users initializing each in turn. */
4245
4246 static void
4247 init_gdbarch_data (struct gdbarch *gdbarch)
4248 {
4249 struct gdbarch_data_registration *rego;
4250 for (rego = gdbarch_data_registry.registrations;
4251 rego != NULL;
4252 rego = rego->next)
4253 {
4254 struct gdbarch_data *data = rego->data;
4255 gdb_assert (data->index < gdbarch->nr_data);
4256 if (data->init != NULL)
4257 {
4258 void *pointer = data->init (gdbarch);
4259 set_gdbarch_data (gdbarch, data, pointer);
4260 }
4261 }
4262 }
4263
4264 /* Create/delete the gdbarch data vector. */
4265
4266 static void
4267 alloc_gdbarch_data (struct gdbarch *gdbarch)
4268 {
4269 gdb_assert (gdbarch->data == NULL);
4270 gdbarch->nr_data = gdbarch_data_registry.nr;
4271 gdbarch->data = xcalloc (gdbarch->nr_data, sizeof (void*));
4272 }
4273
4274 static void
4275 free_gdbarch_data (struct gdbarch *gdbarch)
4276 {
4277 struct gdbarch_data_registration *rego;
4278 gdb_assert (gdbarch->data != NULL);
4279 for (rego = gdbarch_data_registry.registrations;
4280 rego != NULL;
4281 rego = rego->next)
4282 {
4283 struct gdbarch_data *data = rego->data;
4284 gdb_assert (data->index < gdbarch->nr_data);
4285 if (data->free != NULL && gdbarch->data[data->index] != NULL)
4286 {
4287 data->free (gdbarch, gdbarch->data[data->index]);
4288 gdbarch->data[data->index] = NULL;
4289 }
4290 }
4291 xfree (gdbarch->data);
4292 gdbarch->data = NULL;
4293 }
4294
4295
4296 /* Initialize the current value of thee specified per-architecture
4297 data-pointer. */
4298
4299 void
4300 set_gdbarch_data (struct gdbarch *gdbarch,
4301 struct gdbarch_data *data,
4302 void *pointer)
4303 {
4304 gdb_assert (data->index < gdbarch->nr_data);
4305 if (data->free != NULL && gdbarch->data[data->index] != NULL)
4306 data->free (gdbarch, gdbarch->data[data->index]);
4307 gdbarch->data[data->index] = pointer;
4308 }
4309
4310 /* Return the current value of the specified per-architecture
4311 data-pointer. */
4312
4313 void *
4314 gdbarch_data (struct gdbarch_data *data)
4315 {
4316 gdb_assert (data->index < current_gdbarch->nr_data);
4317 return current_gdbarch->data[data->index];
4318 }
4319
4320
4321
4322 /* Keep a registry of swapped data required by GDB modules. */
4323
4324 struct gdbarch_swap
4325 {
4326 void *swap;
4327 struct gdbarch_swap_registration *source;
4328 struct gdbarch_swap *next;
4329 };
4330
4331 struct gdbarch_swap_registration
4332 {
4333 void *data;
4334 unsigned long sizeof_data;
4335 gdbarch_swap_ftype *init;
4336 struct gdbarch_swap_registration *next;
4337 };
4338
4339 struct gdbarch_swap_registry
4340 {
4341 int nr;
4342 struct gdbarch_swap_registration *registrations;
4343 };
4344
4345 struct gdbarch_swap_registry gdbarch_swap_registry =
4346 {
4347 0, NULL,
4348 };
4349
4350 void
4351 register_gdbarch_swap (void *data,
4352 unsigned long sizeof_data,
4353 gdbarch_swap_ftype *init)
4354 {
4355 struct gdbarch_swap_registration **rego;
4356 for (rego = &gdbarch_swap_registry.registrations;
4357 (*rego) != NULL;
4358 rego = &(*rego)->next);
4359 (*rego) = XMALLOC (struct gdbarch_swap_registration);
4360 (*rego)->next = NULL;
4361 (*rego)->init = init;
4362 (*rego)->data = data;
4363 (*rego)->sizeof_data = sizeof_data;
4364 }
4365
4366
4367 static void
4368 init_gdbarch_swap (struct gdbarch *gdbarch)
4369 {
4370 struct gdbarch_swap_registration *rego;
4371 struct gdbarch_swap **curr = &gdbarch->swap;
4372 for (rego = gdbarch_swap_registry.registrations;
4373 rego != NULL;
4374 rego = rego->next)
4375 {
4376 if (rego->data != NULL)
4377 {
4378 (*curr) = XMALLOC (struct gdbarch_swap);
4379 (*curr)->source = rego;
4380 (*curr)->swap = xmalloc (rego->sizeof_data);
4381 (*curr)->next = NULL;
4382 memset (rego->data, 0, rego->sizeof_data);
4383 curr = &(*curr)->next;
4384 }
4385 if (rego->init != NULL)
4386 rego->init ();
4387 }
4388 }
4389
4390 static void
4391 swapout_gdbarch_swap (struct gdbarch *gdbarch)
4392 {
4393 struct gdbarch_swap *curr;
4394 for (curr = gdbarch->swap;
4395 curr != NULL;
4396 curr = curr->next)
4397 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
4398 }
4399
4400 static void
4401 swapin_gdbarch_swap (struct gdbarch *gdbarch)
4402 {
4403 struct gdbarch_swap *curr;
4404 for (curr = gdbarch->swap;
4405 curr != NULL;
4406 curr = curr->next)
4407 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
4408 }
4409
4410
4411 /* Keep a registry of the architectures known by GDB. */
4412
4413 struct gdbarch_registration
4414 {
4415 enum bfd_architecture bfd_architecture;
4416 gdbarch_init_ftype *init;
4417 gdbarch_dump_tdep_ftype *dump_tdep;
4418 struct gdbarch_list *arches;
4419 struct gdbarch_registration *next;
4420 };
4421
4422 static struct gdbarch_registration *gdbarch_registry = NULL;
4423
4424 static void
4425 append_name (const char ***buf, int *nr, const char *name)
4426 {
4427 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
4428 (*buf)[*nr] = name;
4429 *nr += 1;
4430 }
4431
4432 const char **
4433 gdbarch_printable_names (void)
4434 {
4435 if (GDB_MULTI_ARCH)
4436 {
4437 /* Accumulate a list of names based on the registed list of
4438 architectures. */
4439 enum bfd_architecture a;
4440 int nr_arches = 0;
4441 const char **arches = NULL;
4442 struct gdbarch_registration *rego;
4443 for (rego = gdbarch_registry;
4444 rego != NULL;
4445 rego = rego->next)
4446 {
4447 const struct bfd_arch_info *ap;
4448 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
4449 if (ap == NULL)
4450 internal_error (__FILE__, __LINE__,
4451 "gdbarch_architecture_names: multi-arch unknown");
4452 do
4453 {
4454 append_name (&arches, &nr_arches, ap->printable_name);
4455 ap = ap->next;
4456 }
4457 while (ap != NULL);
4458 }
4459 append_name (&arches, &nr_arches, NULL);
4460 return arches;
4461 }
4462 else
4463 /* Just return all the architectures that BFD knows. Assume that
4464 the legacy architecture framework supports them. */
4465 return bfd_arch_list ();
4466 }
4467
4468
4469 void
4470 gdbarch_register (enum bfd_architecture bfd_architecture,
4471 gdbarch_init_ftype *init,
4472 gdbarch_dump_tdep_ftype *dump_tdep)
4473 {
4474 struct gdbarch_registration **curr;
4475 const struct bfd_arch_info *bfd_arch_info;
4476 /* Check that BFD recognizes this architecture */
4477 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
4478 if (bfd_arch_info == NULL)
4479 {
4480 internal_error (__FILE__, __LINE__,
4481 "gdbarch: Attempt to register unknown architecture (%d)",
4482 bfd_architecture);
4483 }
4484 /* Check that we haven't seen this architecture before */
4485 for (curr = &gdbarch_registry;
4486 (*curr) != NULL;
4487 curr = &(*curr)->next)
4488 {
4489 if (bfd_architecture == (*curr)->bfd_architecture)
4490 internal_error (__FILE__, __LINE__,
4491 "gdbarch: Duplicate registraration of architecture (%s)",
4492 bfd_arch_info->printable_name);
4493 }
4494 /* log it */
4495 if (gdbarch_debug)
4496 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
4497 bfd_arch_info->printable_name,
4498 (long) init);
4499 /* Append it */
4500 (*curr) = XMALLOC (struct gdbarch_registration);
4501 (*curr)->bfd_architecture = bfd_architecture;
4502 (*curr)->init = init;
4503 (*curr)->dump_tdep = dump_tdep;
4504 (*curr)->arches = NULL;
4505 (*curr)->next = NULL;
4506 /* When non- multi-arch, install whatever target dump routine we've
4507 been provided - hopefully that routine has been written correctly
4508 and works regardless of multi-arch. */
4509 if (!GDB_MULTI_ARCH && dump_tdep != NULL
4510 && startup_gdbarch.dump_tdep == NULL)
4511 startup_gdbarch.dump_tdep = dump_tdep;
4512 }
4513
4514 void
4515 register_gdbarch_init (enum bfd_architecture bfd_architecture,
4516 gdbarch_init_ftype *init)
4517 {
4518 gdbarch_register (bfd_architecture, init, NULL);
4519 }
4520
4521
4522 /* Look for an architecture using gdbarch_info. Base search on only
4523 BFD_ARCH_INFO and BYTE_ORDER. */
4524
4525 struct gdbarch_list *
4526 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
4527 const struct gdbarch_info *info)
4528 {
4529 for (; arches != NULL; arches = arches->next)
4530 {
4531 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
4532 continue;
4533 if (info->byte_order != arches->gdbarch->byte_order)
4534 continue;
4535 return arches;
4536 }
4537 return NULL;
4538 }
4539
4540
4541 /* Update the current architecture. Return ZERO if the update request
4542 failed. */
4543
4544 int
4545 gdbarch_update_p (struct gdbarch_info info)
4546 {
4547 struct gdbarch *new_gdbarch;
4548 struct gdbarch_list **list;
4549 struct gdbarch_registration *rego;
4550
4551 /* Fill in missing parts of the INFO struct using a number of
4552 sources: ``set ...''; INFOabfd supplied; existing target. */
4553
4554 /* ``(gdb) set architecture ...'' */
4555 if (info.bfd_arch_info == NULL
4556 && !TARGET_ARCHITECTURE_AUTO)
4557 info.bfd_arch_info = TARGET_ARCHITECTURE;
4558 if (info.bfd_arch_info == NULL
4559 && info.abfd != NULL
4560 && bfd_get_arch (info.abfd) != bfd_arch_unknown
4561 && bfd_get_arch (info.abfd) != bfd_arch_obscure)
4562 info.bfd_arch_info = bfd_get_arch_info (info.abfd);
4563 if (info.bfd_arch_info == NULL)
4564 info.bfd_arch_info = TARGET_ARCHITECTURE;
4565
4566 /* ``(gdb) set byte-order ...'' */
4567 if (info.byte_order == 0
4568 && !TARGET_BYTE_ORDER_AUTO)
4569 info.byte_order = TARGET_BYTE_ORDER;
4570 /* From the INFO struct. */
4571 if (info.byte_order == 0
4572 && info.abfd != NULL)
4573 info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
4574 : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN
4575 : 0);
4576 /* From the current target. */
4577 if (info.byte_order == 0)
4578 info.byte_order = TARGET_BYTE_ORDER;
4579
4580 /* Must have found some sort of architecture. */
4581 gdb_assert (info.bfd_arch_info != NULL);
4582
4583 if (gdbarch_debug)
4584 {
4585 fprintf_unfiltered (gdb_stdlog,
4586 "gdbarch_update: info.bfd_arch_info %s\n",
4587 (info.bfd_arch_info != NULL
4588 ? info.bfd_arch_info->printable_name
4589 : "(null)"));
4590 fprintf_unfiltered (gdb_stdlog,
4591 "gdbarch_update: info.byte_order %d (%s)\n",
4592 info.byte_order,
4593 (info.byte_order == BIG_ENDIAN ? "big"
4594 : info.byte_order == LITTLE_ENDIAN ? "little"
4595 : "default"));
4596 fprintf_unfiltered (gdb_stdlog,
4597 "gdbarch_update: info.abfd 0x%lx\n",
4598 (long) info.abfd);
4599 fprintf_unfiltered (gdb_stdlog,
4600 "gdbarch_update: info.tdep_info 0x%lx\n",
4601 (long) info.tdep_info);
4602 }
4603
4604 /* Find the target that knows about this architecture. */
4605 for (rego = gdbarch_registry;
4606 rego != NULL;
4607 rego = rego->next)
4608 if (rego->bfd_architecture == info.bfd_arch_info->arch)
4609 break;
4610 if (rego == NULL)
4611 {
4612 if (gdbarch_debug)
4613 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n");
4614 return 0;
4615 }
4616
4617 /* Ask the target for a replacement architecture. */
4618 new_gdbarch = rego->init (info, rego->arches);
4619
4620 /* Did the target like it? No. Reject the change. */
4621 if (new_gdbarch == NULL)
4622 {
4623 if (gdbarch_debug)
4624 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n");
4625 return 0;
4626 }
4627
4628 /* Did the architecture change? No. Do nothing. */
4629 if (current_gdbarch == new_gdbarch)
4630 {
4631 if (gdbarch_debug)
4632 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
4633 (long) new_gdbarch,
4634 new_gdbarch->bfd_arch_info->printable_name);
4635 return 1;
4636 }
4637
4638 /* Swap all data belonging to the old target out */
4639 swapout_gdbarch_swap (current_gdbarch);
4640
4641 /* Is this a pre-existing architecture? Yes. Swap it in. */
4642 for (list = &rego->arches;
4643 (*list) != NULL;
4644 list = &(*list)->next)
4645 {
4646 if ((*list)->gdbarch == new_gdbarch)
4647 {
4648 if (gdbarch_debug)
4649 fprintf_unfiltered (gdb_stdlog,
4650 "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
4651 (long) new_gdbarch,
4652 new_gdbarch->bfd_arch_info->printable_name);
4653 current_gdbarch = new_gdbarch;
4654 swapin_gdbarch_swap (new_gdbarch);
4655 architecture_changed_event ();
4656 return 1;
4657 }
4658 }
4659
4660 /* Append this new architecture to this targets list. */
4661 (*list) = XMALLOC (struct gdbarch_list);
4662 (*list)->next = NULL;
4663 (*list)->gdbarch = new_gdbarch;
4664
4665 /* Switch to this new architecture. Dump it out. */
4666 current_gdbarch = new_gdbarch;
4667 if (gdbarch_debug)
4668 {
4669 fprintf_unfiltered (gdb_stdlog,
4670 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
4671 (long) new_gdbarch,
4672 new_gdbarch->bfd_arch_info->printable_name);
4673 }
4674
4675 /* Check that the newly installed architecture is valid. Plug in
4676 any post init values. */
4677 new_gdbarch->dump_tdep = rego->dump_tdep;
4678 verify_gdbarch (new_gdbarch);
4679
4680 /* Initialize the per-architecture memory (swap) areas.
4681 CURRENT_GDBARCH must be update before these modules are
4682 called. */
4683 init_gdbarch_swap (new_gdbarch);
4684
4685 /* Initialize the per-architecture data-pointer of all parties that
4686 registered an interest in this architecture. CURRENT_GDBARCH
4687 must be updated before these modules are called. */
4688 init_gdbarch_data (new_gdbarch);
4689 architecture_changed_event ();
4690
4691 if (gdbarch_debug)
4692 gdbarch_dump (current_gdbarch, gdb_stdlog);
4693
4694 return 1;
4695 }
4696
4697
4698 /* Disassembler */
4699
4700 /* Pointer to the target-dependent disassembly function. */
4701 int (*tm_print_insn) (bfd_vma, disassemble_info *);
4702 disassemble_info tm_print_insn_info;
4703
4704
4705 extern void _initialize_gdbarch (void);
4706
4707 void
4708 _initialize_gdbarch (void)
4709 {
4710 struct cmd_list_element *c;
4711
4712 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
4713 tm_print_insn_info.flavour = bfd_target_unknown_flavour;
4714 tm_print_insn_info.read_memory_func = dis_asm_read_memory;
4715 tm_print_insn_info.memory_error_func = dis_asm_memory_error;
4716 tm_print_insn_info.print_address_func = dis_asm_print_address;
4717
4718 add_show_from_set (add_set_cmd ("arch",
4719 class_maintenance,
4720 var_zinteger,
4721 (char *)&gdbarch_debug,
4722 "Set architecture debugging.\n\
4723 When non-zero, architecture debugging is enabled.", &setdebuglist),
4724 &showdebuglist);
4725 c = add_set_cmd ("archdebug",
4726 class_maintenance,
4727 var_zinteger,
4728 (char *)&gdbarch_debug,
4729 "Set architecture debugging.\n\
4730 When non-zero, architecture debugging is enabled.", &setlist);
4731
4732 deprecate_cmd (c, "set debug arch");
4733 deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch");
4734 }
This page took 0.127666 seconds and 4 git commands to generate.