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