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