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