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