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