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