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