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