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