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