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