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