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