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