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