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