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