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