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