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