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