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