OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [gdb-5.3/] [gdb/] [gdbarch.c] - Blame information for rev 1765

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.