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