1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
5 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2007, 2008, 2009 Free Software Foundation, Inc.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 /* This file was created with the aid of ``gdbarch.sh''.
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
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
37 #include "arch-utils.h"
43 #include "floatformat.h"
45 #include "gdb_assert.h"
46 #include "gdb_string.h"
47 #include "reggroups.h"
49 #include "gdb_obstack.h"
53 /* Static function declarations */
55 static void alloc_gdbarch_data (struct gdbarch
*);
57 /* Non-zero if we want to trace architecture code. */
60 #define GDBARCH_DEBUG 0
62 int gdbarch_debug
= GDBARCH_DEBUG
;
64 show_gdbarch_debug (struct ui_file
*file
, int from_tty
,
65 struct cmd_list_element
*c
, const char *value
)
67 fprintf_filtered (file
, _("Architecture debugging is %s.\n"), value
);
71 pformat (const struct floatformat
**format
)
76 /* Just print out one of them - this is only for diagnostics. */
77 return format
[0]->name
;
81 pstring (const char *string
)
89 /* Maintain the struct gdbarch object. */
93 /* Has this architecture been fully initialized? */
96 /* An obstack bound to the lifetime of the architecture. */
97 struct obstack
*obstack
;
99 /* basic architectural information. */
100 const struct bfd_arch_info
* bfd_arch_info
;
102 int byte_order_for_code
;
103 enum gdb_osabi osabi
;
104 const struct target_desc
* target_desc
;
106 /* target specific vector. */
107 struct gdbarch_tdep
*tdep
;
108 gdbarch_dump_tdep_ftype
*dump_tdep
;
110 /* per-architecture data-pointers. */
114 /* per-architecture swap-regions. */
115 struct gdbarch_swap
*swap
;
117 /* Multi-arch values.
119 When extending this structure you must:
123 Declare set/get functions and define the corresponding
126 gdbarch_alloc(): If zero/NULL is not a suitable default,
127 initialize the new field.
129 verify_gdbarch(): Confirm that the target updated the field
132 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
135 ``startup_gdbarch()'': Append an initial value to the static
136 variable (base values on the host's c-type system).
138 get_gdbarch(): Implement the set/get functions (probably using
139 the macro's as shortcuts).
149 const struct floatformat
** half_format
;
151 const struct floatformat
** float_format
;
153 const struct floatformat
** double_format
;
155 const struct floatformat
** long_double_format
;
158 int dwarf2_addr_size
;
160 gdbarch_read_pc_ftype
*read_pc
;
161 gdbarch_write_pc_ftype
*write_pc
;
162 gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
;
163 gdbarch_pseudo_register_read_ftype
*pseudo_register_read
;
164 gdbarch_pseudo_register_read_value_ftype
*pseudo_register_read_value
;
165 gdbarch_pseudo_register_write_ftype
*pseudo_register_write
;
168 gdbarch_ax_pseudo_register_collect_ftype
*ax_pseudo_register_collect
;
169 gdbarch_ax_pseudo_register_push_stack_ftype
*ax_pseudo_register_push_stack
;
174 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
175 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
176 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
177 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
178 gdbarch_register_name_ftype
*register_name
;
179 gdbarch_register_type_ftype
*register_type
;
180 gdbarch_dummy_id_ftype
*dummy_id
;
181 int deprecated_fp_regnum
;
182 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
183 int call_dummy_location
;
184 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
185 gdbarch_print_registers_info_ftype
*print_registers_info
;
186 gdbarch_print_float_info_ftype
*print_float_info
;
187 gdbarch_print_vector_info_ftype
*print_vector_info
;
188 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
189 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
190 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
191 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
192 int believe_pcc_promotion
;
193 gdbarch_convert_register_p_ftype
*convert_register_p
;
194 gdbarch_register_to_value_ftype
*register_to_value
;
195 gdbarch_value_to_register_ftype
*value_to_register
;
196 gdbarch_value_from_register_ftype
*value_from_register
;
197 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
198 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
199 gdbarch_integer_to_address_ftype
*integer_to_address
;
200 gdbarch_return_value_ftype
*return_value
;
201 gdbarch_skip_prologue_ftype
*skip_prologue
;
202 gdbarch_skip_main_prologue_ftype
*skip_main_prologue
;
203 gdbarch_inner_than_ftype
*inner_than
;
204 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
205 gdbarch_remote_breakpoint_from_pc_ftype
*remote_breakpoint_from_pc
;
206 gdbarch_adjust_breakpoint_address_ftype
*adjust_breakpoint_address
;
207 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
208 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
209 CORE_ADDR decr_pc_after_break
;
210 CORE_ADDR deprecated_function_start_offset
;
211 gdbarch_remote_register_number_ftype
*remote_register_number
;
212 gdbarch_fetch_tls_load_module_address_ftype
*fetch_tls_load_module_address
;
213 CORE_ADDR frame_args_skip
;
214 gdbarch_unwind_pc_ftype
*unwind_pc
;
215 gdbarch_unwind_sp_ftype
*unwind_sp
;
216 gdbarch_frame_num_args_ftype
*frame_num_args
;
217 gdbarch_frame_align_ftype
*frame_align
;
218 gdbarch_stabs_argument_has_addr_ftype
*stabs_argument_has_addr
;
219 int frame_red_zone_size
;
220 gdbarch_convert_from_func_ptr_addr_ftype
*convert_from_func_ptr_addr
;
221 gdbarch_addr_bits_remove_ftype
*addr_bits_remove
;
222 gdbarch_smash_text_address_ftype
*smash_text_address
;
223 gdbarch_software_single_step_ftype
*software_single_step
;
224 gdbarch_single_step_through_delay_ftype
*single_step_through_delay
;
225 gdbarch_print_insn_ftype
*print_insn
;
226 gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
;
227 gdbarch_skip_solib_resolver_ftype
*skip_solib_resolver
;
228 gdbarch_in_solib_return_trampoline_ftype
*in_solib_return_trampoline
;
229 gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
;
230 gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
;
231 gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
;
232 int cannot_step_breakpoint
;
233 int have_nonsteppable_watchpoint
;
234 gdbarch_address_class_type_flags_ftype
*address_class_type_flags
;
235 gdbarch_address_class_type_flags_to_name_ftype
*address_class_type_flags_to_name
;
236 gdbarch_address_class_name_to_type_flags_ftype
*address_class_name_to_type_flags
;
237 gdbarch_register_reggroup_p_ftype
*register_reggroup_p
;
238 gdbarch_fetch_pointer_argument_ftype
*fetch_pointer_argument
;
239 gdbarch_regset_from_core_section_ftype
*regset_from_core_section
;
240 struct core_regset_section
* core_regset_sections
;
241 gdbarch_core_xfer_shared_libraries_ftype
*core_xfer_shared_libraries
;
242 gdbarch_core_pid_to_str_ftype
*core_pid_to_str
;
243 const char * gcore_bfd_target
;
244 int vtable_function_descriptors
;
246 gdbarch_skip_permanent_breakpoint_ftype
*skip_permanent_breakpoint
;
247 ULONGEST max_insn_length
;
248 gdbarch_displaced_step_copy_insn_ftype
*displaced_step_copy_insn
;
249 gdbarch_displaced_step_hw_singlestep_ftype
*displaced_step_hw_singlestep
;
250 gdbarch_displaced_step_fixup_ftype
*displaced_step_fixup
;
251 gdbarch_displaced_step_free_closure_ftype
*displaced_step_free_closure
;
252 gdbarch_displaced_step_location_ftype
*displaced_step_location
;
253 gdbarch_relocate_instruction_ftype
*relocate_instruction
;
254 gdbarch_overlay_update_ftype
*overlay_update
;
255 gdbarch_core_read_description_ftype
*core_read_description
;
256 gdbarch_static_transform_name_ftype
*static_transform_name
;
257 int sofun_address_maybe_missing
;
258 gdbarch_process_record_ftype
*process_record
;
259 gdbarch_process_record_signal_ftype
*process_record_signal
;
260 gdbarch_target_signal_from_host_ftype
*target_signal_from_host
;
261 gdbarch_target_signal_to_host_ftype
*target_signal_to_host
;
262 gdbarch_get_siginfo_type_ftype
*get_siginfo_type
;
263 gdbarch_record_special_symbol_ftype
*record_special_symbol
;
264 gdbarch_get_syscall_number_ftype
*get_syscall_number
;
265 int has_global_solist
;
266 int has_global_breakpoints
;
267 gdbarch_has_shared_address_space_ftype
*has_shared_address_space
;
268 gdbarch_fast_tracepoint_valid_at_ftype
*fast_tracepoint_valid_at
;
269 gdbarch_auto_charset_ftype
*auto_charset
;
270 gdbarch_auto_wide_charset_ftype
*auto_wide_charset
;
271 const char * solib_symbols_extension
;
272 int has_dos_based_file_system
;
276 /* The default architecture uses host values (for want of a better
279 extern const struct bfd_arch_info bfd_default_arch_struct
;
281 struct gdbarch startup_gdbarch
=
283 1, /* Always initialized. */
284 NULL
, /* The obstack. */
285 /* basic architecture information. */
286 &bfd_default_arch_struct
, /* bfd_arch_info */
287 BFD_ENDIAN_BIG
, /* byte_order */
288 BFD_ENDIAN_BIG
, /* byte_order_for_code */
289 GDB_OSABI_UNKNOWN
, /* osabi */
291 /* target specific vector and its dump routine. */
293 /*per-architecture data-pointers and swap regions. */
295 /* Multi-arch values */
296 1, /* bits_big_endian */
297 8 * sizeof (short), /* short_bit */
298 8 * sizeof (int), /* int_bit */
299 8 * sizeof (long), /* long_bit */
300 8 * sizeof (LONGEST
), /* long_long_bit */
303 8 * sizeof (float), /* float_bit */
304 0, /* float_format */
305 8 * sizeof (double), /* double_bit */
306 0, /* double_format */
307 8 * sizeof (long double), /* long_double_bit */
308 0, /* long_double_format */
309 8 * sizeof (void*), /* ptr_bit */
310 8 * sizeof (void*), /* addr_bit */
311 sizeof (void*), /* dwarf2_addr_size */
315 legacy_virtual_frame_pointer
, /* virtual_frame_pointer */
316 0, /* pseudo_register_read */
317 0, /* pseudo_register_read_value */
318 0, /* pseudo_register_write */
320 0, /* num_pseudo_regs */
321 0, /* ax_pseudo_register_collect */
322 0, /* ax_pseudo_register_push_stack */
327 no_op_reg_to_regnum
, /* stab_reg_to_regnum */
328 no_op_reg_to_regnum
, /* ecoff_reg_to_regnum */
329 no_op_reg_to_regnum
, /* sdb_reg_to_regnum */
330 no_op_reg_to_regnum
, /* dwarf2_reg_to_regnum */
331 0, /* register_name */
332 0, /* register_type */
334 -1, /* deprecated_fp_regnum */
335 0, /* push_dummy_call */
336 0, /* call_dummy_location */
337 0, /* push_dummy_code */
338 default_print_registers_info
, /* print_registers_info */
339 0, /* print_float_info */
340 0, /* print_vector_info */
341 legacy_register_sim_regno
, /* register_sim_regno */
342 cannot_register_not
, /* cannot_fetch_register */
343 cannot_register_not
, /* cannot_store_register */
344 0, /* get_longjmp_target */
345 0, /* believe_pcc_promotion */
346 generic_convert_register_p
, /* convert_register_p */
347 0, /* register_to_value */
348 0, /* value_to_register */
349 0, /* value_from_register */
350 unsigned_pointer_to_address
, /* pointer_to_address */
351 unsigned_address_to_pointer
, /* address_to_pointer */
352 0, /* integer_to_address */
353 0, /* return_value */
354 0, /* skip_prologue */
355 0, /* skip_main_prologue */
357 0, /* breakpoint_from_pc */
358 default_remote_breakpoint_from_pc
, /* remote_breakpoint_from_pc */
359 0, /* adjust_breakpoint_address */
360 default_memory_insert_breakpoint
, /* memory_insert_breakpoint */
361 default_memory_remove_breakpoint
, /* memory_remove_breakpoint */
362 0, /* decr_pc_after_break */
363 0, /* deprecated_function_start_offset */
364 default_remote_register_number
, /* remote_register_number */
365 0, /* fetch_tls_load_module_address */
366 0, /* frame_args_skip */
369 0, /* frame_num_args */
371 default_stabs_argument_has_addr
, /* stabs_argument_has_addr */
372 0, /* frame_red_zone_size */
373 convert_from_func_ptr_addr_identity
, /* convert_from_func_ptr_addr */
374 core_addr_identity
, /* addr_bits_remove */
375 core_addr_identity
, /* smash_text_address */
376 0, /* software_single_step */
377 0, /* single_step_through_delay */
379 0, /* skip_trampoline_code */
380 generic_skip_solib_resolver
, /* skip_solib_resolver */
381 generic_in_solib_return_trampoline
, /* in_solib_return_trampoline */
382 generic_in_function_epilogue_p
, /* in_function_epilogue_p */
383 0, /* elf_make_msymbol_special */
384 0, /* coff_make_msymbol_special */
385 0, /* cannot_step_breakpoint */
386 0, /* have_nonsteppable_watchpoint */
387 0, /* address_class_type_flags */
388 0, /* address_class_type_flags_to_name */
389 0, /* address_class_name_to_type_flags */
390 default_register_reggroup_p
, /* register_reggroup_p */
391 0, /* fetch_pointer_argument */
392 0, /* regset_from_core_section */
393 0, /* core_regset_sections */
394 0, /* core_xfer_shared_libraries */
395 0, /* core_pid_to_str */
396 0, /* gcore_bfd_target */
397 0, /* vtable_function_descriptors */
398 0, /* vbit_in_delta */
399 0, /* skip_permanent_breakpoint */
400 0, /* max_insn_length */
401 0, /* displaced_step_copy_insn */
402 default_displaced_step_hw_singlestep
, /* displaced_step_hw_singlestep */
403 0, /* displaced_step_fixup */
404 NULL
, /* displaced_step_free_closure */
405 NULL
, /* displaced_step_location */
406 0, /* relocate_instruction */
407 0, /* overlay_update */
408 0, /* core_read_description */
409 0, /* static_transform_name */
410 0, /* sofun_address_maybe_missing */
411 0, /* process_record */
412 0, /* process_record_signal */
413 default_target_signal_from_host
, /* target_signal_from_host */
414 default_target_signal_to_host
, /* target_signal_to_host */
415 0, /* get_siginfo_type */
416 0, /* record_special_symbol */
417 0, /* get_syscall_number */
418 0, /* has_global_solist */
419 0, /* has_global_breakpoints */
420 default_has_shared_address_space
, /* has_shared_address_space */
421 default_fast_tracepoint_valid_at
, /* fast_tracepoint_valid_at */
422 default_auto_charset
, /* auto_charset */
423 default_auto_wide_charset
, /* auto_wide_charset */
424 0, /* solib_symbols_extension */
425 0, /* has_dos_based_file_system */
426 /* startup_gdbarch() */
429 struct gdbarch
*target_gdbarch
= &startup_gdbarch
;
431 /* Create a new ``struct gdbarch'' based on information provided by
432 ``struct gdbarch_info''. */
435 gdbarch_alloc (const struct gdbarch_info
*info
,
436 struct gdbarch_tdep
*tdep
)
438 struct gdbarch
*gdbarch
;
440 /* Create an obstack for allocating all the per-architecture memory,
441 then use that to allocate the architecture vector. */
442 struct obstack
*obstack
= XMALLOC (struct obstack
);
443 obstack_init (obstack
);
444 gdbarch
= obstack_alloc (obstack
, sizeof (*gdbarch
));
445 memset (gdbarch
, 0, sizeof (*gdbarch
));
446 gdbarch
->obstack
= obstack
;
448 alloc_gdbarch_data (gdbarch
);
450 gdbarch
->tdep
= tdep
;
452 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
453 gdbarch
->byte_order
= info
->byte_order
;
454 gdbarch
->byte_order_for_code
= info
->byte_order_for_code
;
455 gdbarch
->osabi
= info
->osabi
;
456 gdbarch
->target_desc
= info
->target_desc
;
458 /* Force the explicit initialization of these. */
459 gdbarch
->bits_big_endian
= (gdbarch
->byte_order
== BFD_ENDIAN_BIG
);
460 gdbarch
->short_bit
= 2*TARGET_CHAR_BIT
;
461 gdbarch
->int_bit
= 4*TARGET_CHAR_BIT
;
462 gdbarch
->long_bit
= 4*TARGET_CHAR_BIT
;
463 gdbarch
->long_long_bit
= 2*gdbarch
->long_bit
;
464 gdbarch
->half_bit
= 2*TARGET_CHAR_BIT
;
465 gdbarch
->float_bit
= 4*TARGET_CHAR_BIT
;
466 gdbarch
->double_bit
= 8*TARGET_CHAR_BIT
;
467 gdbarch
->long_double_bit
= 8*TARGET_CHAR_BIT
;
468 gdbarch
->ptr_bit
= gdbarch
->int_bit
;
469 gdbarch
->char_signed
= -1;
470 gdbarch
->virtual_frame_pointer
= legacy_virtual_frame_pointer
;
471 gdbarch
->num_regs
= -1;
472 gdbarch
->sp_regnum
= -1;
473 gdbarch
->pc_regnum
= -1;
474 gdbarch
->ps_regnum
= -1;
475 gdbarch
->fp0_regnum
= -1;
476 gdbarch
->stab_reg_to_regnum
= no_op_reg_to_regnum
;
477 gdbarch
->ecoff_reg_to_regnum
= no_op_reg_to_regnum
;
478 gdbarch
->sdb_reg_to_regnum
= no_op_reg_to_regnum
;
479 gdbarch
->dwarf2_reg_to_regnum
= no_op_reg_to_regnum
;
480 gdbarch
->deprecated_fp_regnum
= -1;
481 gdbarch
->call_dummy_location
= AT_ENTRY_POINT
;
482 gdbarch
->print_registers_info
= default_print_registers_info
;
483 gdbarch
->register_sim_regno
= legacy_register_sim_regno
;
484 gdbarch
->cannot_fetch_register
= cannot_register_not
;
485 gdbarch
->cannot_store_register
= cannot_register_not
;
486 gdbarch
->convert_register_p
= generic_convert_register_p
;
487 gdbarch
->value_from_register
= default_value_from_register
;
488 gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
489 gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
490 gdbarch
->remote_breakpoint_from_pc
= default_remote_breakpoint_from_pc
;
491 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
492 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
493 gdbarch
->remote_register_number
= default_remote_register_number
;
494 gdbarch
->stabs_argument_has_addr
= default_stabs_argument_has_addr
;
495 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr_identity
;
496 gdbarch
->addr_bits_remove
= core_addr_identity
;
497 gdbarch
->smash_text_address
= core_addr_identity
;
498 gdbarch
->skip_trampoline_code
= generic_skip_trampoline_code
;
499 gdbarch
->skip_solib_resolver
= generic_skip_solib_resolver
;
500 gdbarch
->in_solib_return_trampoline
= generic_in_solib_return_trampoline
;
501 gdbarch
->in_function_epilogue_p
= generic_in_function_epilogue_p
;
502 gdbarch
->elf_make_msymbol_special
= default_elf_make_msymbol_special
;
503 gdbarch
->coff_make_msymbol_special
= default_coff_make_msymbol_special
;
504 gdbarch
->register_reggroup_p
= default_register_reggroup_p
;
505 gdbarch
->displaced_step_hw_singlestep
= default_displaced_step_hw_singlestep
;
506 gdbarch
->displaced_step_fixup
= NULL
;
507 gdbarch
->displaced_step_free_closure
= NULL
;
508 gdbarch
->displaced_step_location
= NULL
;
509 gdbarch
->relocate_instruction
= NULL
;
510 gdbarch
->target_signal_from_host
= default_target_signal_from_host
;
511 gdbarch
->target_signal_to_host
= default_target_signal_to_host
;
512 gdbarch
->has_shared_address_space
= default_has_shared_address_space
;
513 gdbarch
->fast_tracepoint_valid_at
= default_fast_tracepoint_valid_at
;
514 gdbarch
->auto_charset
= default_auto_charset
;
515 gdbarch
->auto_wide_charset
= default_auto_wide_charset
;
516 /* gdbarch_alloc() */
522 /* Allocate extra space using the per-architecture obstack. */
525 gdbarch_obstack_zalloc (struct gdbarch
*arch
, long size
)
527 void *data
= obstack_alloc (arch
->obstack
, size
);
529 memset (data
, 0, size
);
534 /* Free a gdbarch struct. This should never happen in normal
535 operation --- once you've created a gdbarch, you keep it around.
536 However, if an architecture's init function encounters an error
537 building the structure, it may need to clean up a partially
538 constructed gdbarch. */
541 gdbarch_free (struct gdbarch
*arch
)
543 struct obstack
*obstack
;
545 gdb_assert (arch
!= NULL
);
546 gdb_assert (!arch
->initialized_p
);
547 obstack
= arch
->obstack
;
548 obstack_free (obstack
, 0); /* Includes the ARCH. */
553 /* Ensure that all values in a GDBARCH are reasonable. */
556 verify_gdbarch (struct gdbarch
*gdbarch
)
559 struct cleanup
*cleanups
;
563 log
= mem_fileopen ();
564 cleanups
= make_cleanup_ui_file_delete (log
);
566 if (gdbarch
->byte_order
== BFD_ENDIAN_UNKNOWN
)
567 fprintf_unfiltered (log
, "\n\tbyte-order");
568 if (gdbarch
->bfd_arch_info
== NULL
)
569 fprintf_unfiltered (log
, "\n\tbfd_arch_info");
570 /* Check those that need to be defined for the given multi-arch level. */
571 /* Skip verify of bits_big_endian, invalid_p == 0 */
572 /* Skip verify of short_bit, invalid_p == 0 */
573 /* Skip verify of int_bit, invalid_p == 0 */
574 /* Skip verify of long_bit, invalid_p == 0 */
575 /* Skip verify of long_long_bit, invalid_p == 0 */
576 /* Skip verify of half_bit, invalid_p == 0 */
577 if (gdbarch
->half_format
== 0)
578 gdbarch
->half_format
= floatformats_ieee_half
;
579 /* Skip verify of float_bit, invalid_p == 0 */
580 if (gdbarch
->float_format
== 0)
581 gdbarch
->float_format
= floatformats_ieee_single
;
582 /* Skip verify of double_bit, invalid_p == 0 */
583 if (gdbarch
->double_format
== 0)
584 gdbarch
->double_format
= floatformats_ieee_double
;
585 /* Skip verify of long_double_bit, invalid_p == 0 */
586 if (gdbarch
->long_double_format
== 0)
587 gdbarch
->long_double_format
= floatformats_ieee_double
;
588 /* Skip verify of ptr_bit, invalid_p == 0 */
589 if (gdbarch
->addr_bit
== 0)
590 gdbarch
->addr_bit
= gdbarch_ptr_bit (gdbarch
);
591 if (gdbarch
->dwarf2_addr_size
== 0)
592 gdbarch
->dwarf2_addr_size
= gdbarch_ptr_bit (gdbarch
) / TARGET_CHAR_BIT
;
593 if (gdbarch
->char_signed
== -1)
594 gdbarch
->char_signed
= 1;
595 /* Skip verify of read_pc, has predicate. */
596 /* Skip verify of write_pc, has predicate. */
597 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
598 /* Skip verify of pseudo_register_read, has predicate. */
599 /* Skip verify of pseudo_register_read_value, has predicate. */
600 /* Skip verify of pseudo_register_write, has predicate. */
601 if (gdbarch
->num_regs
== -1)
602 fprintf_unfiltered (log
, "\n\tnum_regs");
603 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
604 /* Skip verify of ax_pseudo_register_collect, has predicate. */
605 /* Skip verify of ax_pseudo_register_push_stack, has predicate. */
606 /* Skip verify of sp_regnum, invalid_p == 0 */
607 /* Skip verify of pc_regnum, invalid_p == 0 */
608 /* Skip verify of ps_regnum, invalid_p == 0 */
609 /* Skip verify of fp0_regnum, invalid_p == 0 */
610 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
611 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
612 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
613 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
614 if (gdbarch
->register_name
== 0)
615 fprintf_unfiltered (log
, "\n\tregister_name");
616 /* Skip verify of register_type, has predicate. */
617 /* Skip verify of dummy_id, has predicate. */
618 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
619 /* Skip verify of push_dummy_call, has predicate. */
620 /* Skip verify of call_dummy_location, invalid_p == 0 */
621 /* Skip verify of push_dummy_code, has predicate. */
622 /* Skip verify of print_registers_info, invalid_p == 0 */
623 /* Skip verify of print_float_info, has predicate. */
624 /* Skip verify of print_vector_info, has predicate. */
625 /* Skip verify of register_sim_regno, invalid_p == 0 */
626 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
627 /* Skip verify of cannot_store_register, invalid_p == 0 */
628 /* Skip verify of get_longjmp_target, has predicate. */
629 /* Skip verify of convert_register_p, invalid_p == 0 */
630 /* Skip verify of value_from_register, invalid_p == 0 */
631 /* Skip verify of pointer_to_address, invalid_p == 0 */
632 /* Skip verify of address_to_pointer, invalid_p == 0 */
633 /* Skip verify of integer_to_address, has predicate. */
634 /* Skip verify of return_value, has predicate. */
635 if (gdbarch
->skip_prologue
== 0)
636 fprintf_unfiltered (log
, "\n\tskip_prologue");
637 /* Skip verify of skip_main_prologue, has predicate. */
638 if (gdbarch
->inner_than
== 0)
639 fprintf_unfiltered (log
, "\n\tinner_than");
640 if (gdbarch
->breakpoint_from_pc
== 0)
641 fprintf_unfiltered (log
, "\n\tbreakpoint_from_pc");
642 /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
643 /* Skip verify of adjust_breakpoint_address, has predicate. */
644 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
645 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
646 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
647 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
648 /* Skip verify of remote_register_number, invalid_p == 0 */
649 /* Skip verify of fetch_tls_load_module_address, has predicate. */
650 /* Skip verify of frame_args_skip, invalid_p == 0 */
651 /* Skip verify of unwind_pc, has predicate. */
652 /* Skip verify of unwind_sp, has predicate. */
653 /* Skip verify of frame_num_args, has predicate. */
654 /* Skip verify of frame_align, has predicate. */
655 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
656 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
657 /* Skip verify of addr_bits_remove, invalid_p == 0 */
658 /* Skip verify of smash_text_address, invalid_p == 0 */
659 /* Skip verify of software_single_step, has predicate. */
660 /* Skip verify of single_step_through_delay, has predicate. */
661 if (gdbarch
->print_insn
== 0)
662 fprintf_unfiltered (log
, "\n\tprint_insn");
663 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
664 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
665 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
666 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
667 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
668 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
669 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
670 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
671 /* Skip verify of address_class_type_flags, has predicate. */
672 /* Skip verify of address_class_type_flags_to_name, has predicate. */
673 /* Skip verify of address_class_name_to_type_flags, has predicate. */
674 /* Skip verify of register_reggroup_p, invalid_p == 0 */
675 /* Skip verify of fetch_pointer_argument, has predicate. */
676 /* Skip verify of regset_from_core_section, has predicate. */
677 /* Skip verify of core_xfer_shared_libraries, has predicate. */
678 /* Skip verify of core_pid_to_str, has predicate. */
679 /* Skip verify of gcore_bfd_target, has predicate. */
680 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
681 /* Skip verify of vbit_in_delta, invalid_p == 0 */
682 /* Skip verify of skip_permanent_breakpoint, has predicate. */
683 /* Skip verify of max_insn_length, has predicate. */
684 /* Skip verify of displaced_step_copy_insn, has predicate. */
685 /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
686 /* Skip verify of displaced_step_fixup, has predicate. */
687 if ((! gdbarch
->displaced_step_free_closure
) != (! gdbarch
->displaced_step_copy_insn
))
688 fprintf_unfiltered (log
, "\n\tdisplaced_step_free_closure");
689 if ((! gdbarch
->displaced_step_location
) != (! gdbarch
->displaced_step_copy_insn
))
690 fprintf_unfiltered (log
, "\n\tdisplaced_step_location");
691 /* Skip verify of relocate_instruction, has predicate. */
692 /* Skip verify of overlay_update, has predicate. */
693 /* Skip verify of core_read_description, has predicate. */
694 /* Skip verify of static_transform_name, has predicate. */
695 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
696 /* Skip verify of process_record, has predicate. */
697 /* Skip verify of process_record_signal, has predicate. */
698 /* Skip verify of target_signal_from_host, invalid_p == 0 */
699 /* Skip verify of target_signal_to_host, invalid_p == 0 */
700 /* Skip verify of get_siginfo_type, has predicate. */
701 /* Skip verify of record_special_symbol, has predicate. */
702 /* Skip verify of get_syscall_number, has predicate. */
703 /* Skip verify of has_global_solist, invalid_p == 0 */
704 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
705 /* Skip verify of has_shared_address_space, invalid_p == 0 */
706 /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
707 /* Skip verify of auto_charset, invalid_p == 0 */
708 /* Skip verify of auto_wide_charset, invalid_p == 0 */
709 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
710 buf
= ui_file_xstrdup (log
, &length
);
711 make_cleanup (xfree
, buf
);
713 internal_error (__FILE__
, __LINE__
,
714 _("verify_gdbarch: the following are invalid ...%s"),
716 do_cleanups (cleanups
);
720 /* Print out the details of the current architecture. */
723 gdbarch_dump (struct gdbarch
*gdbarch
, struct ui_file
*file
)
725 const char *gdb_nm_file
= "<not-defined>";
727 #if defined (GDB_NM_FILE)
728 gdb_nm_file
= GDB_NM_FILE
;
730 fprintf_unfiltered (file
,
731 "gdbarch_dump: GDB_NM_FILE = %s\n",
733 fprintf_unfiltered (file
,
734 "gdbarch_dump: addr_bit = %s\n",
735 plongest (gdbarch
->addr_bit
));
736 fprintf_unfiltered (file
,
737 "gdbarch_dump: addr_bits_remove = <%s>\n",
738 host_address_to_string (gdbarch
->addr_bits_remove
));
739 fprintf_unfiltered (file
,
740 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
741 gdbarch_address_class_name_to_type_flags_p (gdbarch
));
742 fprintf_unfiltered (file
,
743 "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
744 host_address_to_string (gdbarch
->address_class_name_to_type_flags
));
745 fprintf_unfiltered (file
,
746 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
747 gdbarch_address_class_type_flags_p (gdbarch
));
748 fprintf_unfiltered (file
,
749 "gdbarch_dump: address_class_type_flags = <%s>\n",
750 host_address_to_string (gdbarch
->address_class_type_flags
));
751 fprintf_unfiltered (file
,
752 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
753 gdbarch_address_class_type_flags_to_name_p (gdbarch
));
754 fprintf_unfiltered (file
,
755 "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
756 host_address_to_string (gdbarch
->address_class_type_flags_to_name
));
757 fprintf_unfiltered (file
,
758 "gdbarch_dump: address_to_pointer = <%s>\n",
759 host_address_to_string (gdbarch
->address_to_pointer
));
760 fprintf_unfiltered (file
,
761 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
762 gdbarch_adjust_breakpoint_address_p (gdbarch
));
763 fprintf_unfiltered (file
,
764 "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
765 host_address_to_string (gdbarch
->adjust_breakpoint_address
));
766 fprintf_unfiltered (file
,
767 "gdbarch_dump: auto_charset = <%s>\n",
768 host_address_to_string (gdbarch
->auto_charset
));
769 fprintf_unfiltered (file
,
770 "gdbarch_dump: auto_wide_charset = <%s>\n",
771 host_address_to_string (gdbarch
->auto_wide_charset
));
772 fprintf_unfiltered (file
,
773 "gdbarch_dump: gdbarch_ax_pseudo_register_collect_p() = %d\n",
774 gdbarch_ax_pseudo_register_collect_p (gdbarch
));
775 fprintf_unfiltered (file
,
776 "gdbarch_dump: ax_pseudo_register_collect = <%s>\n",
777 host_address_to_string (gdbarch
->ax_pseudo_register_collect
));
778 fprintf_unfiltered (file
,
779 "gdbarch_dump: gdbarch_ax_pseudo_register_push_stack_p() = %d\n",
780 gdbarch_ax_pseudo_register_push_stack_p (gdbarch
));
781 fprintf_unfiltered (file
,
782 "gdbarch_dump: ax_pseudo_register_push_stack = <%s>\n",
783 host_address_to_string (gdbarch
->ax_pseudo_register_push_stack
));
784 fprintf_unfiltered (file
,
785 "gdbarch_dump: believe_pcc_promotion = %s\n",
786 plongest (gdbarch
->believe_pcc_promotion
));
787 fprintf_unfiltered (file
,
788 "gdbarch_dump: bfd_arch_info = %s\n",
789 gdbarch_bfd_arch_info (gdbarch
)->printable_name
);
790 fprintf_unfiltered (file
,
791 "gdbarch_dump: bits_big_endian = %s\n",
792 plongest (gdbarch
->bits_big_endian
));
793 fprintf_unfiltered (file
,
794 "gdbarch_dump: breakpoint_from_pc = <%s>\n",
795 host_address_to_string (gdbarch
->breakpoint_from_pc
));
796 fprintf_unfiltered (file
,
797 "gdbarch_dump: byte_order = %s\n",
798 plongest (gdbarch
->byte_order
));
799 fprintf_unfiltered (file
,
800 "gdbarch_dump: byte_order_for_code = %s\n",
801 plongest (gdbarch
->byte_order_for_code
));
802 fprintf_unfiltered (file
,
803 "gdbarch_dump: call_dummy_location = %s\n",
804 plongest (gdbarch
->call_dummy_location
));
805 fprintf_unfiltered (file
,
806 "gdbarch_dump: cannot_fetch_register = <%s>\n",
807 host_address_to_string (gdbarch
->cannot_fetch_register
));
808 fprintf_unfiltered (file
,
809 "gdbarch_dump: cannot_step_breakpoint = %s\n",
810 plongest (gdbarch
->cannot_step_breakpoint
));
811 fprintf_unfiltered (file
,
812 "gdbarch_dump: cannot_store_register = <%s>\n",
813 host_address_to_string (gdbarch
->cannot_store_register
));
814 fprintf_unfiltered (file
,
815 "gdbarch_dump: char_signed = %s\n",
816 plongest (gdbarch
->char_signed
));
817 fprintf_unfiltered (file
,
818 "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
819 host_address_to_string (gdbarch
->coff_make_msymbol_special
));
820 fprintf_unfiltered (file
,
821 "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
822 host_address_to_string (gdbarch
->convert_from_func_ptr_addr
));
823 fprintf_unfiltered (file
,
824 "gdbarch_dump: convert_register_p = <%s>\n",
825 host_address_to_string (gdbarch
->convert_register_p
));
826 fprintf_unfiltered (file
,
827 "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
828 gdbarch_core_pid_to_str_p (gdbarch
));
829 fprintf_unfiltered (file
,
830 "gdbarch_dump: core_pid_to_str = <%s>\n",
831 host_address_to_string (gdbarch
->core_pid_to_str
));
832 fprintf_unfiltered (file
,
833 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
834 gdbarch_core_read_description_p (gdbarch
));
835 fprintf_unfiltered (file
,
836 "gdbarch_dump: core_read_description = <%s>\n",
837 host_address_to_string (gdbarch
->core_read_description
));
838 fprintf_unfiltered (file
,
839 "gdbarch_dump: core_regset_sections = %s\n",
840 host_address_to_string (gdbarch
->core_regset_sections
));
841 fprintf_unfiltered (file
,
842 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
843 gdbarch_core_xfer_shared_libraries_p (gdbarch
));
844 fprintf_unfiltered (file
,
845 "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
846 host_address_to_string (gdbarch
->core_xfer_shared_libraries
));
847 fprintf_unfiltered (file
,
848 "gdbarch_dump: decr_pc_after_break = %s\n",
849 core_addr_to_string_nz (gdbarch
->decr_pc_after_break
));
850 fprintf_unfiltered (file
,
851 "gdbarch_dump: deprecated_fp_regnum = %s\n",
852 plongest (gdbarch
->deprecated_fp_regnum
));
853 fprintf_unfiltered (file
,
854 "gdbarch_dump: deprecated_function_start_offset = %s\n",
855 core_addr_to_string_nz (gdbarch
->deprecated_function_start_offset
));
856 fprintf_unfiltered (file
,
857 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
858 gdbarch_displaced_step_copy_insn_p (gdbarch
));
859 fprintf_unfiltered (file
,
860 "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
861 host_address_to_string (gdbarch
->displaced_step_copy_insn
));
862 fprintf_unfiltered (file
,
863 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
864 gdbarch_displaced_step_fixup_p (gdbarch
));
865 fprintf_unfiltered (file
,
866 "gdbarch_dump: displaced_step_fixup = <%s>\n",
867 host_address_to_string (gdbarch
->displaced_step_fixup
));
868 fprintf_unfiltered (file
,
869 "gdbarch_dump: displaced_step_free_closure = <%s>\n",
870 host_address_to_string (gdbarch
->displaced_step_free_closure
));
871 fprintf_unfiltered (file
,
872 "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
873 host_address_to_string (gdbarch
->displaced_step_hw_singlestep
));
874 fprintf_unfiltered (file
,
875 "gdbarch_dump: displaced_step_location = <%s>\n",
876 host_address_to_string (gdbarch
->displaced_step_location
));
877 fprintf_unfiltered (file
,
878 "gdbarch_dump: double_bit = %s\n",
879 plongest (gdbarch
->double_bit
));
880 fprintf_unfiltered (file
,
881 "gdbarch_dump: double_format = %s\n",
882 pformat (gdbarch
->double_format
));
883 fprintf_unfiltered (file
,
884 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
885 gdbarch_dummy_id_p (gdbarch
));
886 fprintf_unfiltered (file
,
887 "gdbarch_dump: dummy_id = <%s>\n",
888 host_address_to_string (gdbarch
->dummy_id
));
889 fprintf_unfiltered (file
,
890 "gdbarch_dump: dwarf2_addr_size = %s\n",
891 plongest (gdbarch
->dwarf2_addr_size
));
892 fprintf_unfiltered (file
,
893 "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
894 host_address_to_string (gdbarch
->dwarf2_reg_to_regnum
));
895 fprintf_unfiltered (file
,
896 "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
897 host_address_to_string (gdbarch
->ecoff_reg_to_regnum
));
898 fprintf_unfiltered (file
,
899 "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
900 host_address_to_string (gdbarch
->elf_make_msymbol_special
));
901 fprintf_unfiltered (file
,
902 "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
903 host_address_to_string (gdbarch
->fast_tracepoint_valid_at
));
904 fprintf_unfiltered (file
,
905 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
906 gdbarch_fetch_pointer_argument_p (gdbarch
));
907 fprintf_unfiltered (file
,
908 "gdbarch_dump: fetch_pointer_argument = <%s>\n",
909 host_address_to_string (gdbarch
->fetch_pointer_argument
));
910 fprintf_unfiltered (file
,
911 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
912 gdbarch_fetch_tls_load_module_address_p (gdbarch
));
913 fprintf_unfiltered (file
,
914 "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
915 host_address_to_string (gdbarch
->fetch_tls_load_module_address
));
916 fprintf_unfiltered (file
,
917 "gdbarch_dump: float_bit = %s\n",
918 plongest (gdbarch
->float_bit
));
919 fprintf_unfiltered (file
,
920 "gdbarch_dump: float_format = %s\n",
921 pformat (gdbarch
->float_format
));
922 fprintf_unfiltered (file
,
923 "gdbarch_dump: fp0_regnum = %s\n",
924 plongest (gdbarch
->fp0_regnum
));
925 fprintf_unfiltered (file
,
926 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
927 gdbarch_frame_align_p (gdbarch
));
928 fprintf_unfiltered (file
,
929 "gdbarch_dump: frame_align = <%s>\n",
930 host_address_to_string (gdbarch
->frame_align
));
931 fprintf_unfiltered (file
,
932 "gdbarch_dump: frame_args_skip = %s\n",
933 core_addr_to_string_nz (gdbarch
->frame_args_skip
));
934 fprintf_unfiltered (file
,
935 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
936 gdbarch_frame_num_args_p (gdbarch
));
937 fprintf_unfiltered (file
,
938 "gdbarch_dump: frame_num_args = <%s>\n",
939 host_address_to_string (gdbarch
->frame_num_args
));
940 fprintf_unfiltered (file
,
941 "gdbarch_dump: frame_red_zone_size = %s\n",
942 plongest (gdbarch
->frame_red_zone_size
));
943 fprintf_unfiltered (file
,
944 "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
945 gdbarch_gcore_bfd_target_p (gdbarch
));
946 fprintf_unfiltered (file
,
947 "gdbarch_dump: gcore_bfd_target = %s\n",
948 gdbarch
->gcore_bfd_target
);
949 fprintf_unfiltered (file
,
950 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
951 gdbarch_get_longjmp_target_p (gdbarch
));
952 fprintf_unfiltered (file
,
953 "gdbarch_dump: get_longjmp_target = <%s>\n",
954 host_address_to_string (gdbarch
->get_longjmp_target
));
955 fprintf_unfiltered (file
,
956 "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
957 gdbarch_get_siginfo_type_p (gdbarch
));
958 fprintf_unfiltered (file
,
959 "gdbarch_dump: get_siginfo_type = <%s>\n",
960 host_address_to_string (gdbarch
->get_siginfo_type
));
961 fprintf_unfiltered (file
,
962 "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
963 gdbarch_get_syscall_number_p (gdbarch
));
964 fprintf_unfiltered (file
,
965 "gdbarch_dump: get_syscall_number = <%s>\n",
966 host_address_to_string (gdbarch
->get_syscall_number
));
967 fprintf_unfiltered (file
,
968 "gdbarch_dump: half_bit = %s\n",
969 plongest (gdbarch
->half_bit
));
970 fprintf_unfiltered (file
,
971 "gdbarch_dump: half_format = %s\n",
972 pformat (gdbarch
->half_format
));
973 fprintf_unfiltered (file
,
974 "gdbarch_dump: has_dos_based_file_system = %s\n",
975 plongest (gdbarch
->has_dos_based_file_system
));
976 fprintf_unfiltered (file
,
977 "gdbarch_dump: has_global_breakpoints = %s\n",
978 plongest (gdbarch
->has_global_breakpoints
));
979 fprintf_unfiltered (file
,
980 "gdbarch_dump: has_global_solist = %s\n",
981 plongest (gdbarch
->has_global_solist
));
982 fprintf_unfiltered (file
,
983 "gdbarch_dump: has_shared_address_space = <%s>\n",
984 host_address_to_string (gdbarch
->has_shared_address_space
));
985 fprintf_unfiltered (file
,
986 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
987 plongest (gdbarch
->have_nonsteppable_watchpoint
));
988 fprintf_unfiltered (file
,
989 "gdbarch_dump: in_function_epilogue_p = <%s>\n",
990 host_address_to_string (gdbarch
->in_function_epilogue_p
));
991 fprintf_unfiltered (file
,
992 "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
993 host_address_to_string (gdbarch
->in_solib_return_trampoline
));
994 fprintf_unfiltered (file
,
995 "gdbarch_dump: inner_than = <%s>\n",
996 host_address_to_string (gdbarch
->inner_than
));
997 fprintf_unfiltered (file
,
998 "gdbarch_dump: int_bit = %s\n",
999 plongest (gdbarch
->int_bit
));
1000 fprintf_unfiltered (file
,
1001 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1002 gdbarch_integer_to_address_p (gdbarch
));
1003 fprintf_unfiltered (file
,
1004 "gdbarch_dump: integer_to_address = <%s>\n",
1005 host_address_to_string (gdbarch
->integer_to_address
));
1006 fprintf_unfiltered (file
,
1007 "gdbarch_dump: long_bit = %s\n",
1008 plongest (gdbarch
->long_bit
));
1009 fprintf_unfiltered (file
,
1010 "gdbarch_dump: long_double_bit = %s\n",
1011 plongest (gdbarch
->long_double_bit
));
1012 fprintf_unfiltered (file
,
1013 "gdbarch_dump: long_double_format = %s\n",
1014 pformat (gdbarch
->long_double_format
));
1015 fprintf_unfiltered (file
,
1016 "gdbarch_dump: long_long_bit = %s\n",
1017 plongest (gdbarch
->long_long_bit
));
1018 fprintf_unfiltered (file
,
1019 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
1020 gdbarch_max_insn_length_p (gdbarch
));
1021 fprintf_unfiltered (file
,
1022 "gdbarch_dump: max_insn_length = %s\n",
1023 plongest (gdbarch
->max_insn_length
));
1024 fprintf_unfiltered (file
,
1025 "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
1026 host_address_to_string (gdbarch
->memory_insert_breakpoint
));
1027 fprintf_unfiltered (file
,
1028 "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
1029 host_address_to_string (gdbarch
->memory_remove_breakpoint
));
1030 fprintf_unfiltered (file
,
1031 "gdbarch_dump: num_pseudo_regs = %s\n",
1032 plongest (gdbarch
->num_pseudo_regs
));
1033 fprintf_unfiltered (file
,
1034 "gdbarch_dump: num_regs = %s\n",
1035 plongest (gdbarch
->num_regs
));
1036 fprintf_unfiltered (file
,
1037 "gdbarch_dump: osabi = %s\n",
1038 plongest (gdbarch
->osabi
));
1039 fprintf_unfiltered (file
,
1040 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
1041 gdbarch_overlay_update_p (gdbarch
));
1042 fprintf_unfiltered (file
,
1043 "gdbarch_dump: overlay_update = <%s>\n",
1044 host_address_to_string (gdbarch
->overlay_update
));
1045 fprintf_unfiltered (file
,
1046 "gdbarch_dump: pc_regnum = %s\n",
1047 plongest (gdbarch
->pc_regnum
));
1048 fprintf_unfiltered (file
,
1049 "gdbarch_dump: pointer_to_address = <%s>\n",
1050 host_address_to_string (gdbarch
->pointer_to_address
));
1051 fprintf_unfiltered (file
,
1052 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1053 gdbarch_print_float_info_p (gdbarch
));
1054 fprintf_unfiltered (file
,
1055 "gdbarch_dump: print_float_info = <%s>\n",
1056 host_address_to_string (gdbarch
->print_float_info
));
1057 fprintf_unfiltered (file
,
1058 "gdbarch_dump: print_insn = <%s>\n",
1059 host_address_to_string (gdbarch
->print_insn
));
1060 fprintf_unfiltered (file
,
1061 "gdbarch_dump: print_registers_info = <%s>\n",
1062 host_address_to_string (gdbarch
->print_registers_info
));
1063 fprintf_unfiltered (file
,
1064 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1065 gdbarch_print_vector_info_p (gdbarch
));
1066 fprintf_unfiltered (file
,
1067 "gdbarch_dump: print_vector_info = <%s>\n",
1068 host_address_to_string (gdbarch
->print_vector_info
));
1069 fprintf_unfiltered (file
,
1070 "gdbarch_dump: gdbarch_process_record_p() = %d\n",
1071 gdbarch_process_record_p (gdbarch
));
1072 fprintf_unfiltered (file
,
1073 "gdbarch_dump: process_record = <%s>\n",
1074 host_address_to_string (gdbarch
->process_record
));
1075 fprintf_unfiltered (file
,
1076 "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
1077 gdbarch_process_record_signal_p (gdbarch
));
1078 fprintf_unfiltered (file
,
1079 "gdbarch_dump: process_record_signal = <%s>\n",
1080 host_address_to_string (gdbarch
->process_record_signal
));
1081 fprintf_unfiltered (file
,
1082 "gdbarch_dump: ps_regnum = %s\n",
1083 plongest (gdbarch
->ps_regnum
));
1084 fprintf_unfiltered (file
,
1085 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1086 gdbarch_pseudo_register_read_p (gdbarch
));
1087 fprintf_unfiltered (file
,
1088 "gdbarch_dump: pseudo_register_read = <%s>\n",
1089 host_address_to_string (gdbarch
->pseudo_register_read
));
1090 fprintf_unfiltered (file
,
1091 "gdbarch_dump: gdbarch_pseudo_register_read_value_p() = %d\n",
1092 gdbarch_pseudo_register_read_value_p (gdbarch
));
1093 fprintf_unfiltered (file
,
1094 "gdbarch_dump: pseudo_register_read_value = <%s>\n",
1095 host_address_to_string (gdbarch
->pseudo_register_read_value
));
1096 fprintf_unfiltered (file
,
1097 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1098 gdbarch_pseudo_register_write_p (gdbarch
));
1099 fprintf_unfiltered (file
,
1100 "gdbarch_dump: pseudo_register_write = <%s>\n",
1101 host_address_to_string (gdbarch
->pseudo_register_write
));
1102 fprintf_unfiltered (file
,
1103 "gdbarch_dump: ptr_bit = %s\n",
1104 plongest (gdbarch
->ptr_bit
));
1105 fprintf_unfiltered (file
,
1106 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1107 gdbarch_push_dummy_call_p (gdbarch
));
1108 fprintf_unfiltered (file
,
1109 "gdbarch_dump: push_dummy_call = <%s>\n",
1110 host_address_to_string (gdbarch
->push_dummy_call
));
1111 fprintf_unfiltered (file
,
1112 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1113 gdbarch_push_dummy_code_p (gdbarch
));
1114 fprintf_unfiltered (file
,
1115 "gdbarch_dump: push_dummy_code = <%s>\n",
1116 host_address_to_string (gdbarch
->push_dummy_code
));
1117 fprintf_unfiltered (file
,
1118 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1119 gdbarch_read_pc_p (gdbarch
));
1120 fprintf_unfiltered (file
,
1121 "gdbarch_dump: read_pc = <%s>\n",
1122 host_address_to_string (gdbarch
->read_pc
));
1123 fprintf_unfiltered (file
,
1124 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
1125 gdbarch_record_special_symbol_p (gdbarch
));
1126 fprintf_unfiltered (file
,
1127 "gdbarch_dump: record_special_symbol = <%s>\n",
1128 host_address_to_string (gdbarch
->record_special_symbol
));
1129 fprintf_unfiltered (file
,
1130 "gdbarch_dump: register_name = <%s>\n",
1131 host_address_to_string (gdbarch
->register_name
));
1132 fprintf_unfiltered (file
,
1133 "gdbarch_dump: register_reggroup_p = <%s>\n",
1134 host_address_to_string (gdbarch
->register_reggroup_p
));
1135 fprintf_unfiltered (file
,
1136 "gdbarch_dump: register_sim_regno = <%s>\n",
1137 host_address_to_string (gdbarch
->register_sim_regno
));
1138 fprintf_unfiltered (file
,
1139 "gdbarch_dump: register_to_value = <%s>\n",
1140 host_address_to_string (gdbarch
->register_to_value
));
1141 fprintf_unfiltered (file
,
1142 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1143 gdbarch_register_type_p (gdbarch
));
1144 fprintf_unfiltered (file
,
1145 "gdbarch_dump: register_type = <%s>\n",
1146 host_address_to_string (gdbarch
->register_type
));
1147 fprintf_unfiltered (file
,
1148 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1149 gdbarch_regset_from_core_section_p (gdbarch
));
1150 fprintf_unfiltered (file
,
1151 "gdbarch_dump: regset_from_core_section = <%s>\n",
1152 host_address_to_string (gdbarch
->regset_from_core_section
));
1153 fprintf_unfiltered (file
,
1154 "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n",
1155 gdbarch_relocate_instruction_p (gdbarch
));
1156 fprintf_unfiltered (file
,
1157 "gdbarch_dump: relocate_instruction = <%s>\n",
1158 host_address_to_string (gdbarch
->relocate_instruction
));
1159 fprintf_unfiltered (file
,
1160 "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
1161 host_address_to_string (gdbarch
->remote_breakpoint_from_pc
));
1162 fprintf_unfiltered (file
,
1163 "gdbarch_dump: remote_register_number = <%s>\n",
1164 host_address_to_string (gdbarch
->remote_register_number
));
1165 fprintf_unfiltered (file
,
1166 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1167 gdbarch_return_value_p (gdbarch
));
1168 fprintf_unfiltered (file
,
1169 "gdbarch_dump: return_value = <%s>\n",
1170 host_address_to_string (gdbarch
->return_value
));
1171 fprintf_unfiltered (file
,
1172 "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
1173 host_address_to_string (gdbarch
->sdb_reg_to_regnum
));
1174 fprintf_unfiltered (file
,
1175 "gdbarch_dump: short_bit = %s\n",
1176 plongest (gdbarch
->short_bit
));
1177 fprintf_unfiltered (file
,
1178 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1179 gdbarch_single_step_through_delay_p (gdbarch
));
1180 fprintf_unfiltered (file
,
1181 "gdbarch_dump: single_step_through_delay = <%s>\n",
1182 host_address_to_string (gdbarch
->single_step_through_delay
));
1183 fprintf_unfiltered (file
,
1184 "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
1185 gdbarch_skip_main_prologue_p (gdbarch
));
1186 fprintf_unfiltered (file
,
1187 "gdbarch_dump: skip_main_prologue = <%s>\n",
1188 host_address_to_string (gdbarch
->skip_main_prologue
));
1189 fprintf_unfiltered (file
,
1190 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1191 gdbarch_skip_permanent_breakpoint_p (gdbarch
));
1192 fprintf_unfiltered (file
,
1193 "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
1194 host_address_to_string (gdbarch
->skip_permanent_breakpoint
));
1195 fprintf_unfiltered (file
,
1196 "gdbarch_dump: skip_prologue = <%s>\n",
1197 host_address_to_string (gdbarch
->skip_prologue
));
1198 fprintf_unfiltered (file
,
1199 "gdbarch_dump: skip_solib_resolver = <%s>\n",
1200 host_address_to_string (gdbarch
->skip_solib_resolver
));
1201 fprintf_unfiltered (file
,
1202 "gdbarch_dump: skip_trampoline_code = <%s>\n",
1203 host_address_to_string (gdbarch
->skip_trampoline_code
));
1204 fprintf_unfiltered (file
,
1205 "gdbarch_dump: smash_text_address = <%s>\n",
1206 host_address_to_string (gdbarch
->smash_text_address
));
1207 fprintf_unfiltered (file
,
1208 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1209 gdbarch_software_single_step_p (gdbarch
));
1210 fprintf_unfiltered (file
,
1211 "gdbarch_dump: software_single_step = <%s>\n",
1212 host_address_to_string (gdbarch
->software_single_step
));
1213 fprintf_unfiltered (file
,
1214 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1215 plongest (gdbarch
->sofun_address_maybe_missing
));
1216 fprintf_unfiltered (file
,
1217 "gdbarch_dump: solib_symbols_extension = %s\n",
1218 pstring (gdbarch
->solib_symbols_extension
));
1219 fprintf_unfiltered (file
,
1220 "gdbarch_dump: sp_regnum = %s\n",
1221 plongest (gdbarch
->sp_regnum
));
1222 fprintf_unfiltered (file
,
1223 "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
1224 host_address_to_string (gdbarch
->stab_reg_to_regnum
));
1225 fprintf_unfiltered (file
,
1226 "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
1227 host_address_to_string (gdbarch
->stabs_argument_has_addr
));
1228 fprintf_unfiltered (file
,
1229 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1230 gdbarch_static_transform_name_p (gdbarch
));
1231 fprintf_unfiltered (file
,
1232 "gdbarch_dump: static_transform_name = <%s>\n",
1233 host_address_to_string (gdbarch
->static_transform_name
));
1234 fprintf_unfiltered (file
,
1235 "gdbarch_dump: target_desc = %s\n",
1236 host_address_to_string (gdbarch
->target_desc
));
1237 fprintf_unfiltered (file
,
1238 "gdbarch_dump: target_signal_from_host = <%s>\n",
1239 host_address_to_string (gdbarch
->target_signal_from_host
));
1240 fprintf_unfiltered (file
,
1241 "gdbarch_dump: target_signal_to_host = <%s>\n",
1242 host_address_to_string (gdbarch
->target_signal_to_host
));
1243 fprintf_unfiltered (file
,
1244 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1245 gdbarch_unwind_pc_p (gdbarch
));
1246 fprintf_unfiltered (file
,
1247 "gdbarch_dump: unwind_pc = <%s>\n",
1248 host_address_to_string (gdbarch
->unwind_pc
));
1249 fprintf_unfiltered (file
,
1250 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1251 gdbarch_unwind_sp_p (gdbarch
));
1252 fprintf_unfiltered (file
,
1253 "gdbarch_dump: unwind_sp = <%s>\n",
1254 host_address_to_string (gdbarch
->unwind_sp
));
1255 fprintf_unfiltered (file
,
1256 "gdbarch_dump: value_from_register = <%s>\n",
1257 host_address_to_string (gdbarch
->value_from_register
));
1258 fprintf_unfiltered (file
,
1259 "gdbarch_dump: value_to_register = <%s>\n",
1260 host_address_to_string (gdbarch
->value_to_register
));
1261 fprintf_unfiltered (file
,
1262 "gdbarch_dump: vbit_in_delta = %s\n",
1263 plongest (gdbarch
->vbit_in_delta
));
1264 fprintf_unfiltered (file
,
1265 "gdbarch_dump: virtual_frame_pointer = <%s>\n",
1266 host_address_to_string (gdbarch
->virtual_frame_pointer
));
1267 fprintf_unfiltered (file
,
1268 "gdbarch_dump: vtable_function_descriptors = %s\n",
1269 plongest (gdbarch
->vtable_function_descriptors
));
1270 fprintf_unfiltered (file
,
1271 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1272 gdbarch_write_pc_p (gdbarch
));
1273 fprintf_unfiltered (file
,
1274 "gdbarch_dump: write_pc = <%s>\n",
1275 host_address_to_string (gdbarch
->write_pc
));
1276 if (gdbarch
->dump_tdep
!= NULL
)
1277 gdbarch
->dump_tdep (gdbarch
, file
);
1280 struct gdbarch_tdep
*
1281 gdbarch_tdep (struct gdbarch
*gdbarch
)
1283 if (gdbarch_debug
>= 2)
1284 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1285 return gdbarch
->tdep
;
1289 const struct bfd_arch_info
*
1290 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1292 gdb_assert (gdbarch
!= NULL
);
1293 if (gdbarch_debug
>= 2)
1294 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1295 return gdbarch
->bfd_arch_info
;
1299 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1301 gdb_assert (gdbarch
!= NULL
);
1302 if (gdbarch_debug
>= 2)
1303 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1304 return gdbarch
->byte_order
;
1308 gdbarch_byte_order_for_code (struct gdbarch
*gdbarch
)
1310 gdb_assert (gdbarch
!= NULL
);
1311 if (gdbarch_debug
>= 2)
1312 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order_for_code called\n");
1313 return gdbarch
->byte_order_for_code
;
1317 gdbarch_osabi (struct gdbarch
*gdbarch
)
1319 gdb_assert (gdbarch
!= NULL
);
1320 if (gdbarch_debug
>= 2)
1321 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1322 return gdbarch
->osabi
;
1325 const struct target_desc
*
1326 gdbarch_target_desc (struct gdbarch
*gdbarch
)
1328 gdb_assert (gdbarch
!= NULL
);
1329 if (gdbarch_debug
>= 2)
1330 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_desc called\n");
1331 return gdbarch
->target_desc
;
1335 gdbarch_bits_big_endian (struct gdbarch
*gdbarch
)
1337 gdb_assert (gdbarch
!= NULL
);
1338 /* Skip verify of bits_big_endian, invalid_p == 0 */
1339 if (gdbarch_debug
>= 2)
1340 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bits_big_endian called\n");
1341 return gdbarch
->bits_big_endian
;
1345 set_gdbarch_bits_big_endian (struct gdbarch
*gdbarch
,
1346 int bits_big_endian
)
1348 gdbarch
->bits_big_endian
= bits_big_endian
;
1352 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1354 gdb_assert (gdbarch
!= NULL
);
1355 /* Skip verify of short_bit, invalid_p == 0 */
1356 if (gdbarch_debug
>= 2)
1357 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1358 return gdbarch
->short_bit
;
1362 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1365 gdbarch
->short_bit
= short_bit
;
1369 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1371 gdb_assert (gdbarch
!= NULL
);
1372 /* Skip verify of int_bit, invalid_p == 0 */
1373 if (gdbarch_debug
>= 2)
1374 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1375 return gdbarch
->int_bit
;
1379 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1382 gdbarch
->int_bit
= int_bit
;
1386 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1388 gdb_assert (gdbarch
!= NULL
);
1389 /* Skip verify of long_bit, invalid_p == 0 */
1390 if (gdbarch_debug
>= 2)
1391 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1392 return gdbarch
->long_bit
;
1396 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1399 gdbarch
->long_bit
= long_bit
;
1403 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1405 gdb_assert (gdbarch
!= NULL
);
1406 /* Skip verify of long_long_bit, invalid_p == 0 */
1407 if (gdbarch_debug
>= 2)
1408 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1409 return gdbarch
->long_long_bit
;
1413 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1416 gdbarch
->long_long_bit
= long_long_bit
;
1420 gdbarch_half_bit (struct gdbarch
*gdbarch
)
1422 gdb_assert (gdbarch
!= NULL
);
1423 /* Skip verify of half_bit, invalid_p == 0 */
1424 if (gdbarch_debug
>= 2)
1425 fprintf_unfiltered (gdb_stdlog
, "gdbarch_half_bit called\n");
1426 return gdbarch
->half_bit
;
1430 set_gdbarch_half_bit (struct gdbarch
*gdbarch
,
1433 gdbarch
->half_bit
= half_bit
;
1436 const struct floatformat
**
1437 gdbarch_half_format (struct gdbarch
*gdbarch
)
1439 gdb_assert (gdbarch
!= NULL
);
1440 if (gdbarch_debug
>= 2)
1441 fprintf_unfiltered (gdb_stdlog
, "gdbarch_half_format called\n");
1442 return gdbarch
->half_format
;
1446 set_gdbarch_half_format (struct gdbarch
*gdbarch
,
1447 const struct floatformat
** half_format
)
1449 gdbarch
->half_format
= half_format
;
1453 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1455 gdb_assert (gdbarch
!= NULL
);
1456 /* Skip verify of float_bit, invalid_p == 0 */
1457 if (gdbarch_debug
>= 2)
1458 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1459 return gdbarch
->float_bit
;
1463 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1466 gdbarch
->float_bit
= float_bit
;
1469 const struct floatformat
**
1470 gdbarch_float_format (struct gdbarch
*gdbarch
)
1472 gdb_assert (gdbarch
!= NULL
);
1473 if (gdbarch_debug
>= 2)
1474 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
1475 return gdbarch
->float_format
;
1479 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
1480 const struct floatformat
** float_format
)
1482 gdbarch
->float_format
= float_format
;
1486 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1488 gdb_assert (gdbarch
!= NULL
);
1489 /* Skip verify of double_bit, invalid_p == 0 */
1490 if (gdbarch_debug
>= 2)
1491 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1492 return gdbarch
->double_bit
;
1496 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1499 gdbarch
->double_bit
= double_bit
;
1502 const struct floatformat
**
1503 gdbarch_double_format (struct gdbarch
*gdbarch
)
1505 gdb_assert (gdbarch
!= NULL
);
1506 if (gdbarch_debug
>= 2)
1507 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
1508 return gdbarch
->double_format
;
1512 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
1513 const struct floatformat
** double_format
)
1515 gdbarch
->double_format
= double_format
;
1519 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1521 gdb_assert (gdbarch
!= NULL
);
1522 /* Skip verify of long_double_bit, invalid_p == 0 */
1523 if (gdbarch_debug
>= 2)
1524 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1525 return gdbarch
->long_double_bit
;
1529 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1530 int long_double_bit
)
1532 gdbarch
->long_double_bit
= long_double_bit
;
1535 const struct floatformat
**
1536 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
1538 gdb_assert (gdbarch
!= NULL
);
1539 if (gdbarch_debug
>= 2)
1540 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
1541 return gdbarch
->long_double_format
;
1545 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
1546 const struct floatformat
** long_double_format
)
1548 gdbarch
->long_double_format
= long_double_format
;
1552 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1554 gdb_assert (gdbarch
!= NULL
);
1555 /* Skip verify of ptr_bit, invalid_p == 0 */
1556 if (gdbarch_debug
>= 2)
1557 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1558 return gdbarch
->ptr_bit
;
1562 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1565 gdbarch
->ptr_bit
= ptr_bit
;
1569 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1571 gdb_assert (gdbarch
!= NULL
);
1572 /* Check variable changed from pre-default. */
1573 gdb_assert (gdbarch
->addr_bit
!= 0);
1574 if (gdbarch_debug
>= 2)
1575 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1576 return gdbarch
->addr_bit
;
1580 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1583 gdbarch
->addr_bit
= addr_bit
;
1587 gdbarch_dwarf2_addr_size (struct gdbarch
*gdbarch
)
1589 gdb_assert (gdbarch
!= NULL
);
1590 /* Check variable changed from pre-default. */
1591 gdb_assert (gdbarch
->dwarf2_addr_size
!= 0);
1592 if (gdbarch_debug
>= 2)
1593 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_addr_size called\n");
1594 return gdbarch
->dwarf2_addr_size
;
1598 set_gdbarch_dwarf2_addr_size (struct gdbarch
*gdbarch
,
1599 int dwarf2_addr_size
)
1601 gdbarch
->dwarf2_addr_size
= dwarf2_addr_size
;
1605 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1607 gdb_assert (gdbarch
!= NULL
);
1608 /* Check variable changed from pre-default. */
1609 gdb_assert (gdbarch
->char_signed
!= -1);
1610 if (gdbarch_debug
>= 2)
1611 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1612 return gdbarch
->char_signed
;
1616 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1619 gdbarch
->char_signed
= char_signed
;
1623 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1625 gdb_assert (gdbarch
!= NULL
);
1626 return gdbarch
->read_pc
!= NULL
;
1630 gdbarch_read_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
1632 gdb_assert (gdbarch
!= NULL
);
1633 gdb_assert (gdbarch
->read_pc
!= NULL
);
1634 if (gdbarch_debug
>= 2)
1635 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1636 return gdbarch
->read_pc (regcache
);
1640 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1641 gdbarch_read_pc_ftype read_pc
)
1643 gdbarch
->read_pc
= read_pc
;
1647 gdbarch_write_pc_p (struct gdbarch
*gdbarch
)
1649 gdb_assert (gdbarch
!= NULL
);
1650 return gdbarch
->write_pc
!= NULL
;
1654 gdbarch_write_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR val
)
1656 gdb_assert (gdbarch
!= NULL
);
1657 gdb_assert (gdbarch
->write_pc
!= NULL
);
1658 if (gdbarch_debug
>= 2)
1659 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1660 gdbarch
->write_pc (regcache
, val
);
1664 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1665 gdbarch_write_pc_ftype write_pc
)
1667 gdbarch
->write_pc
= write_pc
;
1671 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1673 gdb_assert (gdbarch
!= NULL
);
1674 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1675 if (gdbarch_debug
>= 2)
1676 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1677 gdbarch
->virtual_frame_pointer (gdbarch
, pc
, frame_regnum
, frame_offset
);
1681 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1682 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1684 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1688 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1690 gdb_assert (gdbarch
!= NULL
);
1691 return gdbarch
->pseudo_register_read
!= NULL
;
1694 enum register_status
1695 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, gdb_byte
*buf
)
1697 gdb_assert (gdbarch
!= NULL
);
1698 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
1699 if (gdbarch_debug
>= 2)
1700 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
1701 return gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
1705 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
1706 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
1708 gdbarch
->pseudo_register_read
= pseudo_register_read
;
1712 gdbarch_pseudo_register_read_value_p (struct gdbarch
*gdbarch
)
1714 gdb_assert (gdbarch
!= NULL
);
1715 return gdbarch
->pseudo_register_read_value
!= NULL
;
1719 gdbarch_pseudo_register_read_value (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
)
1721 gdb_assert (gdbarch
!= NULL
);
1722 gdb_assert (gdbarch
->pseudo_register_read_value
!= NULL
);
1723 if (gdbarch_debug
>= 2)
1724 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read_value called\n");
1725 return gdbarch
->pseudo_register_read_value (gdbarch
, regcache
, cookednum
);
1729 set_gdbarch_pseudo_register_read_value (struct gdbarch
*gdbarch
,
1730 gdbarch_pseudo_register_read_value_ftype pseudo_register_read_value
)
1732 gdbarch
->pseudo_register_read_value
= pseudo_register_read_value
;
1736 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
1738 gdb_assert (gdbarch
!= NULL
);
1739 return gdbarch
->pseudo_register_write
!= NULL
;
1743 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const gdb_byte
*buf
)
1745 gdb_assert (gdbarch
!= NULL
);
1746 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
1747 if (gdbarch_debug
>= 2)
1748 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
1749 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
1753 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
1754 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
1756 gdbarch
->pseudo_register_write
= pseudo_register_write
;
1760 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1762 gdb_assert (gdbarch
!= NULL
);
1763 /* Check variable changed from pre-default. */
1764 gdb_assert (gdbarch
->num_regs
!= -1);
1765 if (gdbarch_debug
>= 2)
1766 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1767 return gdbarch
->num_regs
;
1771 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1774 gdbarch
->num_regs
= num_regs
;
1778 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
1780 gdb_assert (gdbarch
!= NULL
);
1781 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1782 if (gdbarch_debug
>= 2)
1783 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
1784 return gdbarch
->num_pseudo_regs
;
1788 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
1789 int num_pseudo_regs
)
1791 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
1795 gdbarch_ax_pseudo_register_collect_p (struct gdbarch
*gdbarch
)
1797 gdb_assert (gdbarch
!= NULL
);
1798 return gdbarch
->ax_pseudo_register_collect
!= NULL
;
1802 gdbarch_ax_pseudo_register_collect (struct gdbarch
*gdbarch
, struct agent_expr
*ax
, int reg
)
1804 gdb_assert (gdbarch
!= NULL
);
1805 gdb_assert (gdbarch
->ax_pseudo_register_collect
!= NULL
);
1806 if (gdbarch_debug
>= 2)
1807 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ax_pseudo_register_collect called\n");
1808 return gdbarch
->ax_pseudo_register_collect (gdbarch
, ax
, reg
);
1812 set_gdbarch_ax_pseudo_register_collect (struct gdbarch
*gdbarch
,
1813 gdbarch_ax_pseudo_register_collect_ftype ax_pseudo_register_collect
)
1815 gdbarch
->ax_pseudo_register_collect
= ax_pseudo_register_collect
;
1819 gdbarch_ax_pseudo_register_push_stack_p (struct gdbarch
*gdbarch
)
1821 gdb_assert (gdbarch
!= NULL
);
1822 return gdbarch
->ax_pseudo_register_push_stack
!= NULL
;
1826 gdbarch_ax_pseudo_register_push_stack (struct gdbarch
*gdbarch
, struct agent_expr
*ax
, int reg
)
1828 gdb_assert (gdbarch
!= NULL
);
1829 gdb_assert (gdbarch
->ax_pseudo_register_push_stack
!= NULL
);
1830 if (gdbarch_debug
>= 2)
1831 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ax_pseudo_register_push_stack called\n");
1832 return gdbarch
->ax_pseudo_register_push_stack (gdbarch
, ax
, reg
);
1836 set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch
*gdbarch
,
1837 gdbarch_ax_pseudo_register_push_stack_ftype ax_pseudo_register_push_stack
)
1839 gdbarch
->ax_pseudo_register_push_stack
= ax_pseudo_register_push_stack
;
1843 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1845 gdb_assert (gdbarch
!= NULL
);
1846 /* Skip verify of sp_regnum, invalid_p == 0 */
1847 if (gdbarch_debug
>= 2)
1848 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1849 return gdbarch
->sp_regnum
;
1853 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1856 gdbarch
->sp_regnum
= sp_regnum
;
1860 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1862 gdb_assert (gdbarch
!= NULL
);
1863 /* Skip verify of pc_regnum, invalid_p == 0 */
1864 if (gdbarch_debug
>= 2)
1865 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1866 return gdbarch
->pc_regnum
;
1870 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1873 gdbarch
->pc_regnum
= pc_regnum
;
1877 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
1879 gdb_assert (gdbarch
!= NULL
);
1880 /* Skip verify of ps_regnum, invalid_p == 0 */
1881 if (gdbarch_debug
>= 2)
1882 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
1883 return gdbarch
->ps_regnum
;
1887 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
1890 gdbarch
->ps_regnum
= ps_regnum
;
1894 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
1896 gdb_assert (gdbarch
!= NULL
);
1897 /* Skip verify of fp0_regnum, invalid_p == 0 */
1898 if (gdbarch_debug
>= 2)
1899 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
1900 return gdbarch
->fp0_regnum
;
1904 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
1907 gdbarch
->fp0_regnum
= fp0_regnum
;
1911 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
1913 gdb_assert (gdbarch
!= NULL
);
1914 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
1915 if (gdbarch_debug
>= 2)
1916 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
1917 return gdbarch
->stab_reg_to_regnum (gdbarch
, stab_regnr
);
1921 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
1922 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
1924 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
1928 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
1930 gdb_assert (gdbarch
!= NULL
);
1931 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
1932 if (gdbarch_debug
>= 2)
1933 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
1934 return gdbarch
->ecoff_reg_to_regnum (gdbarch
, ecoff_regnr
);
1938 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
1939 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
1941 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
1945 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
1947 gdb_assert (gdbarch
!= NULL
);
1948 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
1949 if (gdbarch_debug
>= 2)
1950 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
1951 return gdbarch
->sdb_reg_to_regnum (gdbarch
, sdb_regnr
);
1955 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
1956 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
1958 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
1962 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
1964 gdb_assert (gdbarch
!= NULL
);
1965 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
1966 if (gdbarch_debug
>= 2)
1967 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
1968 return gdbarch
->dwarf2_reg_to_regnum (gdbarch
, dwarf2_regnr
);
1972 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
1973 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
1975 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
1979 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1981 gdb_assert (gdbarch
!= NULL
);
1982 gdb_assert (gdbarch
->register_name
!= NULL
);
1983 if (gdbarch_debug
>= 2)
1984 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1985 return gdbarch
->register_name (gdbarch
, regnr
);
1989 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1990 gdbarch_register_name_ftype register_name
)
1992 gdbarch
->register_name
= register_name
;
1996 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
1998 gdb_assert (gdbarch
!= NULL
);
1999 return gdbarch
->register_type
!= NULL
;
2003 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
2005 gdb_assert (gdbarch
!= NULL
);
2006 gdb_assert (gdbarch
->register_type
!= NULL
);
2007 if (gdbarch_debug
>= 2)
2008 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
2009 return gdbarch
->register_type (gdbarch
, reg_nr
);
2013 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
2014 gdbarch_register_type_ftype register_type
)
2016 gdbarch
->register_type
= register_type
;
2020 gdbarch_dummy_id_p (struct gdbarch
*gdbarch
)
2022 gdb_assert (gdbarch
!= NULL
);
2023 return gdbarch
->dummy_id
!= NULL
;
2027 gdbarch_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*this_frame
)
2029 gdb_assert (gdbarch
!= NULL
);
2030 gdb_assert (gdbarch
->dummy_id
!= NULL
);
2031 if (gdbarch_debug
>= 2)
2032 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dummy_id called\n");
2033 return gdbarch
->dummy_id (gdbarch
, this_frame
);
2037 set_gdbarch_dummy_id (struct gdbarch
*gdbarch
,
2038 gdbarch_dummy_id_ftype dummy_id
)
2040 gdbarch
->dummy_id
= dummy_id
;
2044 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
2046 gdb_assert (gdbarch
!= NULL
);
2047 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2048 if (gdbarch_debug
>= 2)
2049 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
2050 return gdbarch
->deprecated_fp_regnum
;
2054 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
2055 int deprecated_fp_regnum
)
2057 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
2061 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
2063 gdb_assert (gdbarch
!= NULL
);
2064 return gdbarch
->push_dummy_call
!= NULL
;
2068 gdbarch_push_dummy_call (struct gdbarch
*gdbarch
, struct value
*function
, struct regcache
*regcache
, CORE_ADDR bp_addr
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
2070 gdb_assert (gdbarch
!= NULL
);
2071 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
2072 if (gdbarch_debug
>= 2)
2073 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
2074 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
2078 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
2079 gdbarch_push_dummy_call_ftype push_dummy_call
)
2081 gdbarch
->push_dummy_call
= push_dummy_call
;
2085 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
2087 gdb_assert (gdbarch
!= NULL
);
2088 /* Skip verify of call_dummy_location, invalid_p == 0 */
2089 if (gdbarch_debug
>= 2)
2090 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
2091 return gdbarch
->call_dummy_location
;
2095 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
2096 int call_dummy_location
)
2098 gdbarch
->call_dummy_location
= call_dummy_location
;
2102 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
2104 gdb_assert (gdbarch
!= NULL
);
2105 return gdbarch
->push_dummy_code
!= NULL
;
2109 gdbarch_push_dummy_code (struct gdbarch
*gdbarch
, CORE_ADDR sp
, CORE_ADDR funaddr
, struct value
**args
, int nargs
, struct type
*value_type
, CORE_ADDR
*real_pc
, CORE_ADDR
*bp_addr
, struct regcache
*regcache
)
2111 gdb_assert (gdbarch
!= NULL
);
2112 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
2113 if (gdbarch_debug
>= 2)
2114 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
2115 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, args
, nargs
, value_type
, real_pc
, bp_addr
, regcache
);
2119 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
2120 gdbarch_push_dummy_code_ftype push_dummy_code
)
2122 gdbarch
->push_dummy_code
= push_dummy_code
;
2126 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
2128 gdb_assert (gdbarch
!= NULL
);
2129 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
2130 if (gdbarch_debug
>= 2)
2131 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
2132 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
2136 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
2137 gdbarch_print_registers_info_ftype print_registers_info
)
2139 gdbarch
->print_registers_info
= print_registers_info
;
2143 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
2145 gdb_assert (gdbarch
!= NULL
);
2146 return gdbarch
->print_float_info
!= NULL
;
2150 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2152 gdb_assert (gdbarch
!= NULL
);
2153 gdb_assert (gdbarch
->print_float_info
!= NULL
);
2154 if (gdbarch_debug
>= 2)
2155 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
2156 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
2160 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
2161 gdbarch_print_float_info_ftype print_float_info
)
2163 gdbarch
->print_float_info
= print_float_info
;
2167 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
2169 gdb_assert (gdbarch
!= NULL
);
2170 return gdbarch
->print_vector_info
!= NULL
;
2174 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2176 gdb_assert (gdbarch
!= NULL
);
2177 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
2178 if (gdbarch_debug
>= 2)
2179 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
2180 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
2184 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
2185 gdbarch_print_vector_info_ftype print_vector_info
)
2187 gdbarch
->print_vector_info
= print_vector_info
;
2191 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
2193 gdb_assert (gdbarch
!= NULL
);
2194 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
2195 if (gdbarch_debug
>= 2)
2196 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
2197 return gdbarch
->register_sim_regno (gdbarch
, reg_nr
);
2201 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
2202 gdbarch_register_sim_regno_ftype register_sim_regno
)
2204 gdbarch
->register_sim_regno
= register_sim_regno
;
2208 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
2210 gdb_assert (gdbarch
!= NULL
);
2211 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
2212 if (gdbarch_debug
>= 2)
2213 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
2214 return gdbarch
->cannot_fetch_register (gdbarch
, regnum
);
2218 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
2219 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
2221 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
2225 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
2227 gdb_assert (gdbarch
!= NULL
);
2228 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
2229 if (gdbarch_debug
>= 2)
2230 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
2231 return gdbarch
->cannot_store_register (gdbarch
, regnum
);
2235 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
2236 gdbarch_cannot_store_register_ftype cannot_store_register
)
2238 gdbarch
->cannot_store_register
= cannot_store_register
;
2242 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
2244 gdb_assert (gdbarch
!= NULL
);
2245 return gdbarch
->get_longjmp_target
!= NULL
;
2249 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR
*pc
)
2251 gdb_assert (gdbarch
!= NULL
);
2252 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
2253 if (gdbarch_debug
>= 2)
2254 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
2255 return gdbarch
->get_longjmp_target (frame
, pc
);
2259 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
2260 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
2262 gdbarch
->get_longjmp_target
= get_longjmp_target
;
2266 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
2268 gdb_assert (gdbarch
!= NULL
);
2269 if (gdbarch_debug
>= 2)
2270 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
2271 return gdbarch
->believe_pcc_promotion
;
2275 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
2276 int believe_pcc_promotion
)
2278 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2282 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
2284 gdb_assert (gdbarch
!= NULL
);
2285 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
2286 if (gdbarch_debug
>= 2)
2287 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
2288 return gdbarch
->convert_register_p (gdbarch
, regnum
, type
);
2292 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
2293 gdbarch_convert_register_p_ftype convert_register_p
)
2295 gdbarch
->convert_register_p
= convert_register_p
;
2299 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, gdb_byte
*buf
, int *optimizedp
, int *unavailablep
)
2301 gdb_assert (gdbarch
!= NULL
);
2302 gdb_assert (gdbarch
->register_to_value
!= NULL
);
2303 if (gdbarch_debug
>= 2)
2304 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2305 return gdbarch
->register_to_value (frame
, regnum
, type
, buf
, optimizedp
, unavailablep
);
2309 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2310 gdbarch_register_to_value_ftype register_to_value
)
2312 gdbarch
->register_to_value
= register_to_value
;
2316 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const gdb_byte
*buf
)
2318 gdb_assert (gdbarch
!= NULL
);
2319 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2320 if (gdbarch_debug
>= 2)
2321 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2322 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2326 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2327 gdbarch_value_to_register_ftype value_to_register
)
2329 gdbarch
->value_to_register
= value_to_register
;
2333 gdbarch_value_from_register (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, struct frame_info
*frame
)
2335 gdb_assert (gdbarch
!= NULL
);
2336 gdb_assert (gdbarch
->value_from_register
!= NULL
);
2337 if (gdbarch_debug
>= 2)
2338 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_from_register called\n");
2339 return gdbarch
->value_from_register (type
, regnum
, frame
);
2343 set_gdbarch_value_from_register (struct gdbarch
*gdbarch
,
2344 gdbarch_value_from_register_ftype value_from_register
)
2346 gdbarch
->value_from_register
= value_from_register
;
2350 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2352 gdb_assert (gdbarch
!= NULL
);
2353 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2354 if (gdbarch_debug
>= 2)
2355 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2356 return gdbarch
->pointer_to_address (gdbarch
, type
, buf
);
2360 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2361 gdbarch_pointer_to_address_ftype pointer_to_address
)
2363 gdbarch
->pointer_to_address
= pointer_to_address
;
2367 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*buf
, CORE_ADDR addr
)
2369 gdb_assert (gdbarch
!= NULL
);
2370 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2371 if (gdbarch_debug
>= 2)
2372 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2373 gdbarch
->address_to_pointer (gdbarch
, type
, buf
, addr
);
2377 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2378 gdbarch_address_to_pointer_ftype address_to_pointer
)
2380 gdbarch
->address_to_pointer
= address_to_pointer
;
2384 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2386 gdb_assert (gdbarch
!= NULL
);
2387 return gdbarch
->integer_to_address
!= NULL
;
2391 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2393 gdb_assert (gdbarch
!= NULL
);
2394 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2395 if (gdbarch_debug
>= 2)
2396 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2397 return gdbarch
->integer_to_address (gdbarch
, type
, buf
);
2401 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2402 gdbarch_integer_to_address_ftype integer_to_address
)
2404 gdbarch
->integer_to_address
= integer_to_address
;
2408 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2410 gdb_assert (gdbarch
!= NULL
);
2411 return gdbarch
->return_value
!= NULL
;
2414 enum return_value_convention
2415 gdbarch_return_value (struct gdbarch
*gdbarch
, struct type
*functype
, struct type
*valtype
, struct regcache
*regcache
, gdb_byte
*readbuf
, const gdb_byte
*writebuf
)
2417 gdb_assert (gdbarch
!= NULL
);
2418 gdb_assert (gdbarch
->return_value
!= NULL
);
2419 if (gdbarch_debug
>= 2)
2420 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2421 return gdbarch
->return_value (gdbarch
, functype
, valtype
, regcache
, readbuf
, writebuf
);
2425 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2426 gdbarch_return_value_ftype return_value
)
2428 gdbarch
->return_value
= return_value
;
2432 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2434 gdb_assert (gdbarch
!= NULL
);
2435 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2436 if (gdbarch_debug
>= 2)
2437 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2438 return gdbarch
->skip_prologue (gdbarch
, ip
);
2442 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2443 gdbarch_skip_prologue_ftype skip_prologue
)
2445 gdbarch
->skip_prologue
= skip_prologue
;
2449 gdbarch_skip_main_prologue_p (struct gdbarch
*gdbarch
)
2451 gdb_assert (gdbarch
!= NULL
);
2452 return gdbarch
->skip_main_prologue
!= NULL
;
2456 gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2458 gdb_assert (gdbarch
!= NULL
);
2459 gdb_assert (gdbarch
->skip_main_prologue
!= NULL
);
2460 if (gdbarch_debug
>= 2)
2461 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_main_prologue called\n");
2462 return gdbarch
->skip_main_prologue (gdbarch
, ip
);
2466 set_gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
,
2467 gdbarch_skip_main_prologue_ftype skip_main_prologue
)
2469 gdbarch
->skip_main_prologue
= skip_main_prologue
;
2473 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2475 gdb_assert (gdbarch
!= NULL
);
2476 gdb_assert (gdbarch
->inner_than
!= NULL
);
2477 if (gdbarch_debug
>= 2)
2478 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2479 return gdbarch
->inner_than (lhs
, rhs
);
2483 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2484 gdbarch_inner_than_ftype inner_than
)
2486 gdbarch
->inner_than
= inner_than
;
2490 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2492 gdb_assert (gdbarch
!= NULL
);
2493 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2494 if (gdbarch_debug
>= 2)
2495 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2496 return gdbarch
->breakpoint_from_pc (gdbarch
, pcptr
, lenptr
);
2500 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2501 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2503 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2507 gdbarch_remote_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *kindptr
)
2509 gdb_assert (gdbarch
!= NULL
);
2510 gdb_assert (gdbarch
->remote_breakpoint_from_pc
!= NULL
);
2511 if (gdbarch_debug
>= 2)
2512 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_breakpoint_from_pc called\n");
2513 gdbarch
->remote_breakpoint_from_pc (gdbarch
, pcptr
, kindptr
);
2517 set_gdbarch_remote_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2518 gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc
)
2520 gdbarch
->remote_breakpoint_from_pc
= remote_breakpoint_from_pc
;
2524 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2526 gdb_assert (gdbarch
!= NULL
);
2527 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2531 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2533 gdb_assert (gdbarch
!= NULL
);
2534 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2535 if (gdbarch_debug
>= 2)
2536 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2537 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2541 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2542 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2544 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2548 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2550 gdb_assert (gdbarch
!= NULL
);
2551 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2552 if (gdbarch_debug
>= 2)
2553 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2554 return gdbarch
->memory_insert_breakpoint (gdbarch
, bp_tgt
);
2558 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2559 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2561 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2565 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2567 gdb_assert (gdbarch
!= NULL
);
2568 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2569 if (gdbarch_debug
>= 2)
2570 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2571 return gdbarch
->memory_remove_breakpoint (gdbarch
, bp_tgt
);
2575 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2576 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2578 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2582 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2584 gdb_assert (gdbarch
!= NULL
);
2585 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2586 if (gdbarch_debug
>= 2)
2587 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2588 return gdbarch
->decr_pc_after_break
;
2592 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2593 CORE_ADDR decr_pc_after_break
)
2595 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2599 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
2601 gdb_assert (gdbarch
!= NULL
);
2602 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2603 if (gdbarch_debug
>= 2)
2604 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
2605 return gdbarch
->deprecated_function_start_offset
;
2609 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
2610 CORE_ADDR deprecated_function_start_offset
)
2612 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
2616 gdbarch_remote_register_number (struct gdbarch
*gdbarch
, int regno
)
2618 gdb_assert (gdbarch
!= NULL
);
2619 gdb_assert (gdbarch
->remote_register_number
!= NULL
);
2620 if (gdbarch_debug
>= 2)
2621 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_register_number called\n");
2622 return gdbarch
->remote_register_number (gdbarch
, regno
);
2626 set_gdbarch_remote_register_number (struct gdbarch
*gdbarch
,
2627 gdbarch_remote_register_number_ftype remote_register_number
)
2629 gdbarch
->remote_register_number
= remote_register_number
;
2633 gdbarch_fetch_tls_load_module_address_p (struct gdbarch
*gdbarch
)
2635 gdb_assert (gdbarch
!= NULL
);
2636 return gdbarch
->fetch_tls_load_module_address
!= NULL
;
2640 gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
, struct objfile
*objfile
)
2642 gdb_assert (gdbarch
!= NULL
);
2643 gdb_assert (gdbarch
->fetch_tls_load_module_address
!= NULL
);
2644 if (gdbarch_debug
>= 2)
2645 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_tls_load_module_address called\n");
2646 return gdbarch
->fetch_tls_load_module_address (objfile
);
2650 set_gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
,
2651 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address
)
2653 gdbarch
->fetch_tls_load_module_address
= fetch_tls_load_module_address
;
2657 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2659 gdb_assert (gdbarch
!= NULL
);
2660 /* Skip verify of frame_args_skip, invalid_p == 0 */
2661 if (gdbarch_debug
>= 2)
2662 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2663 return gdbarch
->frame_args_skip
;
2667 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2668 CORE_ADDR frame_args_skip
)
2670 gdbarch
->frame_args_skip
= frame_args_skip
;
2674 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
2676 gdb_assert (gdbarch
!= NULL
);
2677 return gdbarch
->unwind_pc
!= NULL
;
2681 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2683 gdb_assert (gdbarch
!= NULL
);
2684 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
2685 if (gdbarch_debug
>= 2)
2686 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
2687 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
2691 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
2692 gdbarch_unwind_pc_ftype unwind_pc
)
2694 gdbarch
->unwind_pc
= unwind_pc
;
2698 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
2700 gdb_assert (gdbarch
!= NULL
);
2701 return gdbarch
->unwind_sp
!= NULL
;
2705 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2707 gdb_assert (gdbarch
!= NULL
);
2708 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
2709 if (gdbarch_debug
>= 2)
2710 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
2711 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
2715 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
2716 gdbarch_unwind_sp_ftype unwind_sp
)
2718 gdbarch
->unwind_sp
= unwind_sp
;
2722 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
2724 gdb_assert (gdbarch
!= NULL
);
2725 return gdbarch
->frame_num_args
!= NULL
;
2729 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2731 gdb_assert (gdbarch
!= NULL
);
2732 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
2733 if (gdbarch_debug
>= 2)
2734 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2735 return gdbarch
->frame_num_args (frame
);
2739 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2740 gdbarch_frame_num_args_ftype frame_num_args
)
2742 gdbarch
->frame_num_args
= frame_num_args
;
2746 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
2748 gdb_assert (gdbarch
!= NULL
);
2749 return gdbarch
->frame_align
!= NULL
;
2753 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
2755 gdb_assert (gdbarch
!= NULL
);
2756 gdb_assert (gdbarch
->frame_align
!= NULL
);
2757 if (gdbarch_debug
>= 2)
2758 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
2759 return gdbarch
->frame_align (gdbarch
, address
);
2763 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
2764 gdbarch_frame_align_ftype frame_align
)
2766 gdbarch
->frame_align
= frame_align
;
2770 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
2772 gdb_assert (gdbarch
!= NULL
);
2773 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
2774 if (gdbarch_debug
>= 2)
2775 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
2776 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
2780 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
2781 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
2783 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
2787 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
2789 gdb_assert (gdbarch
!= NULL
);
2790 if (gdbarch_debug
>= 2)
2791 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
2792 return gdbarch
->frame_red_zone_size
;
2796 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
2797 int frame_red_zone_size
)
2799 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
2803 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
2805 gdb_assert (gdbarch
!= NULL
);
2806 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
2807 if (gdbarch_debug
>= 2)
2808 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
2809 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
2813 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
2814 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
2816 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
2820 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2822 gdb_assert (gdbarch
!= NULL
);
2823 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
2824 if (gdbarch_debug
>= 2)
2825 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
2826 return gdbarch
->addr_bits_remove (gdbarch
, addr
);
2830 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
2831 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
2833 gdbarch
->addr_bits_remove
= addr_bits_remove
;
2837 gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2839 gdb_assert (gdbarch
!= NULL
);
2840 gdb_assert (gdbarch
->smash_text_address
!= NULL
);
2841 if (gdbarch_debug
>= 2)
2842 fprintf_unfiltered (gdb_stdlog
, "gdbarch_smash_text_address called\n");
2843 return gdbarch
->smash_text_address (gdbarch
, addr
);
2847 set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
,
2848 gdbarch_smash_text_address_ftype smash_text_address
)
2850 gdbarch
->smash_text_address
= smash_text_address
;
2854 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
2856 gdb_assert (gdbarch
!= NULL
);
2857 return gdbarch
->software_single_step
!= NULL
;
2861 gdbarch_software_single_step (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2863 gdb_assert (gdbarch
!= NULL
);
2864 gdb_assert (gdbarch
->software_single_step
!= NULL
);
2865 if (gdbarch_debug
>= 2)
2866 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
2867 return gdbarch
->software_single_step (frame
);
2871 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
2872 gdbarch_software_single_step_ftype software_single_step
)
2874 gdbarch
->software_single_step
= software_single_step
;
2878 gdbarch_single_step_through_delay_p (struct gdbarch
*gdbarch
)
2880 gdb_assert (gdbarch
!= NULL
);
2881 return gdbarch
->single_step_through_delay
!= NULL
;
2885 gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2887 gdb_assert (gdbarch
!= NULL
);
2888 gdb_assert (gdbarch
->single_step_through_delay
!= NULL
);
2889 if (gdbarch_debug
>= 2)
2890 fprintf_unfiltered (gdb_stdlog
, "gdbarch_single_step_through_delay called\n");
2891 return gdbarch
->single_step_through_delay (gdbarch
, frame
);
2895 set_gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
,
2896 gdbarch_single_step_through_delay_ftype single_step_through_delay
)
2898 gdbarch
->single_step_through_delay
= single_step_through_delay
;
2902 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
2904 gdb_assert (gdbarch
!= NULL
);
2905 gdb_assert (gdbarch
->print_insn
!= NULL
);
2906 if (gdbarch_debug
>= 2)
2907 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
2908 return gdbarch
->print_insn (vma
, info
);
2912 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
2913 gdbarch_print_insn_ftype print_insn
)
2915 gdbarch
->print_insn
= print_insn
;
2919 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR pc
)
2921 gdb_assert (gdbarch
!= NULL
);
2922 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
2923 if (gdbarch_debug
>= 2)
2924 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
2925 return gdbarch
->skip_trampoline_code (frame
, pc
);
2929 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
2930 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
2932 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
2936 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
2938 gdb_assert (gdbarch
!= NULL
);
2939 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
2940 if (gdbarch_debug
>= 2)
2941 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
2942 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
2946 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
2947 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
2949 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
2953 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
)
2955 gdb_assert (gdbarch
!= NULL
);
2956 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
2957 if (gdbarch_debug
>= 2)
2958 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
2959 return gdbarch
->in_solib_return_trampoline (gdbarch
, pc
, name
);
2963 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
2964 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
2966 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
2970 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2972 gdb_assert (gdbarch
!= NULL
);
2973 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
2974 if (gdbarch_debug
>= 2)
2975 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
2976 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
2980 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
2981 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
2983 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
2987 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
2989 gdb_assert (gdbarch
!= NULL
);
2990 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
2991 if (gdbarch_debug
>= 2)
2992 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
2993 gdbarch
->elf_make_msymbol_special (sym
, msym
);
2997 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
2998 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
3000 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
3004 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
3006 gdb_assert (gdbarch
!= NULL
);
3007 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
3008 if (gdbarch_debug
>= 2)
3009 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
3010 gdbarch
->coff_make_msymbol_special (val
, msym
);
3014 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
3015 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
3017 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
3021 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
3023 gdb_assert (gdbarch
!= NULL
);
3024 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3025 if (gdbarch_debug
>= 2)
3026 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
3027 return gdbarch
->cannot_step_breakpoint
;
3031 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
3032 int cannot_step_breakpoint
)
3034 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
3038 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
3040 gdb_assert (gdbarch
!= NULL
);
3041 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3042 if (gdbarch_debug
>= 2)
3043 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
3044 return gdbarch
->have_nonsteppable_watchpoint
;
3048 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
3049 int have_nonsteppable_watchpoint
)
3051 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
3055 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
3057 gdb_assert (gdbarch
!= NULL
);
3058 return gdbarch
->address_class_type_flags
!= NULL
;
3062 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
3064 gdb_assert (gdbarch
!= NULL
);
3065 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
3066 if (gdbarch_debug
>= 2)
3067 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
3068 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
3072 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
3073 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
3075 gdbarch
->address_class_type_flags
= address_class_type_flags
;
3079 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
3081 gdb_assert (gdbarch
!= NULL
);
3082 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
3086 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
3088 gdb_assert (gdbarch
!= NULL
);
3089 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
3090 if (gdbarch_debug
>= 2)
3091 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
3092 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
3096 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
3097 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
3099 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
3103 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
3105 gdb_assert (gdbarch
!= NULL
);
3106 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
3110 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
3112 gdb_assert (gdbarch
!= NULL
);
3113 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
3114 if (gdbarch_debug
>= 2)
3115 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
3116 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
3120 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
3121 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
3123 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
3127 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
3129 gdb_assert (gdbarch
!= NULL
);
3130 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
3131 if (gdbarch_debug
>= 2)
3132 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
3133 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
3137 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
3138 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
3140 gdbarch
->register_reggroup_p
= register_reggroup_p
;
3144 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
3146 gdb_assert (gdbarch
!= NULL
);
3147 return gdbarch
->fetch_pointer_argument
!= NULL
;
3151 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
3153 gdb_assert (gdbarch
!= NULL
);
3154 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
3155 if (gdbarch_debug
>= 2)
3156 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
3157 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
3161 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
3162 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
3164 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
3168 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
3170 gdb_assert (gdbarch
!= NULL
);
3171 return gdbarch
->regset_from_core_section
!= NULL
;
3174 const struct regset
*
3175 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
3177 gdb_assert (gdbarch
!= NULL
);
3178 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
3179 if (gdbarch_debug
>= 2)
3180 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
3181 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
3185 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
3186 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
3188 gdbarch
->regset_from_core_section
= regset_from_core_section
;
3191 struct core_regset_section
*
3192 gdbarch_core_regset_sections (struct gdbarch
*gdbarch
)
3194 gdb_assert (gdbarch
!= NULL
);
3195 if (gdbarch_debug
>= 2)
3196 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_regset_sections called\n");
3197 return gdbarch
->core_regset_sections
;
3201 set_gdbarch_core_regset_sections (struct gdbarch
*gdbarch
,
3202 struct core_regset_section
* core_regset_sections
)
3204 gdbarch
->core_regset_sections
= core_regset_sections
;
3208 gdbarch_core_xfer_shared_libraries_p (struct gdbarch
*gdbarch
)
3210 gdb_assert (gdbarch
!= NULL
);
3211 return gdbarch
->core_xfer_shared_libraries
!= NULL
;
3215 gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
, gdb_byte
*readbuf
, ULONGEST offset
, LONGEST len
)
3217 gdb_assert (gdbarch
!= NULL
);
3218 gdb_assert (gdbarch
->core_xfer_shared_libraries
!= NULL
);
3219 if (gdbarch_debug
>= 2)
3220 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_xfer_shared_libraries called\n");
3221 return gdbarch
->core_xfer_shared_libraries (gdbarch
, readbuf
, offset
, len
);
3225 set_gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
,
3226 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries
)
3228 gdbarch
->core_xfer_shared_libraries
= core_xfer_shared_libraries
;
3232 gdbarch_core_pid_to_str_p (struct gdbarch
*gdbarch
)
3234 gdb_assert (gdbarch
!= NULL
);
3235 return gdbarch
->core_pid_to_str
!= NULL
;
3239 gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
, ptid_t ptid
)
3241 gdb_assert (gdbarch
!= NULL
);
3242 gdb_assert (gdbarch
->core_pid_to_str
!= NULL
);
3243 if (gdbarch_debug
>= 2)
3244 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_pid_to_str called\n");
3245 return gdbarch
->core_pid_to_str (gdbarch
, ptid
);
3249 set_gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
,
3250 gdbarch_core_pid_to_str_ftype core_pid_to_str
)
3252 gdbarch
->core_pid_to_str
= core_pid_to_str
;
3256 gdbarch_gcore_bfd_target_p (struct gdbarch
*gdbarch
)
3258 gdb_assert (gdbarch
!= NULL
);
3259 return gdbarch
->gcore_bfd_target
!= 0;
3263 gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
)
3265 gdb_assert (gdbarch
!= NULL
);
3266 /* Check variable changed from pre-default. */
3267 gdb_assert (gdbarch
->gcore_bfd_target
!= 0);
3268 if (gdbarch_debug
>= 2)
3269 fprintf_unfiltered (gdb_stdlog
, "gdbarch_gcore_bfd_target called\n");
3270 return gdbarch
->gcore_bfd_target
;
3274 set_gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
,
3275 const char * gcore_bfd_target
)
3277 gdbarch
->gcore_bfd_target
= gcore_bfd_target
;
3281 gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
)
3283 gdb_assert (gdbarch
!= NULL
);
3284 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3285 if (gdbarch_debug
>= 2)
3286 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vtable_function_descriptors called\n");
3287 return gdbarch
->vtable_function_descriptors
;
3291 set_gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
,
3292 int vtable_function_descriptors
)
3294 gdbarch
->vtable_function_descriptors
= vtable_function_descriptors
;
3298 gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
)
3300 gdb_assert (gdbarch
!= NULL
);
3301 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3302 if (gdbarch_debug
>= 2)
3303 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vbit_in_delta called\n");
3304 return gdbarch
->vbit_in_delta
;
3308 set_gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
,
3311 gdbarch
->vbit_in_delta
= vbit_in_delta
;
3315 gdbarch_skip_permanent_breakpoint_p (struct gdbarch
*gdbarch
)
3317 gdb_assert (gdbarch
!= NULL
);
3318 return gdbarch
->skip_permanent_breakpoint
!= NULL
;
3322 gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
3324 gdb_assert (gdbarch
!= NULL
);
3325 gdb_assert (gdbarch
->skip_permanent_breakpoint
!= NULL
);
3326 if (gdbarch_debug
>= 2)
3327 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_permanent_breakpoint called\n");
3328 gdbarch
->skip_permanent_breakpoint (regcache
);
3332 set_gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
,
3333 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint
)
3335 gdbarch
->skip_permanent_breakpoint
= skip_permanent_breakpoint
;
3339 gdbarch_max_insn_length_p (struct gdbarch
*gdbarch
)
3341 gdb_assert (gdbarch
!= NULL
);
3342 return gdbarch
->max_insn_length
!= 0;
3346 gdbarch_max_insn_length (struct gdbarch
*gdbarch
)
3348 gdb_assert (gdbarch
!= NULL
);
3349 /* Check variable changed from pre-default. */
3350 gdb_assert (gdbarch
->max_insn_length
!= 0);
3351 if (gdbarch_debug
>= 2)
3352 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_insn_length called\n");
3353 return gdbarch
->max_insn_length
;
3357 set_gdbarch_max_insn_length (struct gdbarch
*gdbarch
,
3358 ULONGEST max_insn_length
)
3360 gdbarch
->max_insn_length
= max_insn_length
;
3364 gdbarch_displaced_step_copy_insn_p (struct gdbarch
*gdbarch
)
3366 gdb_assert (gdbarch
!= NULL
);
3367 return gdbarch
->displaced_step_copy_insn
!= NULL
;
3370 struct displaced_step_closure
*
3371 gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3373 gdb_assert (gdbarch
!= NULL
);
3374 gdb_assert (gdbarch
->displaced_step_copy_insn
!= NULL
);
3375 if (gdbarch_debug
>= 2)
3376 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_copy_insn called\n");
3377 return gdbarch
->displaced_step_copy_insn (gdbarch
, from
, to
, regs
);
3381 set_gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
,
3382 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn
)
3384 gdbarch
->displaced_step_copy_insn
= displaced_step_copy_insn
;
3388 gdbarch_displaced_step_hw_singlestep (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3390 gdb_assert (gdbarch
!= NULL
);
3391 gdb_assert (gdbarch
->displaced_step_hw_singlestep
!= NULL
);
3392 if (gdbarch_debug
>= 2)
3393 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_hw_singlestep called\n");
3394 return gdbarch
->displaced_step_hw_singlestep (gdbarch
, closure
);
3398 set_gdbarch_displaced_step_hw_singlestep (struct gdbarch
*gdbarch
,
3399 gdbarch_displaced_step_hw_singlestep_ftype displaced_step_hw_singlestep
)
3401 gdbarch
->displaced_step_hw_singlestep
= displaced_step_hw_singlestep
;
3405 gdbarch_displaced_step_fixup_p (struct gdbarch
*gdbarch
)
3407 gdb_assert (gdbarch
!= NULL
);
3408 return gdbarch
->displaced_step_fixup
!= NULL
;
3412 gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3414 gdb_assert (gdbarch
!= NULL
);
3415 gdb_assert (gdbarch
->displaced_step_fixup
!= NULL
);
3416 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3417 if (gdbarch_debug
>= 2)
3418 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_fixup called\n");
3419 gdbarch
->displaced_step_fixup (gdbarch
, closure
, from
, to
, regs
);
3423 set_gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
,
3424 gdbarch_displaced_step_fixup_ftype displaced_step_fixup
)
3426 gdbarch
->displaced_step_fixup
= displaced_step_fixup
;
3430 gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3432 gdb_assert (gdbarch
!= NULL
);
3433 gdb_assert (gdbarch
->displaced_step_free_closure
!= NULL
);
3434 if (gdbarch_debug
>= 2)
3435 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_free_closure called\n");
3436 gdbarch
->displaced_step_free_closure (gdbarch
, closure
);
3440 set_gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
,
3441 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure
)
3443 gdbarch
->displaced_step_free_closure
= displaced_step_free_closure
;
3447 gdbarch_displaced_step_location (struct gdbarch
*gdbarch
)
3449 gdb_assert (gdbarch
!= NULL
);
3450 gdb_assert (gdbarch
->displaced_step_location
!= NULL
);
3451 if (gdbarch_debug
>= 2)
3452 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_location called\n");
3453 return gdbarch
->displaced_step_location (gdbarch
);
3457 set_gdbarch_displaced_step_location (struct gdbarch
*gdbarch
,
3458 gdbarch_displaced_step_location_ftype displaced_step_location
)
3460 gdbarch
->displaced_step_location
= displaced_step_location
;
3464 gdbarch_relocate_instruction_p (struct gdbarch
*gdbarch
)
3466 gdb_assert (gdbarch
!= NULL
);
3467 return gdbarch
->relocate_instruction
!= NULL
;
3471 gdbarch_relocate_instruction (struct gdbarch
*gdbarch
, CORE_ADDR
*to
, CORE_ADDR from
)
3473 gdb_assert (gdbarch
!= NULL
);
3474 gdb_assert (gdbarch
->relocate_instruction
!= NULL
);
3475 /* Do not check predicate: gdbarch->relocate_instruction != NULL, allow call. */
3476 if (gdbarch_debug
>= 2)
3477 fprintf_unfiltered (gdb_stdlog
, "gdbarch_relocate_instruction called\n");
3478 gdbarch
->relocate_instruction (gdbarch
, to
, from
);
3482 set_gdbarch_relocate_instruction (struct gdbarch
*gdbarch
,
3483 gdbarch_relocate_instruction_ftype relocate_instruction
)
3485 gdbarch
->relocate_instruction
= relocate_instruction
;
3489 gdbarch_overlay_update_p (struct gdbarch
*gdbarch
)
3491 gdb_assert (gdbarch
!= NULL
);
3492 return gdbarch
->overlay_update
!= NULL
;
3496 gdbarch_overlay_update (struct gdbarch
*gdbarch
, struct obj_section
*osect
)
3498 gdb_assert (gdbarch
!= NULL
);
3499 gdb_assert (gdbarch
->overlay_update
!= NULL
);
3500 if (gdbarch_debug
>= 2)
3501 fprintf_unfiltered (gdb_stdlog
, "gdbarch_overlay_update called\n");
3502 gdbarch
->overlay_update (osect
);
3506 set_gdbarch_overlay_update (struct gdbarch
*gdbarch
,
3507 gdbarch_overlay_update_ftype overlay_update
)
3509 gdbarch
->overlay_update
= overlay_update
;
3513 gdbarch_core_read_description_p (struct gdbarch
*gdbarch
)
3515 gdb_assert (gdbarch
!= NULL
);
3516 return gdbarch
->core_read_description
!= NULL
;
3519 const struct target_desc
*
3520 gdbarch_core_read_description (struct gdbarch
*gdbarch
, struct target_ops
*target
, bfd
*abfd
)
3522 gdb_assert (gdbarch
!= NULL
);
3523 gdb_assert (gdbarch
->core_read_description
!= NULL
);
3524 if (gdbarch_debug
>= 2)
3525 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_read_description called\n");
3526 return gdbarch
->core_read_description (gdbarch
, target
, abfd
);
3530 set_gdbarch_core_read_description (struct gdbarch
*gdbarch
,
3531 gdbarch_core_read_description_ftype core_read_description
)
3533 gdbarch
->core_read_description
= core_read_description
;
3537 gdbarch_static_transform_name_p (struct gdbarch
*gdbarch
)
3539 gdb_assert (gdbarch
!= NULL
);
3540 return gdbarch
->static_transform_name
!= NULL
;
3544 gdbarch_static_transform_name (struct gdbarch
*gdbarch
, char *name
)
3546 gdb_assert (gdbarch
!= NULL
);
3547 gdb_assert (gdbarch
->static_transform_name
!= NULL
);
3548 if (gdbarch_debug
>= 2)
3549 fprintf_unfiltered (gdb_stdlog
, "gdbarch_static_transform_name called\n");
3550 return gdbarch
->static_transform_name (name
);
3554 set_gdbarch_static_transform_name (struct gdbarch
*gdbarch
,
3555 gdbarch_static_transform_name_ftype static_transform_name
)
3557 gdbarch
->static_transform_name
= static_transform_name
;
3561 gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
)
3563 gdb_assert (gdbarch
!= NULL
);
3564 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3565 if (gdbarch_debug
>= 2)
3566 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sofun_address_maybe_missing called\n");
3567 return gdbarch
->sofun_address_maybe_missing
;
3571 set_gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
,
3572 int sofun_address_maybe_missing
)
3574 gdbarch
->sofun_address_maybe_missing
= sofun_address_maybe_missing
;
3578 gdbarch_process_record_p (struct gdbarch
*gdbarch
)
3580 gdb_assert (gdbarch
!= NULL
);
3581 return gdbarch
->process_record
!= NULL
;
3585 gdbarch_process_record (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR addr
)
3587 gdb_assert (gdbarch
!= NULL
);
3588 gdb_assert (gdbarch
->process_record
!= NULL
);
3589 if (gdbarch_debug
>= 2)
3590 fprintf_unfiltered (gdb_stdlog
, "gdbarch_process_record called\n");
3591 return gdbarch
->process_record (gdbarch
, regcache
, addr
);
3595 set_gdbarch_process_record (struct gdbarch
*gdbarch
,
3596 gdbarch_process_record_ftype process_record
)
3598 gdbarch
->process_record
= process_record
;
3602 gdbarch_process_record_signal_p (struct gdbarch
*gdbarch
)
3604 gdb_assert (gdbarch
!= NULL
);
3605 return gdbarch
->process_record_signal
!= NULL
;
3609 gdbarch_process_record_signal (struct gdbarch
*gdbarch
, struct regcache
*regcache
, enum target_signal signal
)
3611 gdb_assert (gdbarch
!= NULL
);
3612 gdb_assert (gdbarch
->process_record_signal
!= NULL
);
3613 if (gdbarch_debug
>= 2)
3614 fprintf_unfiltered (gdb_stdlog
, "gdbarch_process_record_signal called\n");
3615 return gdbarch
->process_record_signal (gdbarch
, regcache
, signal
);
3619 set_gdbarch_process_record_signal (struct gdbarch
*gdbarch
,
3620 gdbarch_process_record_signal_ftype process_record_signal
)
3622 gdbarch
->process_record_signal
= process_record_signal
;
3626 gdbarch_target_signal_from_host (struct gdbarch
*gdbarch
, int signo
)
3628 gdb_assert (gdbarch
!= NULL
);
3629 gdb_assert (gdbarch
->target_signal_from_host
!= NULL
);
3630 if (gdbarch_debug
>= 2)
3631 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_signal_from_host called\n");
3632 return gdbarch
->target_signal_from_host (gdbarch
, signo
);
3636 set_gdbarch_target_signal_from_host (struct gdbarch
*gdbarch
,
3637 gdbarch_target_signal_from_host_ftype target_signal_from_host
)
3639 gdbarch
->target_signal_from_host
= target_signal_from_host
;
3643 gdbarch_target_signal_to_host (struct gdbarch
*gdbarch
, enum target_signal ts
)
3645 gdb_assert (gdbarch
!= NULL
);
3646 gdb_assert (gdbarch
->target_signal_to_host
!= NULL
);
3647 if (gdbarch_debug
>= 2)
3648 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_signal_to_host called\n");
3649 return gdbarch
->target_signal_to_host (gdbarch
, ts
);
3653 set_gdbarch_target_signal_to_host (struct gdbarch
*gdbarch
,
3654 gdbarch_target_signal_to_host_ftype target_signal_to_host
)
3656 gdbarch
->target_signal_to_host
= target_signal_to_host
;
3660 gdbarch_get_siginfo_type_p (struct gdbarch
*gdbarch
)
3662 gdb_assert (gdbarch
!= NULL
);
3663 return gdbarch
->get_siginfo_type
!= NULL
;
3667 gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
)
3669 gdb_assert (gdbarch
!= NULL
);
3670 gdb_assert (gdbarch
->get_siginfo_type
!= NULL
);
3671 if (gdbarch_debug
>= 2)
3672 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_siginfo_type called\n");
3673 return gdbarch
->get_siginfo_type (gdbarch
);
3677 set_gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
,
3678 gdbarch_get_siginfo_type_ftype get_siginfo_type
)
3680 gdbarch
->get_siginfo_type
= get_siginfo_type
;
3684 gdbarch_record_special_symbol_p (struct gdbarch
*gdbarch
)
3686 gdb_assert (gdbarch
!= NULL
);
3687 return gdbarch
->record_special_symbol
!= NULL
;
3691 gdbarch_record_special_symbol (struct gdbarch
*gdbarch
, struct objfile
*objfile
, asymbol
*sym
)
3693 gdb_assert (gdbarch
!= NULL
);
3694 gdb_assert (gdbarch
->record_special_symbol
!= NULL
);
3695 if (gdbarch_debug
>= 2)
3696 fprintf_unfiltered (gdb_stdlog
, "gdbarch_record_special_symbol called\n");
3697 gdbarch
->record_special_symbol (gdbarch
, objfile
, sym
);
3701 set_gdbarch_record_special_symbol (struct gdbarch
*gdbarch
,
3702 gdbarch_record_special_symbol_ftype record_special_symbol
)
3704 gdbarch
->record_special_symbol
= record_special_symbol
;
3708 gdbarch_get_syscall_number_p (struct gdbarch
*gdbarch
)
3710 gdb_assert (gdbarch
!= NULL
);
3711 return gdbarch
->get_syscall_number
!= NULL
;
3715 gdbarch_get_syscall_number (struct gdbarch
*gdbarch
, ptid_t ptid
)
3717 gdb_assert (gdbarch
!= NULL
);
3718 gdb_assert (gdbarch
->get_syscall_number
!= NULL
);
3719 if (gdbarch_debug
>= 2)
3720 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_syscall_number called\n");
3721 return gdbarch
->get_syscall_number (gdbarch
, ptid
);
3725 set_gdbarch_get_syscall_number (struct gdbarch
*gdbarch
,
3726 gdbarch_get_syscall_number_ftype get_syscall_number
)
3728 gdbarch
->get_syscall_number
= get_syscall_number
;
3732 gdbarch_has_global_solist (struct gdbarch
*gdbarch
)
3734 gdb_assert (gdbarch
!= NULL
);
3735 /* Skip verify of has_global_solist, invalid_p == 0 */
3736 if (gdbarch_debug
>= 2)
3737 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_solist called\n");
3738 return gdbarch
->has_global_solist
;
3742 set_gdbarch_has_global_solist (struct gdbarch
*gdbarch
,
3743 int has_global_solist
)
3745 gdbarch
->has_global_solist
= has_global_solist
;
3749 gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
)
3751 gdb_assert (gdbarch
!= NULL
);
3752 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
3753 if (gdbarch_debug
>= 2)
3754 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_breakpoints called\n");
3755 return gdbarch
->has_global_breakpoints
;
3759 set_gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
,
3760 int has_global_breakpoints
)
3762 gdbarch
->has_global_breakpoints
= has_global_breakpoints
;
3766 gdbarch_has_shared_address_space (struct gdbarch
*gdbarch
)
3768 gdb_assert (gdbarch
!= NULL
);
3769 gdb_assert (gdbarch
->has_shared_address_space
!= NULL
);
3770 if (gdbarch_debug
>= 2)
3771 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_shared_address_space called\n");
3772 return gdbarch
->has_shared_address_space (gdbarch
);
3776 set_gdbarch_has_shared_address_space (struct gdbarch
*gdbarch
,
3777 gdbarch_has_shared_address_space_ftype has_shared_address_space
)
3779 gdbarch
->has_shared_address_space
= has_shared_address_space
;
3783 gdbarch_fast_tracepoint_valid_at (struct gdbarch
*gdbarch
, CORE_ADDR addr
, int *isize
, char **msg
)
3785 gdb_assert (gdbarch
!= NULL
);
3786 gdb_assert (gdbarch
->fast_tracepoint_valid_at
!= NULL
);
3787 if (gdbarch_debug
>= 2)
3788 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fast_tracepoint_valid_at called\n");
3789 return gdbarch
->fast_tracepoint_valid_at (gdbarch
, addr
, isize
, msg
);
3793 set_gdbarch_fast_tracepoint_valid_at (struct gdbarch
*gdbarch
,
3794 gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at
)
3796 gdbarch
->fast_tracepoint_valid_at
= fast_tracepoint_valid_at
;
3800 gdbarch_auto_charset (struct gdbarch
*gdbarch
)
3802 gdb_assert (gdbarch
!= NULL
);
3803 gdb_assert (gdbarch
->auto_charset
!= NULL
);
3804 if (gdbarch_debug
>= 2)
3805 fprintf_unfiltered (gdb_stdlog
, "gdbarch_auto_charset called\n");
3806 return gdbarch
->auto_charset ();
3810 set_gdbarch_auto_charset (struct gdbarch
*gdbarch
,
3811 gdbarch_auto_charset_ftype auto_charset
)
3813 gdbarch
->auto_charset
= auto_charset
;
3817 gdbarch_auto_wide_charset (struct gdbarch
*gdbarch
)
3819 gdb_assert (gdbarch
!= NULL
);
3820 gdb_assert (gdbarch
->auto_wide_charset
!= NULL
);
3821 if (gdbarch_debug
>= 2)
3822 fprintf_unfiltered (gdb_stdlog
, "gdbarch_auto_wide_charset called\n");
3823 return gdbarch
->auto_wide_charset ();
3827 set_gdbarch_auto_wide_charset (struct gdbarch
*gdbarch
,
3828 gdbarch_auto_wide_charset_ftype auto_wide_charset
)
3830 gdbarch
->auto_wide_charset
= auto_wide_charset
;
3834 gdbarch_solib_symbols_extension (struct gdbarch
*gdbarch
)
3836 gdb_assert (gdbarch
!= NULL
);
3837 if (gdbarch_debug
>= 2)
3838 fprintf_unfiltered (gdb_stdlog
, "gdbarch_solib_symbols_extension called\n");
3839 return gdbarch
->solib_symbols_extension
;
3843 set_gdbarch_solib_symbols_extension (struct gdbarch
*gdbarch
,
3844 const char * solib_symbols_extension
)
3846 gdbarch
->solib_symbols_extension
= solib_symbols_extension
;
3850 gdbarch_has_dos_based_file_system (struct gdbarch
*gdbarch
)
3852 gdb_assert (gdbarch
!= NULL
);
3853 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
3854 if (gdbarch_debug
>= 2)
3855 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_dos_based_file_system called\n");
3856 return gdbarch
->has_dos_based_file_system
;
3860 set_gdbarch_has_dos_based_file_system (struct gdbarch
*gdbarch
,
3861 int has_dos_based_file_system
)
3863 gdbarch
->has_dos_based_file_system
= has_dos_based_file_system
;
3867 /* Keep a registry of per-architecture data-pointers required by GDB
3874 gdbarch_data_pre_init_ftype
*pre_init
;
3875 gdbarch_data_post_init_ftype
*post_init
;
3878 struct gdbarch_data_registration
3880 struct gdbarch_data
*data
;
3881 struct gdbarch_data_registration
*next
;
3884 struct gdbarch_data_registry
3887 struct gdbarch_data_registration
*registrations
;
3890 struct gdbarch_data_registry gdbarch_data_registry
=
3895 static struct gdbarch_data
*
3896 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
3897 gdbarch_data_post_init_ftype
*post_init
)
3899 struct gdbarch_data_registration
**curr
;
3901 /* Append the new registration. */
3902 for (curr
= &gdbarch_data_registry
.registrations
;
3904 curr
= &(*curr
)->next
);
3905 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
3906 (*curr
)->next
= NULL
;
3907 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
3908 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
3909 (*curr
)->data
->pre_init
= pre_init
;
3910 (*curr
)->data
->post_init
= post_init
;
3911 (*curr
)->data
->init_p
= 1;
3912 return (*curr
)->data
;
3915 struct gdbarch_data
*
3916 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
3918 return gdbarch_data_register (pre_init
, NULL
);
3921 struct gdbarch_data
*
3922 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
3924 return gdbarch_data_register (NULL
, post_init
);
3927 /* Create/delete the gdbarch data vector. */
3930 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
3932 gdb_assert (gdbarch
->data
== NULL
);
3933 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
3934 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
3937 /* Initialize the current value of the specified per-architecture
3941 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
3942 struct gdbarch_data
*data
,
3945 gdb_assert (data
->index
< gdbarch
->nr_data
);
3946 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
3947 gdb_assert (data
->pre_init
== NULL
);
3948 gdbarch
->data
[data
->index
] = pointer
;
3951 /* Return the current value of the specified per-architecture
3955 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
3957 gdb_assert (data
->index
< gdbarch
->nr_data
);
3958 if (gdbarch
->data
[data
->index
] == NULL
)
3960 /* The data-pointer isn't initialized, call init() to get a
3962 if (data
->pre_init
!= NULL
)
3963 /* Mid architecture creation: pass just the obstack, and not
3964 the entire architecture, as that way it isn't possible for
3965 pre-init code to refer to undefined architecture
3967 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
3968 else if (gdbarch
->initialized_p
3969 && data
->post_init
!= NULL
)
3970 /* Post architecture creation: pass the entire architecture
3971 (as all fields are valid), but be careful to also detect
3972 recursive references. */
3974 gdb_assert (data
->init_p
);
3976 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
3980 /* The architecture initialization hasn't completed - punt -
3981 hope that the caller knows what they are doing. Once
3982 deprecated_set_gdbarch_data has been initialized, this can be
3983 changed to an internal error. */
3985 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
3987 return gdbarch
->data
[data
->index
];
3991 /* Keep a registry of the architectures known by GDB. */
3993 struct gdbarch_registration
3995 enum bfd_architecture bfd_architecture
;
3996 gdbarch_init_ftype
*init
;
3997 gdbarch_dump_tdep_ftype
*dump_tdep
;
3998 struct gdbarch_list
*arches
;
3999 struct gdbarch_registration
*next
;
4002 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
4005 append_name (const char ***buf
, int *nr
, const char *name
)
4007 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
4013 gdbarch_printable_names (void)
4015 /* Accumulate a list of names based on the registed list of
4018 const char **arches
= NULL
;
4019 struct gdbarch_registration
*rego
;
4021 for (rego
= gdbarch_registry
;
4025 const struct bfd_arch_info
*ap
;
4026 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
4028 internal_error (__FILE__
, __LINE__
,
4029 _("gdbarch_architecture_names: multi-arch unknown"));
4032 append_name (&arches
, &nr_arches
, ap
->printable_name
);
4037 append_name (&arches
, &nr_arches
, NULL
);
4043 gdbarch_register (enum bfd_architecture bfd_architecture
,
4044 gdbarch_init_ftype
*init
,
4045 gdbarch_dump_tdep_ftype
*dump_tdep
)
4047 struct gdbarch_registration
**curr
;
4048 const struct bfd_arch_info
*bfd_arch_info
;
4050 /* Check that BFD recognizes this architecture */
4051 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
4052 if (bfd_arch_info
== NULL
)
4054 internal_error (__FILE__
, __LINE__
,
4055 _("gdbarch: Attempt to register "
4056 "unknown architecture (%d)"),
4059 /* Check that we haven't seen this architecture before. */
4060 for (curr
= &gdbarch_registry
;
4062 curr
= &(*curr
)->next
)
4064 if (bfd_architecture
== (*curr
)->bfd_architecture
)
4065 internal_error (__FILE__
, __LINE__
,
4066 _("gdbarch: Duplicate registration "
4067 "of architecture (%s)"),
4068 bfd_arch_info
->printable_name
);
4072 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, %s)\n",
4073 bfd_arch_info
->printable_name
,
4074 host_address_to_string (init
));
4076 (*curr
) = XMALLOC (struct gdbarch_registration
);
4077 (*curr
)->bfd_architecture
= bfd_architecture
;
4078 (*curr
)->init
= init
;
4079 (*curr
)->dump_tdep
= dump_tdep
;
4080 (*curr
)->arches
= NULL
;
4081 (*curr
)->next
= NULL
;
4085 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
4086 gdbarch_init_ftype
*init
)
4088 gdbarch_register (bfd_architecture
, init
, NULL
);
4092 /* Look for an architecture using gdbarch_info. */
4094 struct gdbarch_list
*
4095 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
4096 const struct gdbarch_info
*info
)
4098 for (; arches
!= NULL
; arches
= arches
->next
)
4100 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
4102 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
4104 if (info
->osabi
!= arches
->gdbarch
->osabi
)
4106 if (info
->target_desc
!= arches
->gdbarch
->target_desc
)
4114 /* Find an architecture that matches the specified INFO. Create a new
4115 architecture if needed. Return that new architecture. */
4118 gdbarch_find_by_info (struct gdbarch_info info
)
4120 struct gdbarch
*new_gdbarch
;
4121 struct gdbarch_registration
*rego
;
4123 /* Fill in missing parts of the INFO struct using a number of
4124 sources: "set ..."; INFOabfd supplied; and the global
4126 gdbarch_info_fill (&info
);
4128 /* Must have found some sort of architecture. */
4129 gdb_assert (info
.bfd_arch_info
!= NULL
);
4133 fprintf_unfiltered (gdb_stdlog
,
4134 "gdbarch_find_by_info: info.bfd_arch_info %s\n",
4135 (info
.bfd_arch_info
!= NULL
4136 ? info
.bfd_arch_info
->printable_name
4138 fprintf_unfiltered (gdb_stdlog
,
4139 "gdbarch_find_by_info: info.byte_order %d (%s)\n",
4141 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
4142 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
4144 fprintf_unfiltered (gdb_stdlog
,
4145 "gdbarch_find_by_info: info.osabi %d (%s)\n",
4146 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
4147 fprintf_unfiltered (gdb_stdlog
,
4148 "gdbarch_find_by_info: info.abfd %s\n",
4149 host_address_to_string (info
.abfd
));
4150 fprintf_unfiltered (gdb_stdlog
,
4151 "gdbarch_find_by_info: info.tdep_info %s\n",
4152 host_address_to_string (info
.tdep_info
));
4155 /* Find the tdep code that knows about this architecture. */
4156 for (rego
= gdbarch_registry
;
4159 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
4164 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4165 "No matching architecture\n");
4169 /* Ask the tdep code for an architecture that matches "info". */
4170 new_gdbarch
= rego
->init (info
, rego
->arches
);
4172 /* Did the tdep code like it? No. Reject the change and revert to
4173 the old architecture. */
4174 if (new_gdbarch
== NULL
)
4177 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4178 "Target rejected architecture\n");
4182 /* Is this a pre-existing architecture (as determined by already
4183 being initialized)? Move it to the front of the architecture
4184 list (keeping the list sorted Most Recently Used). */
4185 if (new_gdbarch
->initialized_p
)
4187 struct gdbarch_list
**list
;
4188 struct gdbarch_list
*this;
4190 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4191 "Previous architecture %s (%s) selected\n",
4192 host_address_to_string (new_gdbarch
),
4193 new_gdbarch
->bfd_arch_info
->printable_name
);
4194 /* Find the existing arch in the list. */
4195 for (list
= ®o
->arches
;
4196 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
4197 list
= &(*list
)->next
);
4198 /* It had better be in the list of architectures. */
4199 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
4202 (*list
) = this->next
;
4203 /* Insert THIS at the front. */
4204 this->next
= rego
->arches
;
4205 rego
->arches
= this;
4210 /* It's a new architecture. */
4212 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4213 "New architecture %s (%s) selected\n",
4214 host_address_to_string (new_gdbarch
),
4215 new_gdbarch
->bfd_arch_info
->printable_name
);
4217 /* Insert the new architecture into the front of the architecture
4218 list (keep the list sorted Most Recently Used). */
4220 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
4221 this->next
= rego
->arches
;
4222 this->gdbarch
= new_gdbarch
;
4223 rego
->arches
= this;
4226 /* Check that the newly installed architecture is valid. Plug in
4227 any post init values. */
4228 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
4229 verify_gdbarch (new_gdbarch
);
4230 new_gdbarch
->initialized_p
= 1;
4233 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
4238 /* Make the specified architecture current. */
4241 deprecated_target_gdbarch_select_hack (struct gdbarch
*new_gdbarch
)
4243 gdb_assert (new_gdbarch
!= NULL
);
4244 gdb_assert (new_gdbarch
->initialized_p
);
4245 target_gdbarch
= new_gdbarch
;
4246 observer_notify_architecture_changed (new_gdbarch
);
4247 registers_changed ();
4250 extern void _initialize_gdbarch (void);
4253 _initialize_gdbarch (void)
4255 add_setshow_zinteger_cmd ("arch", class_maintenance
, &gdbarch_debug
, _("\
4256 Set architecture debugging."), _("\
4257 Show architecture debugging."), _("\
4258 When non-zero, architecture debugging is enabled."),
4261 &setdebuglist
, &showdebuglist
);