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_write_ftype
*pseudo_register_write
;
171 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
172 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
173 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
174 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
175 gdbarch_register_name_ftype
*register_name
;
176 gdbarch_register_type_ftype
*register_type
;
177 gdbarch_dummy_id_ftype
*dummy_id
;
178 int deprecated_fp_regnum
;
179 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
180 int call_dummy_location
;
181 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
182 gdbarch_print_registers_info_ftype
*print_registers_info
;
183 gdbarch_print_float_info_ftype
*print_float_info
;
184 gdbarch_print_vector_info_ftype
*print_vector_info
;
185 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
186 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
187 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
188 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
189 int believe_pcc_promotion
;
190 gdbarch_convert_register_p_ftype
*convert_register_p
;
191 gdbarch_register_to_value_ftype
*register_to_value
;
192 gdbarch_value_to_register_ftype
*value_to_register
;
193 gdbarch_value_from_register_ftype
*value_from_register
;
194 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
195 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
196 gdbarch_integer_to_address_ftype
*integer_to_address
;
197 gdbarch_return_value_ftype
*return_value
;
198 gdbarch_skip_prologue_ftype
*skip_prologue
;
199 gdbarch_skip_main_prologue_ftype
*skip_main_prologue
;
200 gdbarch_inner_than_ftype
*inner_than
;
201 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
202 gdbarch_remote_breakpoint_from_pc_ftype
*remote_breakpoint_from_pc
;
203 gdbarch_adjust_breakpoint_address_ftype
*adjust_breakpoint_address
;
204 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
205 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
206 CORE_ADDR decr_pc_after_break
;
207 CORE_ADDR deprecated_function_start_offset
;
208 gdbarch_remote_register_number_ftype
*remote_register_number
;
209 gdbarch_fetch_tls_load_module_address_ftype
*fetch_tls_load_module_address
;
210 CORE_ADDR frame_args_skip
;
211 gdbarch_unwind_pc_ftype
*unwind_pc
;
212 gdbarch_unwind_sp_ftype
*unwind_sp
;
213 gdbarch_frame_num_args_ftype
*frame_num_args
;
214 gdbarch_frame_align_ftype
*frame_align
;
215 gdbarch_stabs_argument_has_addr_ftype
*stabs_argument_has_addr
;
216 int frame_red_zone_size
;
217 gdbarch_convert_from_func_ptr_addr_ftype
*convert_from_func_ptr_addr
;
218 gdbarch_addr_bits_remove_ftype
*addr_bits_remove
;
219 gdbarch_smash_text_address_ftype
*smash_text_address
;
220 gdbarch_software_single_step_ftype
*software_single_step
;
221 gdbarch_single_step_through_delay_ftype
*single_step_through_delay
;
222 gdbarch_print_insn_ftype
*print_insn
;
223 gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
;
224 gdbarch_skip_solib_resolver_ftype
*skip_solib_resolver
;
225 gdbarch_in_solib_return_trampoline_ftype
*in_solib_return_trampoline
;
226 gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
;
227 gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
;
228 gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
;
229 int cannot_step_breakpoint
;
230 int have_nonsteppable_watchpoint
;
231 gdbarch_address_class_type_flags_ftype
*address_class_type_flags
;
232 gdbarch_address_class_type_flags_to_name_ftype
*address_class_type_flags_to_name
;
233 gdbarch_address_class_name_to_type_flags_ftype
*address_class_name_to_type_flags
;
234 gdbarch_register_reggroup_p_ftype
*register_reggroup_p
;
235 gdbarch_fetch_pointer_argument_ftype
*fetch_pointer_argument
;
236 gdbarch_regset_from_core_section_ftype
*regset_from_core_section
;
237 struct core_regset_section
* core_regset_sections
;
238 gdbarch_core_xfer_shared_libraries_ftype
*core_xfer_shared_libraries
;
239 gdbarch_core_pid_to_str_ftype
*core_pid_to_str
;
240 const char * gcore_bfd_target
;
241 int vtable_function_descriptors
;
243 gdbarch_skip_permanent_breakpoint_ftype
*skip_permanent_breakpoint
;
244 ULONGEST max_insn_length
;
245 gdbarch_displaced_step_copy_insn_ftype
*displaced_step_copy_insn
;
246 gdbarch_displaced_step_hw_singlestep_ftype
*displaced_step_hw_singlestep
;
247 gdbarch_displaced_step_fixup_ftype
*displaced_step_fixup
;
248 gdbarch_displaced_step_free_closure_ftype
*displaced_step_free_closure
;
249 gdbarch_displaced_step_location_ftype
*displaced_step_location
;
250 gdbarch_relocate_instruction_ftype
*relocate_instruction
;
251 gdbarch_overlay_update_ftype
*overlay_update
;
252 gdbarch_core_read_description_ftype
*core_read_description
;
253 gdbarch_static_transform_name_ftype
*static_transform_name
;
254 int sofun_address_maybe_missing
;
255 gdbarch_process_record_ftype
*process_record
;
256 gdbarch_process_record_signal_ftype
*process_record_signal
;
257 gdbarch_target_signal_from_host_ftype
*target_signal_from_host
;
258 gdbarch_target_signal_to_host_ftype
*target_signal_to_host
;
259 gdbarch_get_siginfo_type_ftype
*get_siginfo_type
;
260 gdbarch_record_special_symbol_ftype
*record_special_symbol
;
261 gdbarch_get_syscall_number_ftype
*get_syscall_number
;
262 int has_global_solist
;
263 int has_global_breakpoints
;
264 gdbarch_has_shared_address_space_ftype
*has_shared_address_space
;
265 gdbarch_fast_tracepoint_valid_at_ftype
*fast_tracepoint_valid_at
;
266 gdbarch_auto_charset_ftype
*auto_charset
;
267 gdbarch_auto_wide_charset_ftype
*auto_wide_charset
;
268 const char * solib_symbols_extension
;
269 int has_dos_based_file_system
;
273 /* The default architecture uses host values (for want of a better
276 extern const struct bfd_arch_info bfd_default_arch_struct
;
278 struct gdbarch startup_gdbarch
=
280 1, /* Always initialized. */
281 NULL
, /* The obstack. */
282 /* basic architecture information */
283 &bfd_default_arch_struct
, /* bfd_arch_info */
284 BFD_ENDIAN_BIG
, /* byte_order */
285 BFD_ENDIAN_BIG
, /* byte_order_for_code */
286 GDB_OSABI_UNKNOWN
, /* osabi */
288 /* target specific vector and its dump routine */
290 /*per-architecture data-pointers and swap regions */
292 /* Multi-arch values */
293 1, /* bits_big_endian */
294 8 * sizeof (short), /* short_bit */
295 8 * sizeof (int), /* int_bit */
296 8 * sizeof (long), /* long_bit */
297 8 * sizeof (LONGEST
), /* long_long_bit */
300 8 * sizeof (float), /* float_bit */
301 0, /* float_format */
302 8 * sizeof (double), /* double_bit */
303 0, /* double_format */
304 8 * sizeof (long double), /* long_double_bit */
305 0, /* long_double_format */
306 8 * sizeof (void*), /* ptr_bit */
307 8 * sizeof (void*), /* addr_bit */
308 sizeof (void*), /* dwarf2_addr_size */
312 legacy_virtual_frame_pointer
, /* virtual_frame_pointer */
313 0, /* pseudo_register_read */
314 0, /* pseudo_register_write */
316 0, /* num_pseudo_regs */
321 no_op_reg_to_regnum
, /* stab_reg_to_regnum */
322 no_op_reg_to_regnum
, /* ecoff_reg_to_regnum */
323 no_op_reg_to_regnum
, /* sdb_reg_to_regnum */
324 no_op_reg_to_regnum
, /* dwarf2_reg_to_regnum */
325 0, /* register_name */
326 0, /* register_type */
328 -1, /* deprecated_fp_regnum */
329 0, /* push_dummy_call */
330 0, /* call_dummy_location */
331 0, /* push_dummy_code */
332 default_print_registers_info
, /* print_registers_info */
333 0, /* print_float_info */
334 0, /* print_vector_info */
335 legacy_register_sim_regno
, /* register_sim_regno */
336 cannot_register_not
, /* cannot_fetch_register */
337 cannot_register_not
, /* cannot_store_register */
338 0, /* get_longjmp_target */
339 0, /* believe_pcc_promotion */
340 generic_convert_register_p
, /* convert_register_p */
341 0, /* register_to_value */
342 0, /* value_to_register */
343 0, /* value_from_register */
344 unsigned_pointer_to_address
, /* pointer_to_address */
345 unsigned_address_to_pointer
, /* address_to_pointer */
346 0, /* integer_to_address */
347 0, /* return_value */
348 0, /* skip_prologue */
349 0, /* skip_main_prologue */
351 0, /* breakpoint_from_pc */
352 default_remote_breakpoint_from_pc
, /* remote_breakpoint_from_pc */
353 0, /* adjust_breakpoint_address */
354 default_memory_insert_breakpoint
, /* memory_insert_breakpoint */
355 default_memory_remove_breakpoint
, /* memory_remove_breakpoint */
356 0, /* decr_pc_after_break */
357 0, /* deprecated_function_start_offset */
358 default_remote_register_number
, /* remote_register_number */
359 0, /* fetch_tls_load_module_address */
360 0, /* frame_args_skip */
363 0, /* frame_num_args */
365 default_stabs_argument_has_addr
, /* stabs_argument_has_addr */
366 0, /* frame_red_zone_size */
367 convert_from_func_ptr_addr_identity
, /* convert_from_func_ptr_addr */
368 core_addr_identity
, /* addr_bits_remove */
369 core_addr_identity
, /* smash_text_address */
370 0, /* software_single_step */
371 0, /* single_step_through_delay */
373 0, /* skip_trampoline_code */
374 generic_skip_solib_resolver
, /* skip_solib_resolver */
375 generic_in_solib_return_trampoline
, /* in_solib_return_trampoline */
376 generic_in_function_epilogue_p
, /* in_function_epilogue_p */
377 0, /* elf_make_msymbol_special */
378 0, /* coff_make_msymbol_special */
379 0, /* cannot_step_breakpoint */
380 0, /* have_nonsteppable_watchpoint */
381 0, /* address_class_type_flags */
382 0, /* address_class_type_flags_to_name */
383 0, /* address_class_name_to_type_flags */
384 default_register_reggroup_p
, /* register_reggroup_p */
385 0, /* fetch_pointer_argument */
386 0, /* regset_from_core_section */
387 0, /* core_regset_sections */
388 0, /* core_xfer_shared_libraries */
389 0, /* core_pid_to_str */
390 0, /* gcore_bfd_target */
391 0, /* vtable_function_descriptors */
392 0, /* vbit_in_delta */
393 0, /* skip_permanent_breakpoint */
394 0, /* max_insn_length */
395 0, /* displaced_step_copy_insn */
396 default_displaced_step_hw_singlestep
, /* displaced_step_hw_singlestep */
397 0, /* displaced_step_fixup */
398 NULL
, /* displaced_step_free_closure */
399 NULL
, /* displaced_step_location */
400 0, /* relocate_instruction */
401 0, /* overlay_update */
402 0, /* core_read_description */
403 0, /* static_transform_name */
404 0, /* sofun_address_maybe_missing */
405 0, /* process_record */
406 0, /* process_record_signal */
407 default_target_signal_from_host
, /* target_signal_from_host */
408 default_target_signal_to_host
, /* target_signal_to_host */
409 0, /* get_siginfo_type */
410 0, /* record_special_symbol */
411 0, /* get_syscall_number */
412 0, /* has_global_solist */
413 0, /* has_global_breakpoints */
414 default_has_shared_address_space
, /* has_shared_address_space */
415 default_fast_tracepoint_valid_at
, /* fast_tracepoint_valid_at */
416 default_auto_charset
, /* auto_charset */
417 default_auto_wide_charset
, /* auto_wide_charset */
418 0, /* solib_symbols_extension */
419 0, /* has_dos_based_file_system */
420 /* startup_gdbarch() */
423 struct gdbarch
*target_gdbarch
= &startup_gdbarch
;
425 /* Create a new ``struct gdbarch'' based on information provided by
426 ``struct gdbarch_info''. */
429 gdbarch_alloc (const struct gdbarch_info
*info
,
430 struct gdbarch_tdep
*tdep
)
432 struct gdbarch
*gdbarch
;
434 /* Create an obstack for allocating all the per-architecture memory,
435 then use that to allocate the architecture vector. */
436 struct obstack
*obstack
= XMALLOC (struct obstack
);
437 obstack_init (obstack
);
438 gdbarch
= obstack_alloc (obstack
, sizeof (*gdbarch
));
439 memset (gdbarch
, 0, sizeof (*gdbarch
));
440 gdbarch
->obstack
= obstack
;
442 alloc_gdbarch_data (gdbarch
);
444 gdbarch
->tdep
= tdep
;
446 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
447 gdbarch
->byte_order
= info
->byte_order
;
448 gdbarch
->byte_order_for_code
= info
->byte_order_for_code
;
449 gdbarch
->osabi
= info
->osabi
;
450 gdbarch
->target_desc
= info
->target_desc
;
452 /* Force the explicit initialization of these. */
453 gdbarch
->bits_big_endian
= (gdbarch
->byte_order
== BFD_ENDIAN_BIG
);
454 gdbarch
->short_bit
= 2*TARGET_CHAR_BIT
;
455 gdbarch
->int_bit
= 4*TARGET_CHAR_BIT
;
456 gdbarch
->long_bit
= 4*TARGET_CHAR_BIT
;
457 gdbarch
->long_long_bit
= 2*gdbarch
->long_bit
;
458 gdbarch
->half_bit
= 2*TARGET_CHAR_BIT
;
459 gdbarch
->float_bit
= 4*TARGET_CHAR_BIT
;
460 gdbarch
->double_bit
= 8*TARGET_CHAR_BIT
;
461 gdbarch
->long_double_bit
= 8*TARGET_CHAR_BIT
;
462 gdbarch
->ptr_bit
= gdbarch
->int_bit
;
463 gdbarch
->char_signed
= -1;
464 gdbarch
->virtual_frame_pointer
= legacy_virtual_frame_pointer
;
465 gdbarch
->num_regs
= -1;
466 gdbarch
->sp_regnum
= -1;
467 gdbarch
->pc_regnum
= -1;
468 gdbarch
->ps_regnum
= -1;
469 gdbarch
->fp0_regnum
= -1;
470 gdbarch
->stab_reg_to_regnum
= no_op_reg_to_regnum
;
471 gdbarch
->ecoff_reg_to_regnum
= no_op_reg_to_regnum
;
472 gdbarch
->sdb_reg_to_regnum
= no_op_reg_to_regnum
;
473 gdbarch
->dwarf2_reg_to_regnum
= no_op_reg_to_regnum
;
474 gdbarch
->deprecated_fp_regnum
= -1;
475 gdbarch
->call_dummy_location
= AT_ENTRY_POINT
;
476 gdbarch
->print_registers_info
= default_print_registers_info
;
477 gdbarch
->register_sim_regno
= legacy_register_sim_regno
;
478 gdbarch
->cannot_fetch_register
= cannot_register_not
;
479 gdbarch
->cannot_store_register
= cannot_register_not
;
480 gdbarch
->convert_register_p
= generic_convert_register_p
;
481 gdbarch
->value_from_register
= default_value_from_register
;
482 gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
483 gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
484 gdbarch
->remote_breakpoint_from_pc
= default_remote_breakpoint_from_pc
;
485 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
486 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
487 gdbarch
->remote_register_number
= default_remote_register_number
;
488 gdbarch
->stabs_argument_has_addr
= default_stabs_argument_has_addr
;
489 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr_identity
;
490 gdbarch
->addr_bits_remove
= core_addr_identity
;
491 gdbarch
->smash_text_address
= core_addr_identity
;
492 gdbarch
->skip_trampoline_code
= generic_skip_trampoline_code
;
493 gdbarch
->skip_solib_resolver
= generic_skip_solib_resolver
;
494 gdbarch
->in_solib_return_trampoline
= generic_in_solib_return_trampoline
;
495 gdbarch
->in_function_epilogue_p
= generic_in_function_epilogue_p
;
496 gdbarch
->elf_make_msymbol_special
= default_elf_make_msymbol_special
;
497 gdbarch
->coff_make_msymbol_special
= default_coff_make_msymbol_special
;
498 gdbarch
->register_reggroup_p
= default_register_reggroup_p
;
499 gdbarch
->displaced_step_hw_singlestep
= default_displaced_step_hw_singlestep
;
500 gdbarch
->displaced_step_fixup
= NULL
;
501 gdbarch
->displaced_step_free_closure
= NULL
;
502 gdbarch
->displaced_step_location
= NULL
;
503 gdbarch
->relocate_instruction
= NULL
;
504 gdbarch
->target_signal_from_host
= default_target_signal_from_host
;
505 gdbarch
->target_signal_to_host
= default_target_signal_to_host
;
506 gdbarch
->has_shared_address_space
= default_has_shared_address_space
;
507 gdbarch
->fast_tracepoint_valid_at
= default_fast_tracepoint_valid_at
;
508 gdbarch
->auto_charset
= default_auto_charset
;
509 gdbarch
->auto_wide_charset
= default_auto_wide_charset
;
510 /* gdbarch_alloc() */
516 /* Allocate extra space using the per-architecture obstack. */
519 gdbarch_obstack_zalloc (struct gdbarch
*arch
, long size
)
521 void *data
= obstack_alloc (arch
->obstack
, size
);
523 memset (data
, 0, size
);
528 /* Free a gdbarch struct. This should never happen in normal
529 operation --- once you've created a gdbarch, you keep it around.
530 However, if an architecture's init function encounters an error
531 building the structure, it may need to clean up a partially
532 constructed gdbarch. */
535 gdbarch_free (struct gdbarch
*arch
)
537 struct obstack
*obstack
;
539 gdb_assert (arch
!= NULL
);
540 gdb_assert (!arch
->initialized_p
);
541 obstack
= arch
->obstack
;
542 obstack_free (obstack
, 0); /* Includes the ARCH. */
547 /* Ensure that all values in a GDBARCH are reasonable. */
550 verify_gdbarch (struct gdbarch
*gdbarch
)
553 struct cleanup
*cleanups
;
557 log
= mem_fileopen ();
558 cleanups
= make_cleanup_ui_file_delete (log
);
560 if (gdbarch
->byte_order
== BFD_ENDIAN_UNKNOWN
)
561 fprintf_unfiltered (log
, "\n\tbyte-order");
562 if (gdbarch
->bfd_arch_info
== NULL
)
563 fprintf_unfiltered (log
, "\n\tbfd_arch_info");
564 /* Check those that need to be defined for the given multi-arch level. */
565 /* Skip verify of bits_big_endian, invalid_p == 0 */
566 /* Skip verify of short_bit, invalid_p == 0 */
567 /* Skip verify of int_bit, invalid_p == 0 */
568 /* Skip verify of long_bit, invalid_p == 0 */
569 /* Skip verify of long_long_bit, invalid_p == 0 */
570 /* Skip verify of half_bit, invalid_p == 0 */
571 if (gdbarch
->half_format
== 0)
572 gdbarch
->half_format
= floatformats_ieee_half
;
573 /* Skip verify of float_bit, invalid_p == 0 */
574 if (gdbarch
->float_format
== 0)
575 gdbarch
->float_format
= floatformats_ieee_single
;
576 /* Skip verify of double_bit, invalid_p == 0 */
577 if (gdbarch
->double_format
== 0)
578 gdbarch
->double_format
= floatformats_ieee_double
;
579 /* Skip verify of long_double_bit, invalid_p == 0 */
580 if (gdbarch
->long_double_format
== 0)
581 gdbarch
->long_double_format
= floatformats_ieee_double
;
582 /* Skip verify of ptr_bit, invalid_p == 0 */
583 if (gdbarch
->addr_bit
== 0)
584 gdbarch
->addr_bit
= gdbarch_ptr_bit (gdbarch
);
585 if (gdbarch
->dwarf2_addr_size
== 0)
586 gdbarch
->dwarf2_addr_size
= gdbarch_ptr_bit (gdbarch
) / TARGET_CHAR_BIT
;
587 if (gdbarch
->char_signed
== -1)
588 gdbarch
->char_signed
= 1;
589 /* Skip verify of read_pc, has predicate */
590 /* Skip verify of write_pc, has predicate */
591 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
592 /* Skip verify of pseudo_register_read, has predicate */
593 /* Skip verify of pseudo_register_write, has predicate */
594 if (gdbarch
->num_regs
== -1)
595 fprintf_unfiltered (log
, "\n\tnum_regs");
596 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
597 /* Skip verify of sp_regnum, invalid_p == 0 */
598 /* Skip verify of pc_regnum, invalid_p == 0 */
599 /* Skip verify of ps_regnum, invalid_p == 0 */
600 /* Skip verify of fp0_regnum, invalid_p == 0 */
601 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
602 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
603 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
604 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
605 if (gdbarch
->register_name
== 0)
606 fprintf_unfiltered (log
, "\n\tregister_name");
607 /* Skip verify of register_type, has predicate */
608 /* Skip verify of dummy_id, has predicate */
609 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
610 /* Skip verify of push_dummy_call, has predicate */
611 /* Skip verify of call_dummy_location, invalid_p == 0 */
612 /* Skip verify of push_dummy_code, has predicate */
613 /* Skip verify of print_registers_info, invalid_p == 0 */
614 /* Skip verify of print_float_info, has predicate */
615 /* Skip verify of print_vector_info, has predicate */
616 /* Skip verify of register_sim_regno, invalid_p == 0 */
617 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
618 /* Skip verify of cannot_store_register, invalid_p == 0 */
619 /* Skip verify of get_longjmp_target, has predicate */
620 /* Skip verify of convert_register_p, invalid_p == 0 */
621 /* Skip verify of value_from_register, invalid_p == 0 */
622 /* Skip verify of pointer_to_address, invalid_p == 0 */
623 /* Skip verify of address_to_pointer, invalid_p == 0 */
624 /* Skip verify of integer_to_address, has predicate */
625 /* Skip verify of return_value, has predicate */
626 if (gdbarch
->skip_prologue
== 0)
627 fprintf_unfiltered (log
, "\n\tskip_prologue");
628 /* Skip verify of skip_main_prologue, has predicate */
629 if (gdbarch
->inner_than
== 0)
630 fprintf_unfiltered (log
, "\n\tinner_than");
631 if (gdbarch
->breakpoint_from_pc
== 0)
632 fprintf_unfiltered (log
, "\n\tbreakpoint_from_pc");
633 /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
634 /* Skip verify of adjust_breakpoint_address, has predicate */
635 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
636 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
637 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
638 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
639 /* Skip verify of remote_register_number, invalid_p == 0 */
640 /* Skip verify of fetch_tls_load_module_address, has predicate */
641 /* Skip verify of frame_args_skip, invalid_p == 0 */
642 /* Skip verify of unwind_pc, has predicate */
643 /* Skip verify of unwind_sp, has predicate */
644 /* Skip verify of frame_num_args, has predicate */
645 /* Skip verify of frame_align, has predicate */
646 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
647 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
648 /* Skip verify of addr_bits_remove, invalid_p == 0 */
649 /* Skip verify of smash_text_address, invalid_p == 0 */
650 /* Skip verify of software_single_step, has predicate */
651 /* Skip verify of single_step_through_delay, has predicate */
652 if (gdbarch
->print_insn
== 0)
653 fprintf_unfiltered (log
, "\n\tprint_insn");
654 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
655 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
656 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
657 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
658 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
659 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
660 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
661 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
662 /* Skip verify of address_class_type_flags, has predicate */
663 /* Skip verify of address_class_type_flags_to_name, has predicate */
664 /* Skip verify of address_class_name_to_type_flags, has predicate */
665 /* Skip verify of register_reggroup_p, invalid_p == 0 */
666 /* Skip verify of fetch_pointer_argument, has predicate */
667 /* Skip verify of regset_from_core_section, has predicate */
668 /* Skip verify of core_xfer_shared_libraries, has predicate */
669 /* Skip verify of core_pid_to_str, has predicate */
670 /* Skip verify of gcore_bfd_target, has predicate */
671 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
672 /* Skip verify of vbit_in_delta, invalid_p == 0 */
673 /* Skip verify of skip_permanent_breakpoint, has predicate */
674 /* Skip verify of max_insn_length, has predicate */
675 /* Skip verify of displaced_step_copy_insn, has predicate */
676 /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
677 /* Skip verify of displaced_step_fixup, has predicate */
678 if ((! gdbarch
->displaced_step_free_closure
) != (! gdbarch
->displaced_step_copy_insn
))
679 fprintf_unfiltered (log
, "\n\tdisplaced_step_free_closure");
680 if ((! gdbarch
->displaced_step_location
) != (! gdbarch
->displaced_step_copy_insn
))
681 fprintf_unfiltered (log
, "\n\tdisplaced_step_location");
682 /* Skip verify of relocate_instruction, has predicate */
683 /* Skip verify of overlay_update, has predicate */
684 /* Skip verify of core_read_description, has predicate */
685 /* Skip verify of static_transform_name, has predicate */
686 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
687 /* Skip verify of process_record, has predicate */
688 /* Skip verify of process_record_signal, has predicate */
689 /* Skip verify of target_signal_from_host, invalid_p == 0 */
690 /* Skip verify of target_signal_to_host, invalid_p == 0 */
691 /* Skip verify of get_siginfo_type, has predicate */
692 /* Skip verify of record_special_symbol, has predicate */
693 /* Skip verify of get_syscall_number, has predicate */
694 /* Skip verify of has_global_solist, invalid_p == 0 */
695 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
696 /* Skip verify of has_shared_address_space, invalid_p == 0 */
697 /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
698 /* Skip verify of auto_charset, invalid_p == 0 */
699 /* Skip verify of auto_wide_charset, invalid_p == 0 */
700 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
701 buf
= ui_file_xstrdup (log
, &length
);
702 make_cleanup (xfree
, buf
);
704 internal_error (__FILE__
, __LINE__
,
705 _("verify_gdbarch: the following are invalid ...%s"),
707 do_cleanups (cleanups
);
711 /* Print out the details of the current architecture. */
714 gdbarch_dump (struct gdbarch
*gdbarch
, struct ui_file
*file
)
716 const char *gdb_nm_file
= "<not-defined>";
718 #if defined (GDB_NM_FILE)
719 gdb_nm_file
= GDB_NM_FILE
;
721 fprintf_unfiltered (file
,
722 "gdbarch_dump: GDB_NM_FILE = %s\n",
724 fprintf_unfiltered (file
,
725 "gdbarch_dump: addr_bit = %s\n",
726 plongest (gdbarch
->addr_bit
));
727 fprintf_unfiltered (file
,
728 "gdbarch_dump: addr_bits_remove = <%s>\n",
729 host_address_to_string (gdbarch
->addr_bits_remove
));
730 fprintf_unfiltered (file
,
731 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
732 gdbarch_address_class_name_to_type_flags_p (gdbarch
));
733 fprintf_unfiltered (file
,
734 "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
735 host_address_to_string (gdbarch
->address_class_name_to_type_flags
));
736 fprintf_unfiltered (file
,
737 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
738 gdbarch_address_class_type_flags_p (gdbarch
));
739 fprintf_unfiltered (file
,
740 "gdbarch_dump: address_class_type_flags = <%s>\n",
741 host_address_to_string (gdbarch
->address_class_type_flags
));
742 fprintf_unfiltered (file
,
743 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
744 gdbarch_address_class_type_flags_to_name_p (gdbarch
));
745 fprintf_unfiltered (file
,
746 "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
747 host_address_to_string (gdbarch
->address_class_type_flags_to_name
));
748 fprintf_unfiltered (file
,
749 "gdbarch_dump: address_to_pointer = <%s>\n",
750 host_address_to_string (gdbarch
->address_to_pointer
));
751 fprintf_unfiltered (file
,
752 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
753 gdbarch_adjust_breakpoint_address_p (gdbarch
));
754 fprintf_unfiltered (file
,
755 "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
756 host_address_to_string (gdbarch
->adjust_breakpoint_address
));
757 fprintf_unfiltered (file
,
758 "gdbarch_dump: auto_charset = <%s>\n",
759 host_address_to_string (gdbarch
->auto_charset
));
760 fprintf_unfiltered (file
,
761 "gdbarch_dump: auto_wide_charset = <%s>\n",
762 host_address_to_string (gdbarch
->auto_wide_charset
));
763 fprintf_unfiltered (file
,
764 "gdbarch_dump: believe_pcc_promotion = %s\n",
765 plongest (gdbarch
->believe_pcc_promotion
));
766 fprintf_unfiltered (file
,
767 "gdbarch_dump: bfd_arch_info = %s\n",
768 gdbarch_bfd_arch_info (gdbarch
)->printable_name
);
769 fprintf_unfiltered (file
,
770 "gdbarch_dump: bits_big_endian = %s\n",
771 plongest (gdbarch
->bits_big_endian
));
772 fprintf_unfiltered (file
,
773 "gdbarch_dump: breakpoint_from_pc = <%s>\n",
774 host_address_to_string (gdbarch
->breakpoint_from_pc
));
775 fprintf_unfiltered (file
,
776 "gdbarch_dump: byte_order = %s\n",
777 plongest (gdbarch
->byte_order
));
778 fprintf_unfiltered (file
,
779 "gdbarch_dump: byte_order_for_code = %s\n",
780 plongest (gdbarch
->byte_order_for_code
));
781 fprintf_unfiltered (file
,
782 "gdbarch_dump: call_dummy_location = %s\n",
783 plongest (gdbarch
->call_dummy_location
));
784 fprintf_unfiltered (file
,
785 "gdbarch_dump: cannot_fetch_register = <%s>\n",
786 host_address_to_string (gdbarch
->cannot_fetch_register
));
787 fprintf_unfiltered (file
,
788 "gdbarch_dump: cannot_step_breakpoint = %s\n",
789 plongest (gdbarch
->cannot_step_breakpoint
));
790 fprintf_unfiltered (file
,
791 "gdbarch_dump: cannot_store_register = <%s>\n",
792 host_address_to_string (gdbarch
->cannot_store_register
));
793 fprintf_unfiltered (file
,
794 "gdbarch_dump: char_signed = %s\n",
795 plongest (gdbarch
->char_signed
));
796 fprintf_unfiltered (file
,
797 "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
798 host_address_to_string (gdbarch
->coff_make_msymbol_special
));
799 fprintf_unfiltered (file
,
800 "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
801 host_address_to_string (gdbarch
->convert_from_func_ptr_addr
));
802 fprintf_unfiltered (file
,
803 "gdbarch_dump: convert_register_p = <%s>\n",
804 host_address_to_string (gdbarch
->convert_register_p
));
805 fprintf_unfiltered (file
,
806 "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
807 gdbarch_core_pid_to_str_p (gdbarch
));
808 fprintf_unfiltered (file
,
809 "gdbarch_dump: core_pid_to_str = <%s>\n",
810 host_address_to_string (gdbarch
->core_pid_to_str
));
811 fprintf_unfiltered (file
,
812 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
813 gdbarch_core_read_description_p (gdbarch
));
814 fprintf_unfiltered (file
,
815 "gdbarch_dump: core_read_description = <%s>\n",
816 host_address_to_string (gdbarch
->core_read_description
));
817 fprintf_unfiltered (file
,
818 "gdbarch_dump: core_regset_sections = %s\n",
819 host_address_to_string (gdbarch
->core_regset_sections
));
820 fprintf_unfiltered (file
,
821 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
822 gdbarch_core_xfer_shared_libraries_p (gdbarch
));
823 fprintf_unfiltered (file
,
824 "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
825 host_address_to_string (gdbarch
->core_xfer_shared_libraries
));
826 fprintf_unfiltered (file
,
827 "gdbarch_dump: decr_pc_after_break = %s\n",
828 core_addr_to_string_nz (gdbarch
->decr_pc_after_break
));
829 fprintf_unfiltered (file
,
830 "gdbarch_dump: deprecated_fp_regnum = %s\n",
831 plongest (gdbarch
->deprecated_fp_regnum
));
832 fprintf_unfiltered (file
,
833 "gdbarch_dump: deprecated_function_start_offset = %s\n",
834 core_addr_to_string_nz (gdbarch
->deprecated_function_start_offset
));
835 fprintf_unfiltered (file
,
836 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
837 gdbarch_displaced_step_copy_insn_p (gdbarch
));
838 fprintf_unfiltered (file
,
839 "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
840 host_address_to_string (gdbarch
->displaced_step_copy_insn
));
841 fprintf_unfiltered (file
,
842 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
843 gdbarch_displaced_step_fixup_p (gdbarch
));
844 fprintf_unfiltered (file
,
845 "gdbarch_dump: displaced_step_fixup = <%s>\n",
846 host_address_to_string (gdbarch
->displaced_step_fixup
));
847 fprintf_unfiltered (file
,
848 "gdbarch_dump: displaced_step_free_closure = <%s>\n",
849 host_address_to_string (gdbarch
->displaced_step_free_closure
));
850 fprintf_unfiltered (file
,
851 "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
852 host_address_to_string (gdbarch
->displaced_step_hw_singlestep
));
853 fprintf_unfiltered (file
,
854 "gdbarch_dump: displaced_step_location = <%s>\n",
855 host_address_to_string (gdbarch
->displaced_step_location
));
856 fprintf_unfiltered (file
,
857 "gdbarch_dump: double_bit = %s\n",
858 plongest (gdbarch
->double_bit
));
859 fprintf_unfiltered (file
,
860 "gdbarch_dump: double_format = %s\n",
861 pformat (gdbarch
->double_format
));
862 fprintf_unfiltered (file
,
863 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
864 gdbarch_dummy_id_p (gdbarch
));
865 fprintf_unfiltered (file
,
866 "gdbarch_dump: dummy_id = <%s>\n",
867 host_address_to_string (gdbarch
->dummy_id
));
868 fprintf_unfiltered (file
,
869 "gdbarch_dump: dwarf2_addr_size = %s\n",
870 plongest (gdbarch
->dwarf2_addr_size
));
871 fprintf_unfiltered (file
,
872 "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
873 host_address_to_string (gdbarch
->dwarf2_reg_to_regnum
));
874 fprintf_unfiltered (file
,
875 "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
876 host_address_to_string (gdbarch
->ecoff_reg_to_regnum
));
877 fprintf_unfiltered (file
,
878 "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
879 host_address_to_string (gdbarch
->elf_make_msymbol_special
));
880 fprintf_unfiltered (file
,
881 "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
882 host_address_to_string (gdbarch
->fast_tracepoint_valid_at
));
883 fprintf_unfiltered (file
,
884 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
885 gdbarch_fetch_pointer_argument_p (gdbarch
));
886 fprintf_unfiltered (file
,
887 "gdbarch_dump: fetch_pointer_argument = <%s>\n",
888 host_address_to_string (gdbarch
->fetch_pointer_argument
));
889 fprintf_unfiltered (file
,
890 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
891 gdbarch_fetch_tls_load_module_address_p (gdbarch
));
892 fprintf_unfiltered (file
,
893 "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
894 host_address_to_string (gdbarch
->fetch_tls_load_module_address
));
895 fprintf_unfiltered (file
,
896 "gdbarch_dump: float_bit = %s\n",
897 plongest (gdbarch
->float_bit
));
898 fprintf_unfiltered (file
,
899 "gdbarch_dump: float_format = %s\n",
900 pformat (gdbarch
->float_format
));
901 fprintf_unfiltered (file
,
902 "gdbarch_dump: fp0_regnum = %s\n",
903 plongest (gdbarch
->fp0_regnum
));
904 fprintf_unfiltered (file
,
905 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
906 gdbarch_frame_align_p (gdbarch
));
907 fprintf_unfiltered (file
,
908 "gdbarch_dump: frame_align = <%s>\n",
909 host_address_to_string (gdbarch
->frame_align
));
910 fprintf_unfiltered (file
,
911 "gdbarch_dump: frame_args_skip = %s\n",
912 core_addr_to_string_nz (gdbarch
->frame_args_skip
));
913 fprintf_unfiltered (file
,
914 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
915 gdbarch_frame_num_args_p (gdbarch
));
916 fprintf_unfiltered (file
,
917 "gdbarch_dump: frame_num_args = <%s>\n",
918 host_address_to_string (gdbarch
->frame_num_args
));
919 fprintf_unfiltered (file
,
920 "gdbarch_dump: frame_red_zone_size = %s\n",
921 plongest (gdbarch
->frame_red_zone_size
));
922 fprintf_unfiltered (file
,
923 "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
924 gdbarch_gcore_bfd_target_p (gdbarch
));
925 fprintf_unfiltered (file
,
926 "gdbarch_dump: gcore_bfd_target = %s\n",
927 gdbarch
->gcore_bfd_target
);
928 fprintf_unfiltered (file
,
929 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
930 gdbarch_get_longjmp_target_p (gdbarch
));
931 fprintf_unfiltered (file
,
932 "gdbarch_dump: get_longjmp_target = <%s>\n",
933 host_address_to_string (gdbarch
->get_longjmp_target
));
934 fprintf_unfiltered (file
,
935 "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
936 gdbarch_get_siginfo_type_p (gdbarch
));
937 fprintf_unfiltered (file
,
938 "gdbarch_dump: get_siginfo_type = <%s>\n",
939 host_address_to_string (gdbarch
->get_siginfo_type
));
940 fprintf_unfiltered (file
,
941 "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
942 gdbarch_get_syscall_number_p (gdbarch
));
943 fprintf_unfiltered (file
,
944 "gdbarch_dump: get_syscall_number = <%s>\n",
945 host_address_to_string (gdbarch
->get_syscall_number
));
946 fprintf_unfiltered (file
,
947 "gdbarch_dump: half_bit = %s\n",
948 plongest (gdbarch
->half_bit
));
949 fprintf_unfiltered (file
,
950 "gdbarch_dump: half_format = %s\n",
951 pformat (gdbarch
->half_format
));
952 fprintf_unfiltered (file
,
953 "gdbarch_dump: has_dos_based_file_system = %s\n",
954 plongest (gdbarch
->has_dos_based_file_system
));
955 fprintf_unfiltered (file
,
956 "gdbarch_dump: has_global_breakpoints = %s\n",
957 plongest (gdbarch
->has_global_breakpoints
));
958 fprintf_unfiltered (file
,
959 "gdbarch_dump: has_global_solist = %s\n",
960 plongest (gdbarch
->has_global_solist
));
961 fprintf_unfiltered (file
,
962 "gdbarch_dump: has_shared_address_space = <%s>\n",
963 host_address_to_string (gdbarch
->has_shared_address_space
));
964 fprintf_unfiltered (file
,
965 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
966 plongest (gdbarch
->have_nonsteppable_watchpoint
));
967 fprintf_unfiltered (file
,
968 "gdbarch_dump: in_function_epilogue_p = <%s>\n",
969 host_address_to_string (gdbarch
->in_function_epilogue_p
));
970 fprintf_unfiltered (file
,
971 "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
972 host_address_to_string (gdbarch
->in_solib_return_trampoline
));
973 fprintf_unfiltered (file
,
974 "gdbarch_dump: inner_than = <%s>\n",
975 host_address_to_string (gdbarch
->inner_than
));
976 fprintf_unfiltered (file
,
977 "gdbarch_dump: int_bit = %s\n",
978 plongest (gdbarch
->int_bit
));
979 fprintf_unfiltered (file
,
980 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
981 gdbarch_integer_to_address_p (gdbarch
));
982 fprintf_unfiltered (file
,
983 "gdbarch_dump: integer_to_address = <%s>\n",
984 host_address_to_string (gdbarch
->integer_to_address
));
985 fprintf_unfiltered (file
,
986 "gdbarch_dump: long_bit = %s\n",
987 plongest (gdbarch
->long_bit
));
988 fprintf_unfiltered (file
,
989 "gdbarch_dump: long_double_bit = %s\n",
990 plongest (gdbarch
->long_double_bit
));
991 fprintf_unfiltered (file
,
992 "gdbarch_dump: long_double_format = %s\n",
993 pformat (gdbarch
->long_double_format
));
994 fprintf_unfiltered (file
,
995 "gdbarch_dump: long_long_bit = %s\n",
996 plongest (gdbarch
->long_long_bit
));
997 fprintf_unfiltered (file
,
998 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
999 gdbarch_max_insn_length_p (gdbarch
));
1000 fprintf_unfiltered (file
,
1001 "gdbarch_dump: max_insn_length = %s\n",
1002 plongest (gdbarch
->max_insn_length
));
1003 fprintf_unfiltered (file
,
1004 "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
1005 host_address_to_string (gdbarch
->memory_insert_breakpoint
));
1006 fprintf_unfiltered (file
,
1007 "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
1008 host_address_to_string (gdbarch
->memory_remove_breakpoint
));
1009 fprintf_unfiltered (file
,
1010 "gdbarch_dump: num_pseudo_regs = %s\n",
1011 plongest (gdbarch
->num_pseudo_regs
));
1012 fprintf_unfiltered (file
,
1013 "gdbarch_dump: num_regs = %s\n",
1014 plongest (gdbarch
->num_regs
));
1015 fprintf_unfiltered (file
,
1016 "gdbarch_dump: osabi = %s\n",
1017 plongest (gdbarch
->osabi
));
1018 fprintf_unfiltered (file
,
1019 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
1020 gdbarch_overlay_update_p (gdbarch
));
1021 fprintf_unfiltered (file
,
1022 "gdbarch_dump: overlay_update = <%s>\n",
1023 host_address_to_string (gdbarch
->overlay_update
));
1024 fprintf_unfiltered (file
,
1025 "gdbarch_dump: pc_regnum = %s\n",
1026 plongest (gdbarch
->pc_regnum
));
1027 fprintf_unfiltered (file
,
1028 "gdbarch_dump: pointer_to_address = <%s>\n",
1029 host_address_to_string (gdbarch
->pointer_to_address
));
1030 fprintf_unfiltered (file
,
1031 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1032 gdbarch_print_float_info_p (gdbarch
));
1033 fprintf_unfiltered (file
,
1034 "gdbarch_dump: print_float_info = <%s>\n",
1035 host_address_to_string (gdbarch
->print_float_info
));
1036 fprintf_unfiltered (file
,
1037 "gdbarch_dump: print_insn = <%s>\n",
1038 host_address_to_string (gdbarch
->print_insn
));
1039 fprintf_unfiltered (file
,
1040 "gdbarch_dump: print_registers_info = <%s>\n",
1041 host_address_to_string (gdbarch
->print_registers_info
));
1042 fprintf_unfiltered (file
,
1043 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1044 gdbarch_print_vector_info_p (gdbarch
));
1045 fprintf_unfiltered (file
,
1046 "gdbarch_dump: print_vector_info = <%s>\n",
1047 host_address_to_string (gdbarch
->print_vector_info
));
1048 fprintf_unfiltered (file
,
1049 "gdbarch_dump: gdbarch_process_record_p() = %d\n",
1050 gdbarch_process_record_p (gdbarch
));
1051 fprintf_unfiltered (file
,
1052 "gdbarch_dump: process_record = <%s>\n",
1053 host_address_to_string (gdbarch
->process_record
));
1054 fprintf_unfiltered (file
,
1055 "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
1056 gdbarch_process_record_signal_p (gdbarch
));
1057 fprintf_unfiltered (file
,
1058 "gdbarch_dump: process_record_signal = <%s>\n",
1059 host_address_to_string (gdbarch
->process_record_signal
));
1060 fprintf_unfiltered (file
,
1061 "gdbarch_dump: ps_regnum = %s\n",
1062 plongest (gdbarch
->ps_regnum
));
1063 fprintf_unfiltered (file
,
1064 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1065 gdbarch_pseudo_register_read_p (gdbarch
));
1066 fprintf_unfiltered (file
,
1067 "gdbarch_dump: pseudo_register_read = <%s>\n",
1068 host_address_to_string (gdbarch
->pseudo_register_read
));
1069 fprintf_unfiltered (file
,
1070 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1071 gdbarch_pseudo_register_write_p (gdbarch
));
1072 fprintf_unfiltered (file
,
1073 "gdbarch_dump: pseudo_register_write = <%s>\n",
1074 host_address_to_string (gdbarch
->pseudo_register_write
));
1075 fprintf_unfiltered (file
,
1076 "gdbarch_dump: ptr_bit = %s\n",
1077 plongest (gdbarch
->ptr_bit
));
1078 fprintf_unfiltered (file
,
1079 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1080 gdbarch_push_dummy_call_p (gdbarch
));
1081 fprintf_unfiltered (file
,
1082 "gdbarch_dump: push_dummy_call = <%s>\n",
1083 host_address_to_string (gdbarch
->push_dummy_call
));
1084 fprintf_unfiltered (file
,
1085 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1086 gdbarch_push_dummy_code_p (gdbarch
));
1087 fprintf_unfiltered (file
,
1088 "gdbarch_dump: push_dummy_code = <%s>\n",
1089 host_address_to_string (gdbarch
->push_dummy_code
));
1090 fprintf_unfiltered (file
,
1091 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1092 gdbarch_read_pc_p (gdbarch
));
1093 fprintf_unfiltered (file
,
1094 "gdbarch_dump: read_pc = <%s>\n",
1095 host_address_to_string (gdbarch
->read_pc
));
1096 fprintf_unfiltered (file
,
1097 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
1098 gdbarch_record_special_symbol_p (gdbarch
));
1099 fprintf_unfiltered (file
,
1100 "gdbarch_dump: record_special_symbol = <%s>\n",
1101 host_address_to_string (gdbarch
->record_special_symbol
));
1102 fprintf_unfiltered (file
,
1103 "gdbarch_dump: register_name = <%s>\n",
1104 host_address_to_string (gdbarch
->register_name
));
1105 fprintf_unfiltered (file
,
1106 "gdbarch_dump: register_reggroup_p = <%s>\n",
1107 host_address_to_string (gdbarch
->register_reggroup_p
));
1108 fprintf_unfiltered (file
,
1109 "gdbarch_dump: register_sim_regno = <%s>\n",
1110 host_address_to_string (gdbarch
->register_sim_regno
));
1111 fprintf_unfiltered (file
,
1112 "gdbarch_dump: register_to_value = <%s>\n",
1113 host_address_to_string (gdbarch
->register_to_value
));
1114 fprintf_unfiltered (file
,
1115 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1116 gdbarch_register_type_p (gdbarch
));
1117 fprintf_unfiltered (file
,
1118 "gdbarch_dump: register_type = <%s>\n",
1119 host_address_to_string (gdbarch
->register_type
));
1120 fprintf_unfiltered (file
,
1121 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1122 gdbarch_regset_from_core_section_p (gdbarch
));
1123 fprintf_unfiltered (file
,
1124 "gdbarch_dump: regset_from_core_section = <%s>\n",
1125 host_address_to_string (gdbarch
->regset_from_core_section
));
1126 fprintf_unfiltered (file
,
1127 "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n",
1128 gdbarch_relocate_instruction_p (gdbarch
));
1129 fprintf_unfiltered (file
,
1130 "gdbarch_dump: relocate_instruction = <%s>\n",
1131 host_address_to_string (gdbarch
->relocate_instruction
));
1132 fprintf_unfiltered (file
,
1133 "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
1134 host_address_to_string (gdbarch
->remote_breakpoint_from_pc
));
1135 fprintf_unfiltered (file
,
1136 "gdbarch_dump: remote_register_number = <%s>\n",
1137 host_address_to_string (gdbarch
->remote_register_number
));
1138 fprintf_unfiltered (file
,
1139 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1140 gdbarch_return_value_p (gdbarch
));
1141 fprintf_unfiltered (file
,
1142 "gdbarch_dump: return_value = <%s>\n",
1143 host_address_to_string (gdbarch
->return_value
));
1144 fprintf_unfiltered (file
,
1145 "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
1146 host_address_to_string (gdbarch
->sdb_reg_to_regnum
));
1147 fprintf_unfiltered (file
,
1148 "gdbarch_dump: short_bit = %s\n",
1149 plongest (gdbarch
->short_bit
));
1150 fprintf_unfiltered (file
,
1151 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1152 gdbarch_single_step_through_delay_p (gdbarch
));
1153 fprintf_unfiltered (file
,
1154 "gdbarch_dump: single_step_through_delay = <%s>\n",
1155 host_address_to_string (gdbarch
->single_step_through_delay
));
1156 fprintf_unfiltered (file
,
1157 "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
1158 gdbarch_skip_main_prologue_p (gdbarch
));
1159 fprintf_unfiltered (file
,
1160 "gdbarch_dump: skip_main_prologue = <%s>\n",
1161 host_address_to_string (gdbarch
->skip_main_prologue
));
1162 fprintf_unfiltered (file
,
1163 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1164 gdbarch_skip_permanent_breakpoint_p (gdbarch
));
1165 fprintf_unfiltered (file
,
1166 "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
1167 host_address_to_string (gdbarch
->skip_permanent_breakpoint
));
1168 fprintf_unfiltered (file
,
1169 "gdbarch_dump: skip_prologue = <%s>\n",
1170 host_address_to_string (gdbarch
->skip_prologue
));
1171 fprintf_unfiltered (file
,
1172 "gdbarch_dump: skip_solib_resolver = <%s>\n",
1173 host_address_to_string (gdbarch
->skip_solib_resolver
));
1174 fprintf_unfiltered (file
,
1175 "gdbarch_dump: skip_trampoline_code = <%s>\n",
1176 host_address_to_string (gdbarch
->skip_trampoline_code
));
1177 fprintf_unfiltered (file
,
1178 "gdbarch_dump: smash_text_address = <%s>\n",
1179 host_address_to_string (gdbarch
->smash_text_address
));
1180 fprintf_unfiltered (file
,
1181 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1182 gdbarch_software_single_step_p (gdbarch
));
1183 fprintf_unfiltered (file
,
1184 "gdbarch_dump: software_single_step = <%s>\n",
1185 host_address_to_string (gdbarch
->software_single_step
));
1186 fprintf_unfiltered (file
,
1187 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1188 plongest (gdbarch
->sofun_address_maybe_missing
));
1189 fprintf_unfiltered (file
,
1190 "gdbarch_dump: solib_symbols_extension = %s\n",
1191 pstring (gdbarch
->solib_symbols_extension
));
1192 fprintf_unfiltered (file
,
1193 "gdbarch_dump: sp_regnum = %s\n",
1194 plongest (gdbarch
->sp_regnum
));
1195 fprintf_unfiltered (file
,
1196 "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
1197 host_address_to_string (gdbarch
->stab_reg_to_regnum
));
1198 fprintf_unfiltered (file
,
1199 "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
1200 host_address_to_string (gdbarch
->stabs_argument_has_addr
));
1201 fprintf_unfiltered (file
,
1202 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1203 gdbarch_static_transform_name_p (gdbarch
));
1204 fprintf_unfiltered (file
,
1205 "gdbarch_dump: static_transform_name = <%s>\n",
1206 host_address_to_string (gdbarch
->static_transform_name
));
1207 fprintf_unfiltered (file
,
1208 "gdbarch_dump: target_desc = %s\n",
1209 host_address_to_string (gdbarch
->target_desc
));
1210 fprintf_unfiltered (file
,
1211 "gdbarch_dump: target_signal_from_host = <%s>\n",
1212 host_address_to_string (gdbarch
->target_signal_from_host
));
1213 fprintf_unfiltered (file
,
1214 "gdbarch_dump: target_signal_to_host = <%s>\n",
1215 host_address_to_string (gdbarch
->target_signal_to_host
));
1216 fprintf_unfiltered (file
,
1217 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1218 gdbarch_unwind_pc_p (gdbarch
));
1219 fprintf_unfiltered (file
,
1220 "gdbarch_dump: unwind_pc = <%s>\n",
1221 host_address_to_string (gdbarch
->unwind_pc
));
1222 fprintf_unfiltered (file
,
1223 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1224 gdbarch_unwind_sp_p (gdbarch
));
1225 fprintf_unfiltered (file
,
1226 "gdbarch_dump: unwind_sp = <%s>\n",
1227 host_address_to_string (gdbarch
->unwind_sp
));
1228 fprintf_unfiltered (file
,
1229 "gdbarch_dump: value_from_register = <%s>\n",
1230 host_address_to_string (gdbarch
->value_from_register
));
1231 fprintf_unfiltered (file
,
1232 "gdbarch_dump: value_to_register = <%s>\n",
1233 host_address_to_string (gdbarch
->value_to_register
));
1234 fprintf_unfiltered (file
,
1235 "gdbarch_dump: vbit_in_delta = %s\n",
1236 plongest (gdbarch
->vbit_in_delta
));
1237 fprintf_unfiltered (file
,
1238 "gdbarch_dump: virtual_frame_pointer = <%s>\n",
1239 host_address_to_string (gdbarch
->virtual_frame_pointer
));
1240 fprintf_unfiltered (file
,
1241 "gdbarch_dump: vtable_function_descriptors = %s\n",
1242 plongest (gdbarch
->vtable_function_descriptors
));
1243 fprintf_unfiltered (file
,
1244 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1245 gdbarch_write_pc_p (gdbarch
));
1246 fprintf_unfiltered (file
,
1247 "gdbarch_dump: write_pc = <%s>\n",
1248 host_address_to_string (gdbarch
->write_pc
));
1249 if (gdbarch
->dump_tdep
!= NULL
)
1250 gdbarch
->dump_tdep (gdbarch
, file
);
1253 struct gdbarch_tdep
*
1254 gdbarch_tdep (struct gdbarch
*gdbarch
)
1256 if (gdbarch_debug
>= 2)
1257 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1258 return gdbarch
->tdep
;
1262 const struct bfd_arch_info
*
1263 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1265 gdb_assert (gdbarch
!= NULL
);
1266 if (gdbarch_debug
>= 2)
1267 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1268 return gdbarch
->bfd_arch_info
;
1272 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1274 gdb_assert (gdbarch
!= NULL
);
1275 if (gdbarch_debug
>= 2)
1276 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1277 return gdbarch
->byte_order
;
1281 gdbarch_byte_order_for_code (struct gdbarch
*gdbarch
)
1283 gdb_assert (gdbarch
!= NULL
);
1284 if (gdbarch_debug
>= 2)
1285 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order_for_code called\n");
1286 return gdbarch
->byte_order_for_code
;
1290 gdbarch_osabi (struct gdbarch
*gdbarch
)
1292 gdb_assert (gdbarch
!= NULL
);
1293 if (gdbarch_debug
>= 2)
1294 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1295 return gdbarch
->osabi
;
1298 const struct target_desc
*
1299 gdbarch_target_desc (struct gdbarch
*gdbarch
)
1301 gdb_assert (gdbarch
!= NULL
);
1302 if (gdbarch_debug
>= 2)
1303 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_desc called\n");
1304 return gdbarch
->target_desc
;
1308 gdbarch_bits_big_endian (struct gdbarch
*gdbarch
)
1310 gdb_assert (gdbarch
!= NULL
);
1311 /* Skip verify of bits_big_endian, invalid_p == 0 */
1312 if (gdbarch_debug
>= 2)
1313 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bits_big_endian called\n");
1314 return gdbarch
->bits_big_endian
;
1318 set_gdbarch_bits_big_endian (struct gdbarch
*gdbarch
,
1319 int bits_big_endian
)
1321 gdbarch
->bits_big_endian
= bits_big_endian
;
1325 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1327 gdb_assert (gdbarch
!= NULL
);
1328 /* Skip verify of short_bit, invalid_p == 0 */
1329 if (gdbarch_debug
>= 2)
1330 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1331 return gdbarch
->short_bit
;
1335 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1338 gdbarch
->short_bit
= short_bit
;
1342 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1344 gdb_assert (gdbarch
!= NULL
);
1345 /* Skip verify of int_bit, invalid_p == 0 */
1346 if (gdbarch_debug
>= 2)
1347 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1348 return gdbarch
->int_bit
;
1352 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1355 gdbarch
->int_bit
= int_bit
;
1359 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1361 gdb_assert (gdbarch
!= NULL
);
1362 /* Skip verify of long_bit, invalid_p == 0 */
1363 if (gdbarch_debug
>= 2)
1364 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1365 return gdbarch
->long_bit
;
1369 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1372 gdbarch
->long_bit
= long_bit
;
1376 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1378 gdb_assert (gdbarch
!= NULL
);
1379 /* Skip verify of long_long_bit, invalid_p == 0 */
1380 if (gdbarch_debug
>= 2)
1381 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1382 return gdbarch
->long_long_bit
;
1386 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1389 gdbarch
->long_long_bit
= long_long_bit
;
1393 gdbarch_half_bit (struct gdbarch
*gdbarch
)
1395 gdb_assert (gdbarch
!= NULL
);
1396 /* Skip verify of half_bit, invalid_p == 0 */
1397 if (gdbarch_debug
>= 2)
1398 fprintf_unfiltered (gdb_stdlog
, "gdbarch_half_bit called\n");
1399 return gdbarch
->half_bit
;
1403 set_gdbarch_half_bit (struct gdbarch
*gdbarch
,
1406 gdbarch
->half_bit
= half_bit
;
1409 const struct floatformat
**
1410 gdbarch_half_format (struct gdbarch
*gdbarch
)
1412 gdb_assert (gdbarch
!= NULL
);
1413 if (gdbarch_debug
>= 2)
1414 fprintf_unfiltered (gdb_stdlog
, "gdbarch_half_format called\n");
1415 return gdbarch
->half_format
;
1419 set_gdbarch_half_format (struct gdbarch
*gdbarch
,
1420 const struct floatformat
** half_format
)
1422 gdbarch
->half_format
= half_format
;
1426 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1428 gdb_assert (gdbarch
!= NULL
);
1429 /* Skip verify of float_bit, invalid_p == 0 */
1430 if (gdbarch_debug
>= 2)
1431 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1432 return gdbarch
->float_bit
;
1436 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1439 gdbarch
->float_bit
= float_bit
;
1442 const struct floatformat
**
1443 gdbarch_float_format (struct gdbarch
*gdbarch
)
1445 gdb_assert (gdbarch
!= NULL
);
1446 if (gdbarch_debug
>= 2)
1447 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
1448 return gdbarch
->float_format
;
1452 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
1453 const struct floatformat
** float_format
)
1455 gdbarch
->float_format
= float_format
;
1459 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1461 gdb_assert (gdbarch
!= NULL
);
1462 /* Skip verify of double_bit, invalid_p == 0 */
1463 if (gdbarch_debug
>= 2)
1464 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1465 return gdbarch
->double_bit
;
1469 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1472 gdbarch
->double_bit
= double_bit
;
1475 const struct floatformat
**
1476 gdbarch_double_format (struct gdbarch
*gdbarch
)
1478 gdb_assert (gdbarch
!= NULL
);
1479 if (gdbarch_debug
>= 2)
1480 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
1481 return gdbarch
->double_format
;
1485 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
1486 const struct floatformat
** double_format
)
1488 gdbarch
->double_format
= double_format
;
1492 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1494 gdb_assert (gdbarch
!= NULL
);
1495 /* Skip verify of long_double_bit, invalid_p == 0 */
1496 if (gdbarch_debug
>= 2)
1497 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1498 return gdbarch
->long_double_bit
;
1502 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1503 int long_double_bit
)
1505 gdbarch
->long_double_bit
= long_double_bit
;
1508 const struct floatformat
**
1509 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
1511 gdb_assert (gdbarch
!= NULL
);
1512 if (gdbarch_debug
>= 2)
1513 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
1514 return gdbarch
->long_double_format
;
1518 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
1519 const struct floatformat
** long_double_format
)
1521 gdbarch
->long_double_format
= long_double_format
;
1525 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1527 gdb_assert (gdbarch
!= NULL
);
1528 /* Skip verify of ptr_bit, invalid_p == 0 */
1529 if (gdbarch_debug
>= 2)
1530 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1531 return gdbarch
->ptr_bit
;
1535 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1538 gdbarch
->ptr_bit
= ptr_bit
;
1542 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1544 gdb_assert (gdbarch
!= NULL
);
1545 /* Check variable changed from pre-default. */
1546 gdb_assert (gdbarch
->addr_bit
!= 0);
1547 if (gdbarch_debug
>= 2)
1548 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1549 return gdbarch
->addr_bit
;
1553 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1556 gdbarch
->addr_bit
= addr_bit
;
1560 gdbarch_dwarf2_addr_size (struct gdbarch
*gdbarch
)
1562 gdb_assert (gdbarch
!= NULL
);
1563 /* Check variable changed from pre-default. */
1564 gdb_assert (gdbarch
->dwarf2_addr_size
!= 0);
1565 if (gdbarch_debug
>= 2)
1566 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_addr_size called\n");
1567 return gdbarch
->dwarf2_addr_size
;
1571 set_gdbarch_dwarf2_addr_size (struct gdbarch
*gdbarch
,
1572 int dwarf2_addr_size
)
1574 gdbarch
->dwarf2_addr_size
= dwarf2_addr_size
;
1578 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1580 gdb_assert (gdbarch
!= NULL
);
1581 /* Check variable changed from pre-default. */
1582 gdb_assert (gdbarch
->char_signed
!= -1);
1583 if (gdbarch_debug
>= 2)
1584 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1585 return gdbarch
->char_signed
;
1589 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1592 gdbarch
->char_signed
= char_signed
;
1596 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1598 gdb_assert (gdbarch
!= NULL
);
1599 return gdbarch
->read_pc
!= NULL
;
1603 gdbarch_read_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
1605 gdb_assert (gdbarch
!= NULL
);
1606 gdb_assert (gdbarch
->read_pc
!= NULL
);
1607 if (gdbarch_debug
>= 2)
1608 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1609 return gdbarch
->read_pc (regcache
);
1613 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1614 gdbarch_read_pc_ftype read_pc
)
1616 gdbarch
->read_pc
= read_pc
;
1620 gdbarch_write_pc_p (struct gdbarch
*gdbarch
)
1622 gdb_assert (gdbarch
!= NULL
);
1623 return gdbarch
->write_pc
!= NULL
;
1627 gdbarch_write_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR val
)
1629 gdb_assert (gdbarch
!= NULL
);
1630 gdb_assert (gdbarch
->write_pc
!= NULL
);
1631 if (gdbarch_debug
>= 2)
1632 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1633 gdbarch
->write_pc (regcache
, val
);
1637 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1638 gdbarch_write_pc_ftype write_pc
)
1640 gdbarch
->write_pc
= write_pc
;
1644 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1646 gdb_assert (gdbarch
!= NULL
);
1647 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1648 if (gdbarch_debug
>= 2)
1649 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1650 gdbarch
->virtual_frame_pointer (gdbarch
, pc
, frame_regnum
, frame_offset
);
1654 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1655 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1657 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1661 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1663 gdb_assert (gdbarch
!= NULL
);
1664 return gdbarch
->pseudo_register_read
!= NULL
;
1668 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, gdb_byte
*buf
)
1670 gdb_assert (gdbarch
!= NULL
);
1671 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
1672 if (gdbarch_debug
>= 2)
1673 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
1674 gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
1678 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
1679 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
1681 gdbarch
->pseudo_register_read
= pseudo_register_read
;
1685 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
1687 gdb_assert (gdbarch
!= NULL
);
1688 return gdbarch
->pseudo_register_write
!= NULL
;
1692 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const gdb_byte
*buf
)
1694 gdb_assert (gdbarch
!= NULL
);
1695 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
1696 if (gdbarch_debug
>= 2)
1697 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
1698 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
1702 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
1703 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
1705 gdbarch
->pseudo_register_write
= pseudo_register_write
;
1709 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1711 gdb_assert (gdbarch
!= NULL
);
1712 /* Check variable changed from pre-default. */
1713 gdb_assert (gdbarch
->num_regs
!= -1);
1714 if (gdbarch_debug
>= 2)
1715 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1716 return gdbarch
->num_regs
;
1720 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1723 gdbarch
->num_regs
= num_regs
;
1727 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
1729 gdb_assert (gdbarch
!= NULL
);
1730 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1731 if (gdbarch_debug
>= 2)
1732 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
1733 return gdbarch
->num_pseudo_regs
;
1737 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
1738 int num_pseudo_regs
)
1740 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
1744 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1746 gdb_assert (gdbarch
!= NULL
);
1747 /* Skip verify of sp_regnum, invalid_p == 0 */
1748 if (gdbarch_debug
>= 2)
1749 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1750 return gdbarch
->sp_regnum
;
1754 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1757 gdbarch
->sp_regnum
= sp_regnum
;
1761 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1763 gdb_assert (gdbarch
!= NULL
);
1764 /* Skip verify of pc_regnum, invalid_p == 0 */
1765 if (gdbarch_debug
>= 2)
1766 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1767 return gdbarch
->pc_regnum
;
1771 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1774 gdbarch
->pc_regnum
= pc_regnum
;
1778 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
1780 gdb_assert (gdbarch
!= NULL
);
1781 /* Skip verify of ps_regnum, invalid_p == 0 */
1782 if (gdbarch_debug
>= 2)
1783 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
1784 return gdbarch
->ps_regnum
;
1788 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
1791 gdbarch
->ps_regnum
= ps_regnum
;
1795 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
1797 gdb_assert (gdbarch
!= NULL
);
1798 /* Skip verify of fp0_regnum, invalid_p == 0 */
1799 if (gdbarch_debug
>= 2)
1800 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
1801 return gdbarch
->fp0_regnum
;
1805 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
1808 gdbarch
->fp0_regnum
= fp0_regnum
;
1812 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
1814 gdb_assert (gdbarch
!= NULL
);
1815 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
1816 if (gdbarch_debug
>= 2)
1817 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
1818 return gdbarch
->stab_reg_to_regnum (gdbarch
, stab_regnr
);
1822 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
1823 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
1825 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
1829 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
1831 gdb_assert (gdbarch
!= NULL
);
1832 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
1833 if (gdbarch_debug
>= 2)
1834 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
1835 return gdbarch
->ecoff_reg_to_regnum (gdbarch
, ecoff_regnr
);
1839 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
1840 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
1842 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
1846 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
1848 gdb_assert (gdbarch
!= NULL
);
1849 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
1850 if (gdbarch_debug
>= 2)
1851 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
1852 return gdbarch
->sdb_reg_to_regnum (gdbarch
, sdb_regnr
);
1856 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
1857 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
1859 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
1863 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
1865 gdb_assert (gdbarch
!= NULL
);
1866 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
1867 if (gdbarch_debug
>= 2)
1868 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
1869 return gdbarch
->dwarf2_reg_to_regnum (gdbarch
, dwarf2_regnr
);
1873 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
1874 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
1876 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
1880 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1882 gdb_assert (gdbarch
!= NULL
);
1883 gdb_assert (gdbarch
->register_name
!= NULL
);
1884 if (gdbarch_debug
>= 2)
1885 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1886 return gdbarch
->register_name (gdbarch
, regnr
);
1890 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1891 gdbarch_register_name_ftype register_name
)
1893 gdbarch
->register_name
= register_name
;
1897 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
1899 gdb_assert (gdbarch
!= NULL
);
1900 return gdbarch
->register_type
!= NULL
;
1904 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
1906 gdb_assert (gdbarch
!= NULL
);
1907 gdb_assert (gdbarch
->register_type
!= NULL
);
1908 if (gdbarch_debug
>= 2)
1909 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
1910 return gdbarch
->register_type (gdbarch
, reg_nr
);
1914 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
1915 gdbarch_register_type_ftype register_type
)
1917 gdbarch
->register_type
= register_type
;
1921 gdbarch_dummy_id_p (struct gdbarch
*gdbarch
)
1923 gdb_assert (gdbarch
!= NULL
);
1924 return gdbarch
->dummy_id
!= NULL
;
1928 gdbarch_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*this_frame
)
1930 gdb_assert (gdbarch
!= NULL
);
1931 gdb_assert (gdbarch
->dummy_id
!= NULL
);
1932 if (gdbarch_debug
>= 2)
1933 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dummy_id called\n");
1934 return gdbarch
->dummy_id (gdbarch
, this_frame
);
1938 set_gdbarch_dummy_id (struct gdbarch
*gdbarch
,
1939 gdbarch_dummy_id_ftype dummy_id
)
1941 gdbarch
->dummy_id
= dummy_id
;
1945 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
1947 gdb_assert (gdbarch
!= NULL
);
1948 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1949 if (gdbarch_debug
>= 2)
1950 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
1951 return gdbarch
->deprecated_fp_regnum
;
1955 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
1956 int deprecated_fp_regnum
)
1958 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
1962 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
1964 gdb_assert (gdbarch
!= NULL
);
1965 return gdbarch
->push_dummy_call
!= NULL
;
1969 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
)
1971 gdb_assert (gdbarch
!= NULL
);
1972 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
1973 if (gdbarch_debug
>= 2)
1974 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
1975 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
1979 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
1980 gdbarch_push_dummy_call_ftype push_dummy_call
)
1982 gdbarch
->push_dummy_call
= push_dummy_call
;
1986 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1988 gdb_assert (gdbarch
!= NULL
);
1989 /* Skip verify of call_dummy_location, invalid_p == 0 */
1990 if (gdbarch_debug
>= 2)
1991 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1992 return gdbarch
->call_dummy_location
;
1996 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1997 int call_dummy_location
)
1999 gdbarch
->call_dummy_location
= call_dummy_location
;
2003 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
2005 gdb_assert (gdbarch
!= NULL
);
2006 return gdbarch
->push_dummy_code
!= NULL
;
2010 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
)
2012 gdb_assert (gdbarch
!= NULL
);
2013 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
2014 if (gdbarch_debug
>= 2)
2015 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
2016 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, args
, nargs
, value_type
, real_pc
, bp_addr
, regcache
);
2020 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
2021 gdbarch_push_dummy_code_ftype push_dummy_code
)
2023 gdbarch
->push_dummy_code
= push_dummy_code
;
2027 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
2029 gdb_assert (gdbarch
!= NULL
);
2030 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
2031 if (gdbarch_debug
>= 2)
2032 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
2033 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
2037 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
2038 gdbarch_print_registers_info_ftype print_registers_info
)
2040 gdbarch
->print_registers_info
= print_registers_info
;
2044 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
2046 gdb_assert (gdbarch
!= NULL
);
2047 return gdbarch
->print_float_info
!= NULL
;
2051 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2053 gdb_assert (gdbarch
!= NULL
);
2054 gdb_assert (gdbarch
->print_float_info
!= NULL
);
2055 if (gdbarch_debug
>= 2)
2056 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
2057 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
2061 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
2062 gdbarch_print_float_info_ftype print_float_info
)
2064 gdbarch
->print_float_info
= print_float_info
;
2068 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
2070 gdb_assert (gdbarch
!= NULL
);
2071 return gdbarch
->print_vector_info
!= NULL
;
2075 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2077 gdb_assert (gdbarch
!= NULL
);
2078 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
2079 if (gdbarch_debug
>= 2)
2080 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
2081 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
2085 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
2086 gdbarch_print_vector_info_ftype print_vector_info
)
2088 gdbarch
->print_vector_info
= print_vector_info
;
2092 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
2094 gdb_assert (gdbarch
!= NULL
);
2095 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
2096 if (gdbarch_debug
>= 2)
2097 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
2098 return gdbarch
->register_sim_regno (gdbarch
, reg_nr
);
2102 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
2103 gdbarch_register_sim_regno_ftype register_sim_regno
)
2105 gdbarch
->register_sim_regno
= register_sim_regno
;
2109 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
2111 gdb_assert (gdbarch
!= NULL
);
2112 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
2113 if (gdbarch_debug
>= 2)
2114 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
2115 return gdbarch
->cannot_fetch_register (gdbarch
, regnum
);
2119 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
2120 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
2122 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
2126 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
2128 gdb_assert (gdbarch
!= NULL
);
2129 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
2130 if (gdbarch_debug
>= 2)
2131 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
2132 return gdbarch
->cannot_store_register (gdbarch
, regnum
);
2136 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
2137 gdbarch_cannot_store_register_ftype cannot_store_register
)
2139 gdbarch
->cannot_store_register
= cannot_store_register
;
2143 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
2145 gdb_assert (gdbarch
!= NULL
);
2146 return gdbarch
->get_longjmp_target
!= NULL
;
2150 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR
*pc
)
2152 gdb_assert (gdbarch
!= NULL
);
2153 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
2154 if (gdbarch_debug
>= 2)
2155 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
2156 return gdbarch
->get_longjmp_target (frame
, pc
);
2160 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
2161 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
2163 gdbarch
->get_longjmp_target
= get_longjmp_target
;
2167 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
2169 gdb_assert (gdbarch
!= NULL
);
2170 if (gdbarch_debug
>= 2)
2171 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
2172 return gdbarch
->believe_pcc_promotion
;
2176 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
2177 int believe_pcc_promotion
)
2179 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2183 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
2185 gdb_assert (gdbarch
!= NULL
);
2186 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
2187 if (gdbarch_debug
>= 2)
2188 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
2189 return gdbarch
->convert_register_p (gdbarch
, regnum
, type
);
2193 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
2194 gdbarch_convert_register_p_ftype convert_register_p
)
2196 gdbarch
->convert_register_p
= convert_register_p
;
2200 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, gdb_byte
*buf
)
2202 gdb_assert (gdbarch
!= NULL
);
2203 gdb_assert (gdbarch
->register_to_value
!= NULL
);
2204 if (gdbarch_debug
>= 2)
2205 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2206 gdbarch
->register_to_value (frame
, regnum
, type
, buf
);
2210 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2211 gdbarch_register_to_value_ftype register_to_value
)
2213 gdbarch
->register_to_value
= register_to_value
;
2217 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const gdb_byte
*buf
)
2219 gdb_assert (gdbarch
!= NULL
);
2220 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2221 if (gdbarch_debug
>= 2)
2222 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2223 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2227 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2228 gdbarch_value_to_register_ftype value_to_register
)
2230 gdbarch
->value_to_register
= value_to_register
;
2234 gdbarch_value_from_register (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, struct frame_info
*frame
)
2236 gdb_assert (gdbarch
!= NULL
);
2237 gdb_assert (gdbarch
->value_from_register
!= NULL
);
2238 if (gdbarch_debug
>= 2)
2239 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_from_register called\n");
2240 return gdbarch
->value_from_register (type
, regnum
, frame
);
2244 set_gdbarch_value_from_register (struct gdbarch
*gdbarch
,
2245 gdbarch_value_from_register_ftype value_from_register
)
2247 gdbarch
->value_from_register
= value_from_register
;
2251 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2253 gdb_assert (gdbarch
!= NULL
);
2254 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2255 if (gdbarch_debug
>= 2)
2256 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2257 return gdbarch
->pointer_to_address (gdbarch
, type
, buf
);
2261 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2262 gdbarch_pointer_to_address_ftype pointer_to_address
)
2264 gdbarch
->pointer_to_address
= pointer_to_address
;
2268 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*buf
, CORE_ADDR addr
)
2270 gdb_assert (gdbarch
!= NULL
);
2271 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2272 if (gdbarch_debug
>= 2)
2273 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2274 gdbarch
->address_to_pointer (gdbarch
, type
, buf
, addr
);
2278 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2279 gdbarch_address_to_pointer_ftype address_to_pointer
)
2281 gdbarch
->address_to_pointer
= address_to_pointer
;
2285 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2287 gdb_assert (gdbarch
!= NULL
);
2288 return gdbarch
->integer_to_address
!= NULL
;
2292 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2294 gdb_assert (gdbarch
!= NULL
);
2295 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2296 if (gdbarch_debug
>= 2)
2297 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2298 return gdbarch
->integer_to_address (gdbarch
, type
, buf
);
2302 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2303 gdbarch_integer_to_address_ftype integer_to_address
)
2305 gdbarch
->integer_to_address
= integer_to_address
;
2309 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2311 gdb_assert (gdbarch
!= NULL
);
2312 return gdbarch
->return_value
!= NULL
;
2315 enum return_value_convention
2316 gdbarch_return_value (struct gdbarch
*gdbarch
, struct type
*functype
, struct type
*valtype
, struct regcache
*regcache
, gdb_byte
*readbuf
, const gdb_byte
*writebuf
)
2318 gdb_assert (gdbarch
!= NULL
);
2319 gdb_assert (gdbarch
->return_value
!= NULL
);
2320 if (gdbarch_debug
>= 2)
2321 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2322 return gdbarch
->return_value (gdbarch
, functype
, valtype
, regcache
, readbuf
, writebuf
);
2326 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2327 gdbarch_return_value_ftype return_value
)
2329 gdbarch
->return_value
= return_value
;
2333 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2335 gdb_assert (gdbarch
!= NULL
);
2336 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2337 if (gdbarch_debug
>= 2)
2338 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2339 return gdbarch
->skip_prologue (gdbarch
, ip
);
2343 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2344 gdbarch_skip_prologue_ftype skip_prologue
)
2346 gdbarch
->skip_prologue
= skip_prologue
;
2350 gdbarch_skip_main_prologue_p (struct gdbarch
*gdbarch
)
2352 gdb_assert (gdbarch
!= NULL
);
2353 return gdbarch
->skip_main_prologue
!= NULL
;
2357 gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2359 gdb_assert (gdbarch
!= NULL
);
2360 gdb_assert (gdbarch
->skip_main_prologue
!= NULL
);
2361 if (gdbarch_debug
>= 2)
2362 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_main_prologue called\n");
2363 return gdbarch
->skip_main_prologue (gdbarch
, ip
);
2367 set_gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
,
2368 gdbarch_skip_main_prologue_ftype skip_main_prologue
)
2370 gdbarch
->skip_main_prologue
= skip_main_prologue
;
2374 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2376 gdb_assert (gdbarch
!= NULL
);
2377 gdb_assert (gdbarch
->inner_than
!= NULL
);
2378 if (gdbarch_debug
>= 2)
2379 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2380 return gdbarch
->inner_than (lhs
, rhs
);
2384 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2385 gdbarch_inner_than_ftype inner_than
)
2387 gdbarch
->inner_than
= inner_than
;
2391 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2393 gdb_assert (gdbarch
!= NULL
);
2394 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2395 if (gdbarch_debug
>= 2)
2396 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2397 return gdbarch
->breakpoint_from_pc (gdbarch
, pcptr
, lenptr
);
2401 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2402 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2404 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2408 gdbarch_remote_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *kindptr
)
2410 gdb_assert (gdbarch
!= NULL
);
2411 gdb_assert (gdbarch
->remote_breakpoint_from_pc
!= NULL
);
2412 if (gdbarch_debug
>= 2)
2413 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_breakpoint_from_pc called\n");
2414 gdbarch
->remote_breakpoint_from_pc (gdbarch
, pcptr
, kindptr
);
2418 set_gdbarch_remote_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2419 gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc
)
2421 gdbarch
->remote_breakpoint_from_pc
= remote_breakpoint_from_pc
;
2425 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2427 gdb_assert (gdbarch
!= NULL
);
2428 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2432 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2434 gdb_assert (gdbarch
!= NULL
);
2435 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2436 if (gdbarch_debug
>= 2)
2437 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2438 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2442 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2443 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2445 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2449 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2451 gdb_assert (gdbarch
!= NULL
);
2452 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2453 if (gdbarch_debug
>= 2)
2454 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2455 return gdbarch
->memory_insert_breakpoint (gdbarch
, bp_tgt
);
2459 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2460 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2462 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2466 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2468 gdb_assert (gdbarch
!= NULL
);
2469 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2470 if (gdbarch_debug
>= 2)
2471 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2472 return gdbarch
->memory_remove_breakpoint (gdbarch
, bp_tgt
);
2476 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2477 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2479 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2483 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2485 gdb_assert (gdbarch
!= NULL
);
2486 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2487 if (gdbarch_debug
>= 2)
2488 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2489 return gdbarch
->decr_pc_after_break
;
2493 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2494 CORE_ADDR decr_pc_after_break
)
2496 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2500 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
2502 gdb_assert (gdbarch
!= NULL
);
2503 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2504 if (gdbarch_debug
>= 2)
2505 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
2506 return gdbarch
->deprecated_function_start_offset
;
2510 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
2511 CORE_ADDR deprecated_function_start_offset
)
2513 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
2517 gdbarch_remote_register_number (struct gdbarch
*gdbarch
, int regno
)
2519 gdb_assert (gdbarch
!= NULL
);
2520 gdb_assert (gdbarch
->remote_register_number
!= NULL
);
2521 if (gdbarch_debug
>= 2)
2522 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_register_number called\n");
2523 return gdbarch
->remote_register_number (gdbarch
, regno
);
2527 set_gdbarch_remote_register_number (struct gdbarch
*gdbarch
,
2528 gdbarch_remote_register_number_ftype remote_register_number
)
2530 gdbarch
->remote_register_number
= remote_register_number
;
2534 gdbarch_fetch_tls_load_module_address_p (struct gdbarch
*gdbarch
)
2536 gdb_assert (gdbarch
!= NULL
);
2537 return gdbarch
->fetch_tls_load_module_address
!= NULL
;
2541 gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
, struct objfile
*objfile
)
2543 gdb_assert (gdbarch
!= NULL
);
2544 gdb_assert (gdbarch
->fetch_tls_load_module_address
!= NULL
);
2545 if (gdbarch_debug
>= 2)
2546 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_tls_load_module_address called\n");
2547 return gdbarch
->fetch_tls_load_module_address (objfile
);
2551 set_gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
,
2552 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address
)
2554 gdbarch
->fetch_tls_load_module_address
= fetch_tls_load_module_address
;
2558 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2560 gdb_assert (gdbarch
!= NULL
);
2561 /* Skip verify of frame_args_skip, invalid_p == 0 */
2562 if (gdbarch_debug
>= 2)
2563 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2564 return gdbarch
->frame_args_skip
;
2568 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2569 CORE_ADDR frame_args_skip
)
2571 gdbarch
->frame_args_skip
= frame_args_skip
;
2575 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
2577 gdb_assert (gdbarch
!= NULL
);
2578 return gdbarch
->unwind_pc
!= NULL
;
2582 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2584 gdb_assert (gdbarch
!= NULL
);
2585 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
2586 if (gdbarch_debug
>= 2)
2587 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
2588 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
2592 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
2593 gdbarch_unwind_pc_ftype unwind_pc
)
2595 gdbarch
->unwind_pc
= unwind_pc
;
2599 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
2601 gdb_assert (gdbarch
!= NULL
);
2602 return gdbarch
->unwind_sp
!= NULL
;
2606 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2608 gdb_assert (gdbarch
!= NULL
);
2609 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
2610 if (gdbarch_debug
>= 2)
2611 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
2612 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
2616 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
2617 gdbarch_unwind_sp_ftype unwind_sp
)
2619 gdbarch
->unwind_sp
= unwind_sp
;
2623 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
2625 gdb_assert (gdbarch
!= NULL
);
2626 return gdbarch
->frame_num_args
!= NULL
;
2630 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2632 gdb_assert (gdbarch
!= NULL
);
2633 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
2634 if (gdbarch_debug
>= 2)
2635 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2636 return gdbarch
->frame_num_args (frame
);
2640 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2641 gdbarch_frame_num_args_ftype frame_num_args
)
2643 gdbarch
->frame_num_args
= frame_num_args
;
2647 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
2649 gdb_assert (gdbarch
!= NULL
);
2650 return gdbarch
->frame_align
!= NULL
;
2654 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
2656 gdb_assert (gdbarch
!= NULL
);
2657 gdb_assert (gdbarch
->frame_align
!= NULL
);
2658 if (gdbarch_debug
>= 2)
2659 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
2660 return gdbarch
->frame_align (gdbarch
, address
);
2664 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
2665 gdbarch_frame_align_ftype frame_align
)
2667 gdbarch
->frame_align
= frame_align
;
2671 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
2673 gdb_assert (gdbarch
!= NULL
);
2674 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
2675 if (gdbarch_debug
>= 2)
2676 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
2677 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
2681 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
2682 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
2684 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
2688 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
2690 gdb_assert (gdbarch
!= NULL
);
2691 if (gdbarch_debug
>= 2)
2692 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
2693 return gdbarch
->frame_red_zone_size
;
2697 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
2698 int frame_red_zone_size
)
2700 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
2704 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
2706 gdb_assert (gdbarch
!= NULL
);
2707 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
2708 if (gdbarch_debug
>= 2)
2709 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
2710 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
2714 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
2715 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
2717 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
2721 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2723 gdb_assert (gdbarch
!= NULL
);
2724 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
2725 if (gdbarch_debug
>= 2)
2726 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
2727 return gdbarch
->addr_bits_remove (gdbarch
, addr
);
2731 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
2732 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
2734 gdbarch
->addr_bits_remove
= addr_bits_remove
;
2738 gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2740 gdb_assert (gdbarch
!= NULL
);
2741 gdb_assert (gdbarch
->smash_text_address
!= NULL
);
2742 if (gdbarch_debug
>= 2)
2743 fprintf_unfiltered (gdb_stdlog
, "gdbarch_smash_text_address called\n");
2744 return gdbarch
->smash_text_address (gdbarch
, addr
);
2748 set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
,
2749 gdbarch_smash_text_address_ftype smash_text_address
)
2751 gdbarch
->smash_text_address
= smash_text_address
;
2755 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
2757 gdb_assert (gdbarch
!= NULL
);
2758 return gdbarch
->software_single_step
!= NULL
;
2762 gdbarch_software_single_step (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2764 gdb_assert (gdbarch
!= NULL
);
2765 gdb_assert (gdbarch
->software_single_step
!= NULL
);
2766 if (gdbarch_debug
>= 2)
2767 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
2768 return gdbarch
->software_single_step (frame
);
2772 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
2773 gdbarch_software_single_step_ftype software_single_step
)
2775 gdbarch
->software_single_step
= software_single_step
;
2779 gdbarch_single_step_through_delay_p (struct gdbarch
*gdbarch
)
2781 gdb_assert (gdbarch
!= NULL
);
2782 return gdbarch
->single_step_through_delay
!= NULL
;
2786 gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2788 gdb_assert (gdbarch
!= NULL
);
2789 gdb_assert (gdbarch
->single_step_through_delay
!= NULL
);
2790 if (gdbarch_debug
>= 2)
2791 fprintf_unfiltered (gdb_stdlog
, "gdbarch_single_step_through_delay called\n");
2792 return gdbarch
->single_step_through_delay (gdbarch
, frame
);
2796 set_gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
,
2797 gdbarch_single_step_through_delay_ftype single_step_through_delay
)
2799 gdbarch
->single_step_through_delay
= single_step_through_delay
;
2803 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
2805 gdb_assert (gdbarch
!= NULL
);
2806 gdb_assert (gdbarch
->print_insn
!= NULL
);
2807 if (gdbarch_debug
>= 2)
2808 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
2809 return gdbarch
->print_insn (vma
, info
);
2813 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
2814 gdbarch_print_insn_ftype print_insn
)
2816 gdbarch
->print_insn
= print_insn
;
2820 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR pc
)
2822 gdb_assert (gdbarch
!= NULL
);
2823 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
2824 if (gdbarch_debug
>= 2)
2825 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
2826 return gdbarch
->skip_trampoline_code (frame
, pc
);
2830 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
2831 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
2833 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
2837 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
2839 gdb_assert (gdbarch
!= NULL
);
2840 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
2841 if (gdbarch_debug
>= 2)
2842 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
2843 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
2847 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
2848 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
2850 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
2854 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
)
2856 gdb_assert (gdbarch
!= NULL
);
2857 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
2858 if (gdbarch_debug
>= 2)
2859 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
2860 return gdbarch
->in_solib_return_trampoline (gdbarch
, pc
, name
);
2864 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
2865 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
2867 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
2871 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2873 gdb_assert (gdbarch
!= NULL
);
2874 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
2875 if (gdbarch_debug
>= 2)
2876 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
2877 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
2881 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
2882 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
2884 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
2888 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
2890 gdb_assert (gdbarch
!= NULL
);
2891 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
2892 if (gdbarch_debug
>= 2)
2893 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
2894 gdbarch
->elf_make_msymbol_special (sym
, msym
);
2898 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
2899 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
2901 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
2905 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
2907 gdb_assert (gdbarch
!= NULL
);
2908 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
2909 if (gdbarch_debug
>= 2)
2910 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
2911 gdbarch
->coff_make_msymbol_special (val
, msym
);
2915 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
2916 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
2918 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
2922 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
2924 gdb_assert (gdbarch
!= NULL
);
2925 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2926 if (gdbarch_debug
>= 2)
2927 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
2928 return gdbarch
->cannot_step_breakpoint
;
2932 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
2933 int cannot_step_breakpoint
)
2935 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
2939 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
2941 gdb_assert (gdbarch
!= NULL
);
2942 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2943 if (gdbarch_debug
>= 2)
2944 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
2945 return gdbarch
->have_nonsteppable_watchpoint
;
2949 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
2950 int have_nonsteppable_watchpoint
)
2952 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
2956 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
2958 gdb_assert (gdbarch
!= NULL
);
2959 return gdbarch
->address_class_type_flags
!= NULL
;
2963 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
2965 gdb_assert (gdbarch
!= NULL
);
2966 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
2967 if (gdbarch_debug
>= 2)
2968 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
2969 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
2973 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
2974 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
2976 gdbarch
->address_class_type_flags
= address_class_type_flags
;
2980 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
2982 gdb_assert (gdbarch
!= NULL
);
2983 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
2987 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
2989 gdb_assert (gdbarch
!= NULL
);
2990 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
2991 if (gdbarch_debug
>= 2)
2992 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
2993 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
2997 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
2998 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
3000 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
3004 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
3006 gdb_assert (gdbarch
!= NULL
);
3007 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
3011 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
3013 gdb_assert (gdbarch
!= NULL
);
3014 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
3015 if (gdbarch_debug
>= 2)
3016 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
3017 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
3021 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
3022 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
3024 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
3028 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
3030 gdb_assert (gdbarch
!= NULL
);
3031 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
3032 if (gdbarch_debug
>= 2)
3033 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
3034 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
3038 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
3039 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
3041 gdbarch
->register_reggroup_p
= register_reggroup_p
;
3045 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
3047 gdb_assert (gdbarch
!= NULL
);
3048 return gdbarch
->fetch_pointer_argument
!= NULL
;
3052 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
3054 gdb_assert (gdbarch
!= NULL
);
3055 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
3056 if (gdbarch_debug
>= 2)
3057 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
3058 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
3062 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
3063 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
3065 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
3069 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
3071 gdb_assert (gdbarch
!= NULL
);
3072 return gdbarch
->regset_from_core_section
!= NULL
;
3075 const struct regset
*
3076 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
3078 gdb_assert (gdbarch
!= NULL
);
3079 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
3080 if (gdbarch_debug
>= 2)
3081 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
3082 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
3086 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
3087 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
3089 gdbarch
->regset_from_core_section
= regset_from_core_section
;
3092 struct core_regset_section
*
3093 gdbarch_core_regset_sections (struct gdbarch
*gdbarch
)
3095 gdb_assert (gdbarch
!= NULL
);
3096 if (gdbarch_debug
>= 2)
3097 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_regset_sections called\n");
3098 return gdbarch
->core_regset_sections
;
3102 set_gdbarch_core_regset_sections (struct gdbarch
*gdbarch
,
3103 struct core_regset_section
* core_regset_sections
)
3105 gdbarch
->core_regset_sections
= core_regset_sections
;
3109 gdbarch_core_xfer_shared_libraries_p (struct gdbarch
*gdbarch
)
3111 gdb_assert (gdbarch
!= NULL
);
3112 return gdbarch
->core_xfer_shared_libraries
!= NULL
;
3116 gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
, gdb_byte
*readbuf
, ULONGEST offset
, LONGEST len
)
3118 gdb_assert (gdbarch
!= NULL
);
3119 gdb_assert (gdbarch
->core_xfer_shared_libraries
!= NULL
);
3120 if (gdbarch_debug
>= 2)
3121 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_xfer_shared_libraries called\n");
3122 return gdbarch
->core_xfer_shared_libraries (gdbarch
, readbuf
, offset
, len
);
3126 set_gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
,
3127 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries
)
3129 gdbarch
->core_xfer_shared_libraries
= core_xfer_shared_libraries
;
3133 gdbarch_core_pid_to_str_p (struct gdbarch
*gdbarch
)
3135 gdb_assert (gdbarch
!= NULL
);
3136 return gdbarch
->core_pid_to_str
!= NULL
;
3140 gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
, ptid_t ptid
)
3142 gdb_assert (gdbarch
!= NULL
);
3143 gdb_assert (gdbarch
->core_pid_to_str
!= NULL
);
3144 if (gdbarch_debug
>= 2)
3145 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_pid_to_str called\n");
3146 return gdbarch
->core_pid_to_str (gdbarch
, ptid
);
3150 set_gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
,
3151 gdbarch_core_pid_to_str_ftype core_pid_to_str
)
3153 gdbarch
->core_pid_to_str
= core_pid_to_str
;
3157 gdbarch_gcore_bfd_target_p (struct gdbarch
*gdbarch
)
3159 gdb_assert (gdbarch
!= NULL
);
3160 return gdbarch
->gcore_bfd_target
!= 0;
3164 gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
)
3166 gdb_assert (gdbarch
!= NULL
);
3167 /* Check variable changed from pre-default. */
3168 gdb_assert (gdbarch
->gcore_bfd_target
!= 0);
3169 if (gdbarch_debug
>= 2)
3170 fprintf_unfiltered (gdb_stdlog
, "gdbarch_gcore_bfd_target called\n");
3171 return gdbarch
->gcore_bfd_target
;
3175 set_gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
,
3176 const char * gcore_bfd_target
)
3178 gdbarch
->gcore_bfd_target
= gcore_bfd_target
;
3182 gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
)
3184 gdb_assert (gdbarch
!= NULL
);
3185 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3186 if (gdbarch_debug
>= 2)
3187 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vtable_function_descriptors called\n");
3188 return gdbarch
->vtable_function_descriptors
;
3192 set_gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
,
3193 int vtable_function_descriptors
)
3195 gdbarch
->vtable_function_descriptors
= vtable_function_descriptors
;
3199 gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
)
3201 gdb_assert (gdbarch
!= NULL
);
3202 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3203 if (gdbarch_debug
>= 2)
3204 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vbit_in_delta called\n");
3205 return gdbarch
->vbit_in_delta
;
3209 set_gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
,
3212 gdbarch
->vbit_in_delta
= vbit_in_delta
;
3216 gdbarch_skip_permanent_breakpoint_p (struct gdbarch
*gdbarch
)
3218 gdb_assert (gdbarch
!= NULL
);
3219 return gdbarch
->skip_permanent_breakpoint
!= NULL
;
3223 gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
3225 gdb_assert (gdbarch
!= NULL
);
3226 gdb_assert (gdbarch
->skip_permanent_breakpoint
!= NULL
);
3227 if (gdbarch_debug
>= 2)
3228 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_permanent_breakpoint called\n");
3229 gdbarch
->skip_permanent_breakpoint (regcache
);
3233 set_gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
,
3234 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint
)
3236 gdbarch
->skip_permanent_breakpoint
= skip_permanent_breakpoint
;
3240 gdbarch_max_insn_length_p (struct gdbarch
*gdbarch
)
3242 gdb_assert (gdbarch
!= NULL
);
3243 return gdbarch
->max_insn_length
!= 0;
3247 gdbarch_max_insn_length (struct gdbarch
*gdbarch
)
3249 gdb_assert (gdbarch
!= NULL
);
3250 /* Check variable changed from pre-default. */
3251 gdb_assert (gdbarch
->max_insn_length
!= 0);
3252 if (gdbarch_debug
>= 2)
3253 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_insn_length called\n");
3254 return gdbarch
->max_insn_length
;
3258 set_gdbarch_max_insn_length (struct gdbarch
*gdbarch
,
3259 ULONGEST max_insn_length
)
3261 gdbarch
->max_insn_length
= max_insn_length
;
3265 gdbarch_displaced_step_copy_insn_p (struct gdbarch
*gdbarch
)
3267 gdb_assert (gdbarch
!= NULL
);
3268 return gdbarch
->displaced_step_copy_insn
!= NULL
;
3271 struct displaced_step_closure
*
3272 gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3274 gdb_assert (gdbarch
!= NULL
);
3275 gdb_assert (gdbarch
->displaced_step_copy_insn
!= NULL
);
3276 if (gdbarch_debug
>= 2)
3277 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_copy_insn called\n");
3278 return gdbarch
->displaced_step_copy_insn (gdbarch
, from
, to
, regs
);
3282 set_gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
,
3283 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn
)
3285 gdbarch
->displaced_step_copy_insn
= displaced_step_copy_insn
;
3289 gdbarch_displaced_step_hw_singlestep (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3291 gdb_assert (gdbarch
!= NULL
);
3292 gdb_assert (gdbarch
->displaced_step_hw_singlestep
!= NULL
);
3293 if (gdbarch_debug
>= 2)
3294 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_hw_singlestep called\n");
3295 return gdbarch
->displaced_step_hw_singlestep (gdbarch
, closure
);
3299 set_gdbarch_displaced_step_hw_singlestep (struct gdbarch
*gdbarch
,
3300 gdbarch_displaced_step_hw_singlestep_ftype displaced_step_hw_singlestep
)
3302 gdbarch
->displaced_step_hw_singlestep
= displaced_step_hw_singlestep
;
3306 gdbarch_displaced_step_fixup_p (struct gdbarch
*gdbarch
)
3308 gdb_assert (gdbarch
!= NULL
);
3309 return gdbarch
->displaced_step_fixup
!= NULL
;
3313 gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3315 gdb_assert (gdbarch
!= NULL
);
3316 gdb_assert (gdbarch
->displaced_step_fixup
!= NULL
);
3317 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3318 if (gdbarch_debug
>= 2)
3319 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_fixup called\n");
3320 gdbarch
->displaced_step_fixup (gdbarch
, closure
, from
, to
, regs
);
3324 set_gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
,
3325 gdbarch_displaced_step_fixup_ftype displaced_step_fixup
)
3327 gdbarch
->displaced_step_fixup
= displaced_step_fixup
;
3331 gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3333 gdb_assert (gdbarch
!= NULL
);
3334 gdb_assert (gdbarch
->displaced_step_free_closure
!= NULL
);
3335 if (gdbarch_debug
>= 2)
3336 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_free_closure called\n");
3337 gdbarch
->displaced_step_free_closure (gdbarch
, closure
);
3341 set_gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
,
3342 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure
)
3344 gdbarch
->displaced_step_free_closure
= displaced_step_free_closure
;
3348 gdbarch_displaced_step_location (struct gdbarch
*gdbarch
)
3350 gdb_assert (gdbarch
!= NULL
);
3351 gdb_assert (gdbarch
->displaced_step_location
!= NULL
);
3352 if (gdbarch_debug
>= 2)
3353 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_location called\n");
3354 return gdbarch
->displaced_step_location (gdbarch
);
3358 set_gdbarch_displaced_step_location (struct gdbarch
*gdbarch
,
3359 gdbarch_displaced_step_location_ftype displaced_step_location
)
3361 gdbarch
->displaced_step_location
= displaced_step_location
;
3365 gdbarch_relocate_instruction_p (struct gdbarch
*gdbarch
)
3367 gdb_assert (gdbarch
!= NULL
);
3368 return gdbarch
->relocate_instruction
!= NULL
;
3372 gdbarch_relocate_instruction (struct gdbarch
*gdbarch
, CORE_ADDR
*to
, CORE_ADDR from
)
3374 gdb_assert (gdbarch
!= NULL
);
3375 gdb_assert (gdbarch
->relocate_instruction
!= NULL
);
3376 /* Do not check predicate: gdbarch->relocate_instruction != NULL, allow call. */
3377 if (gdbarch_debug
>= 2)
3378 fprintf_unfiltered (gdb_stdlog
, "gdbarch_relocate_instruction called\n");
3379 gdbarch
->relocate_instruction (gdbarch
, to
, from
);
3383 set_gdbarch_relocate_instruction (struct gdbarch
*gdbarch
,
3384 gdbarch_relocate_instruction_ftype relocate_instruction
)
3386 gdbarch
->relocate_instruction
= relocate_instruction
;
3390 gdbarch_overlay_update_p (struct gdbarch
*gdbarch
)
3392 gdb_assert (gdbarch
!= NULL
);
3393 return gdbarch
->overlay_update
!= NULL
;
3397 gdbarch_overlay_update (struct gdbarch
*gdbarch
, struct obj_section
*osect
)
3399 gdb_assert (gdbarch
!= NULL
);
3400 gdb_assert (gdbarch
->overlay_update
!= NULL
);
3401 if (gdbarch_debug
>= 2)
3402 fprintf_unfiltered (gdb_stdlog
, "gdbarch_overlay_update called\n");
3403 gdbarch
->overlay_update (osect
);
3407 set_gdbarch_overlay_update (struct gdbarch
*gdbarch
,
3408 gdbarch_overlay_update_ftype overlay_update
)
3410 gdbarch
->overlay_update
= overlay_update
;
3414 gdbarch_core_read_description_p (struct gdbarch
*gdbarch
)
3416 gdb_assert (gdbarch
!= NULL
);
3417 return gdbarch
->core_read_description
!= NULL
;
3420 const struct target_desc
*
3421 gdbarch_core_read_description (struct gdbarch
*gdbarch
, struct target_ops
*target
, bfd
*abfd
)
3423 gdb_assert (gdbarch
!= NULL
);
3424 gdb_assert (gdbarch
->core_read_description
!= NULL
);
3425 if (gdbarch_debug
>= 2)
3426 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_read_description called\n");
3427 return gdbarch
->core_read_description (gdbarch
, target
, abfd
);
3431 set_gdbarch_core_read_description (struct gdbarch
*gdbarch
,
3432 gdbarch_core_read_description_ftype core_read_description
)
3434 gdbarch
->core_read_description
= core_read_description
;
3438 gdbarch_static_transform_name_p (struct gdbarch
*gdbarch
)
3440 gdb_assert (gdbarch
!= NULL
);
3441 return gdbarch
->static_transform_name
!= NULL
;
3445 gdbarch_static_transform_name (struct gdbarch
*gdbarch
, char *name
)
3447 gdb_assert (gdbarch
!= NULL
);
3448 gdb_assert (gdbarch
->static_transform_name
!= NULL
);
3449 if (gdbarch_debug
>= 2)
3450 fprintf_unfiltered (gdb_stdlog
, "gdbarch_static_transform_name called\n");
3451 return gdbarch
->static_transform_name (name
);
3455 set_gdbarch_static_transform_name (struct gdbarch
*gdbarch
,
3456 gdbarch_static_transform_name_ftype static_transform_name
)
3458 gdbarch
->static_transform_name
= static_transform_name
;
3462 gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
)
3464 gdb_assert (gdbarch
!= NULL
);
3465 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3466 if (gdbarch_debug
>= 2)
3467 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sofun_address_maybe_missing called\n");
3468 return gdbarch
->sofun_address_maybe_missing
;
3472 set_gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
,
3473 int sofun_address_maybe_missing
)
3475 gdbarch
->sofun_address_maybe_missing
= sofun_address_maybe_missing
;
3479 gdbarch_process_record_p (struct gdbarch
*gdbarch
)
3481 gdb_assert (gdbarch
!= NULL
);
3482 return gdbarch
->process_record
!= NULL
;
3486 gdbarch_process_record (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR addr
)
3488 gdb_assert (gdbarch
!= NULL
);
3489 gdb_assert (gdbarch
->process_record
!= NULL
);
3490 if (gdbarch_debug
>= 2)
3491 fprintf_unfiltered (gdb_stdlog
, "gdbarch_process_record called\n");
3492 return gdbarch
->process_record (gdbarch
, regcache
, addr
);
3496 set_gdbarch_process_record (struct gdbarch
*gdbarch
,
3497 gdbarch_process_record_ftype process_record
)
3499 gdbarch
->process_record
= process_record
;
3503 gdbarch_process_record_signal_p (struct gdbarch
*gdbarch
)
3505 gdb_assert (gdbarch
!= NULL
);
3506 return gdbarch
->process_record_signal
!= NULL
;
3510 gdbarch_process_record_signal (struct gdbarch
*gdbarch
, struct regcache
*regcache
, enum target_signal signal
)
3512 gdb_assert (gdbarch
!= NULL
);
3513 gdb_assert (gdbarch
->process_record_signal
!= NULL
);
3514 if (gdbarch_debug
>= 2)
3515 fprintf_unfiltered (gdb_stdlog
, "gdbarch_process_record_signal called\n");
3516 return gdbarch
->process_record_signal (gdbarch
, regcache
, signal
);
3520 set_gdbarch_process_record_signal (struct gdbarch
*gdbarch
,
3521 gdbarch_process_record_signal_ftype process_record_signal
)
3523 gdbarch
->process_record_signal
= process_record_signal
;
3527 gdbarch_target_signal_from_host (struct gdbarch
*gdbarch
, int signo
)
3529 gdb_assert (gdbarch
!= NULL
);
3530 gdb_assert (gdbarch
->target_signal_from_host
!= NULL
);
3531 if (gdbarch_debug
>= 2)
3532 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_signal_from_host called\n");
3533 return gdbarch
->target_signal_from_host (gdbarch
, signo
);
3537 set_gdbarch_target_signal_from_host (struct gdbarch
*gdbarch
,
3538 gdbarch_target_signal_from_host_ftype target_signal_from_host
)
3540 gdbarch
->target_signal_from_host
= target_signal_from_host
;
3544 gdbarch_target_signal_to_host (struct gdbarch
*gdbarch
, enum target_signal ts
)
3546 gdb_assert (gdbarch
!= NULL
);
3547 gdb_assert (gdbarch
->target_signal_to_host
!= NULL
);
3548 if (gdbarch_debug
>= 2)
3549 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_signal_to_host called\n");
3550 return gdbarch
->target_signal_to_host (gdbarch
, ts
);
3554 set_gdbarch_target_signal_to_host (struct gdbarch
*gdbarch
,
3555 gdbarch_target_signal_to_host_ftype target_signal_to_host
)
3557 gdbarch
->target_signal_to_host
= target_signal_to_host
;
3561 gdbarch_get_siginfo_type_p (struct gdbarch
*gdbarch
)
3563 gdb_assert (gdbarch
!= NULL
);
3564 return gdbarch
->get_siginfo_type
!= NULL
;
3568 gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
)
3570 gdb_assert (gdbarch
!= NULL
);
3571 gdb_assert (gdbarch
->get_siginfo_type
!= NULL
);
3572 if (gdbarch_debug
>= 2)
3573 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_siginfo_type called\n");
3574 return gdbarch
->get_siginfo_type (gdbarch
);
3578 set_gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
,
3579 gdbarch_get_siginfo_type_ftype get_siginfo_type
)
3581 gdbarch
->get_siginfo_type
= get_siginfo_type
;
3585 gdbarch_record_special_symbol_p (struct gdbarch
*gdbarch
)
3587 gdb_assert (gdbarch
!= NULL
);
3588 return gdbarch
->record_special_symbol
!= NULL
;
3592 gdbarch_record_special_symbol (struct gdbarch
*gdbarch
, struct objfile
*objfile
, asymbol
*sym
)
3594 gdb_assert (gdbarch
!= NULL
);
3595 gdb_assert (gdbarch
->record_special_symbol
!= NULL
);
3596 if (gdbarch_debug
>= 2)
3597 fprintf_unfiltered (gdb_stdlog
, "gdbarch_record_special_symbol called\n");
3598 gdbarch
->record_special_symbol (gdbarch
, objfile
, sym
);
3602 set_gdbarch_record_special_symbol (struct gdbarch
*gdbarch
,
3603 gdbarch_record_special_symbol_ftype record_special_symbol
)
3605 gdbarch
->record_special_symbol
= record_special_symbol
;
3609 gdbarch_get_syscall_number_p (struct gdbarch
*gdbarch
)
3611 gdb_assert (gdbarch
!= NULL
);
3612 return gdbarch
->get_syscall_number
!= NULL
;
3616 gdbarch_get_syscall_number (struct gdbarch
*gdbarch
, ptid_t ptid
)
3618 gdb_assert (gdbarch
!= NULL
);
3619 gdb_assert (gdbarch
->get_syscall_number
!= NULL
);
3620 if (gdbarch_debug
>= 2)
3621 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_syscall_number called\n");
3622 return gdbarch
->get_syscall_number (gdbarch
, ptid
);
3626 set_gdbarch_get_syscall_number (struct gdbarch
*gdbarch
,
3627 gdbarch_get_syscall_number_ftype get_syscall_number
)
3629 gdbarch
->get_syscall_number
= get_syscall_number
;
3633 gdbarch_has_global_solist (struct gdbarch
*gdbarch
)
3635 gdb_assert (gdbarch
!= NULL
);
3636 /* Skip verify of has_global_solist, invalid_p == 0 */
3637 if (gdbarch_debug
>= 2)
3638 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_solist called\n");
3639 return gdbarch
->has_global_solist
;
3643 set_gdbarch_has_global_solist (struct gdbarch
*gdbarch
,
3644 int has_global_solist
)
3646 gdbarch
->has_global_solist
= has_global_solist
;
3650 gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
)
3652 gdb_assert (gdbarch
!= NULL
);
3653 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
3654 if (gdbarch_debug
>= 2)
3655 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_breakpoints called\n");
3656 return gdbarch
->has_global_breakpoints
;
3660 set_gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
,
3661 int has_global_breakpoints
)
3663 gdbarch
->has_global_breakpoints
= has_global_breakpoints
;
3667 gdbarch_has_shared_address_space (struct gdbarch
*gdbarch
)
3669 gdb_assert (gdbarch
!= NULL
);
3670 gdb_assert (gdbarch
->has_shared_address_space
!= NULL
);
3671 if (gdbarch_debug
>= 2)
3672 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_shared_address_space called\n");
3673 return gdbarch
->has_shared_address_space (gdbarch
);
3677 set_gdbarch_has_shared_address_space (struct gdbarch
*gdbarch
,
3678 gdbarch_has_shared_address_space_ftype has_shared_address_space
)
3680 gdbarch
->has_shared_address_space
= has_shared_address_space
;
3684 gdbarch_fast_tracepoint_valid_at (struct gdbarch
*gdbarch
, CORE_ADDR addr
, int *isize
, char **msg
)
3686 gdb_assert (gdbarch
!= NULL
);
3687 gdb_assert (gdbarch
->fast_tracepoint_valid_at
!= NULL
);
3688 if (gdbarch_debug
>= 2)
3689 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fast_tracepoint_valid_at called\n");
3690 return gdbarch
->fast_tracepoint_valid_at (gdbarch
, addr
, isize
, msg
);
3694 set_gdbarch_fast_tracepoint_valid_at (struct gdbarch
*gdbarch
,
3695 gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at
)
3697 gdbarch
->fast_tracepoint_valid_at
= fast_tracepoint_valid_at
;
3701 gdbarch_auto_charset (struct gdbarch
*gdbarch
)
3703 gdb_assert (gdbarch
!= NULL
);
3704 gdb_assert (gdbarch
->auto_charset
!= NULL
);
3705 if (gdbarch_debug
>= 2)
3706 fprintf_unfiltered (gdb_stdlog
, "gdbarch_auto_charset called\n");
3707 return gdbarch
->auto_charset ();
3711 set_gdbarch_auto_charset (struct gdbarch
*gdbarch
,
3712 gdbarch_auto_charset_ftype auto_charset
)
3714 gdbarch
->auto_charset
= auto_charset
;
3718 gdbarch_auto_wide_charset (struct gdbarch
*gdbarch
)
3720 gdb_assert (gdbarch
!= NULL
);
3721 gdb_assert (gdbarch
->auto_wide_charset
!= NULL
);
3722 if (gdbarch_debug
>= 2)
3723 fprintf_unfiltered (gdb_stdlog
, "gdbarch_auto_wide_charset called\n");
3724 return gdbarch
->auto_wide_charset ();
3728 set_gdbarch_auto_wide_charset (struct gdbarch
*gdbarch
,
3729 gdbarch_auto_wide_charset_ftype auto_wide_charset
)
3731 gdbarch
->auto_wide_charset
= auto_wide_charset
;
3735 gdbarch_solib_symbols_extension (struct gdbarch
*gdbarch
)
3737 gdb_assert (gdbarch
!= NULL
);
3738 if (gdbarch_debug
>= 2)
3739 fprintf_unfiltered (gdb_stdlog
, "gdbarch_solib_symbols_extension called\n");
3740 return gdbarch
->solib_symbols_extension
;
3744 set_gdbarch_solib_symbols_extension (struct gdbarch
*gdbarch
,
3745 const char * solib_symbols_extension
)
3747 gdbarch
->solib_symbols_extension
= solib_symbols_extension
;
3751 gdbarch_has_dos_based_file_system (struct gdbarch
*gdbarch
)
3753 gdb_assert (gdbarch
!= NULL
);
3754 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
3755 if (gdbarch_debug
>= 2)
3756 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_dos_based_file_system called\n");
3757 return gdbarch
->has_dos_based_file_system
;
3761 set_gdbarch_has_dos_based_file_system (struct gdbarch
*gdbarch
,
3762 int has_dos_based_file_system
)
3764 gdbarch
->has_dos_based_file_system
= has_dos_based_file_system
;
3768 /* Keep a registry of per-architecture data-pointers required by GDB
3775 gdbarch_data_pre_init_ftype
*pre_init
;
3776 gdbarch_data_post_init_ftype
*post_init
;
3779 struct gdbarch_data_registration
3781 struct gdbarch_data
*data
;
3782 struct gdbarch_data_registration
*next
;
3785 struct gdbarch_data_registry
3788 struct gdbarch_data_registration
*registrations
;
3791 struct gdbarch_data_registry gdbarch_data_registry
=
3796 static struct gdbarch_data
*
3797 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
3798 gdbarch_data_post_init_ftype
*post_init
)
3800 struct gdbarch_data_registration
**curr
;
3802 /* Append the new registration. */
3803 for (curr
= &gdbarch_data_registry
.registrations
;
3805 curr
= &(*curr
)->next
);
3806 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
3807 (*curr
)->next
= NULL
;
3808 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
3809 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
3810 (*curr
)->data
->pre_init
= pre_init
;
3811 (*curr
)->data
->post_init
= post_init
;
3812 (*curr
)->data
->init_p
= 1;
3813 return (*curr
)->data
;
3816 struct gdbarch_data
*
3817 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
3819 return gdbarch_data_register (pre_init
, NULL
);
3822 struct gdbarch_data
*
3823 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
3825 return gdbarch_data_register (NULL
, post_init
);
3828 /* Create/delete the gdbarch data vector. */
3831 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
3833 gdb_assert (gdbarch
->data
== NULL
);
3834 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
3835 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
3838 /* Initialize the current value of the specified per-architecture
3842 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
3843 struct gdbarch_data
*data
,
3846 gdb_assert (data
->index
< gdbarch
->nr_data
);
3847 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
3848 gdb_assert (data
->pre_init
== NULL
);
3849 gdbarch
->data
[data
->index
] = pointer
;
3852 /* Return the current value of the specified per-architecture
3856 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
3858 gdb_assert (data
->index
< gdbarch
->nr_data
);
3859 if (gdbarch
->data
[data
->index
] == NULL
)
3861 /* The data-pointer isn't initialized, call init() to get a
3863 if (data
->pre_init
!= NULL
)
3864 /* Mid architecture creation: pass just the obstack, and not
3865 the entire architecture, as that way it isn't possible for
3866 pre-init code to refer to undefined architecture
3868 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
3869 else if (gdbarch
->initialized_p
3870 && data
->post_init
!= NULL
)
3871 /* Post architecture creation: pass the entire architecture
3872 (as all fields are valid), but be careful to also detect
3873 recursive references. */
3875 gdb_assert (data
->init_p
);
3877 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
3881 /* The architecture initialization hasn't completed - punt -
3882 hope that the caller knows what they are doing. Once
3883 deprecated_set_gdbarch_data has been initialized, this can be
3884 changed to an internal error. */
3886 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
3888 return gdbarch
->data
[data
->index
];
3892 /* Keep a registry of the architectures known by GDB. */
3894 struct gdbarch_registration
3896 enum bfd_architecture bfd_architecture
;
3897 gdbarch_init_ftype
*init
;
3898 gdbarch_dump_tdep_ftype
*dump_tdep
;
3899 struct gdbarch_list
*arches
;
3900 struct gdbarch_registration
*next
;
3903 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
3906 append_name (const char ***buf
, int *nr
, const char *name
)
3908 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
3914 gdbarch_printable_names (void)
3916 /* Accumulate a list of names based on the registed list of
3919 const char **arches
= NULL
;
3920 struct gdbarch_registration
*rego
;
3922 for (rego
= gdbarch_registry
;
3926 const struct bfd_arch_info
*ap
;
3927 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3929 internal_error (__FILE__
, __LINE__
,
3930 _("gdbarch_architecture_names: multi-arch unknown"));
3933 append_name (&arches
, &nr_arches
, ap
->printable_name
);
3938 append_name (&arches
, &nr_arches
, NULL
);
3944 gdbarch_register (enum bfd_architecture bfd_architecture
,
3945 gdbarch_init_ftype
*init
,
3946 gdbarch_dump_tdep_ftype
*dump_tdep
)
3948 struct gdbarch_registration
**curr
;
3949 const struct bfd_arch_info
*bfd_arch_info
;
3951 /* Check that BFD recognizes this architecture */
3952 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
3953 if (bfd_arch_info
== NULL
)
3955 internal_error (__FILE__
, __LINE__
,
3956 _("gdbarch: Attempt to register unknown architecture (%d)"),
3959 /* Check that we haven't seen this architecture before */
3960 for (curr
= &gdbarch_registry
;
3962 curr
= &(*curr
)->next
)
3964 if (bfd_architecture
== (*curr
)->bfd_architecture
)
3965 internal_error (__FILE__
, __LINE__
,
3966 _("gdbarch: Duplicate registraration of architecture (%s)"),
3967 bfd_arch_info
->printable_name
);
3971 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, %s)\n",
3972 bfd_arch_info
->printable_name
,
3973 host_address_to_string (init
));
3975 (*curr
) = XMALLOC (struct gdbarch_registration
);
3976 (*curr
)->bfd_architecture
= bfd_architecture
;
3977 (*curr
)->init
= init
;
3978 (*curr
)->dump_tdep
= dump_tdep
;
3979 (*curr
)->arches
= NULL
;
3980 (*curr
)->next
= NULL
;
3984 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
3985 gdbarch_init_ftype
*init
)
3987 gdbarch_register (bfd_architecture
, init
, NULL
);
3991 /* Look for an architecture using gdbarch_info. */
3993 struct gdbarch_list
*
3994 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
3995 const struct gdbarch_info
*info
)
3997 for (; arches
!= NULL
; arches
= arches
->next
)
3999 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
4001 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
4003 if (info
->osabi
!= arches
->gdbarch
->osabi
)
4005 if (info
->target_desc
!= arches
->gdbarch
->target_desc
)
4013 /* Find an architecture that matches the specified INFO. Create a new
4014 architecture if needed. Return that new architecture. */
4017 gdbarch_find_by_info (struct gdbarch_info info
)
4019 struct gdbarch
*new_gdbarch
;
4020 struct gdbarch_registration
*rego
;
4022 /* Fill in missing parts of the INFO struct using a number of
4023 sources: "set ..."; INFOabfd supplied; and the global
4025 gdbarch_info_fill (&info
);
4027 /* Must have found some sort of architecture. */
4028 gdb_assert (info
.bfd_arch_info
!= NULL
);
4032 fprintf_unfiltered (gdb_stdlog
,
4033 "gdbarch_find_by_info: info.bfd_arch_info %s\n",
4034 (info
.bfd_arch_info
!= NULL
4035 ? info
.bfd_arch_info
->printable_name
4037 fprintf_unfiltered (gdb_stdlog
,
4038 "gdbarch_find_by_info: info.byte_order %d (%s)\n",
4040 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
4041 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
4043 fprintf_unfiltered (gdb_stdlog
,
4044 "gdbarch_find_by_info: info.osabi %d (%s)\n",
4045 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
4046 fprintf_unfiltered (gdb_stdlog
,
4047 "gdbarch_find_by_info: info.abfd %s\n",
4048 host_address_to_string (info
.abfd
));
4049 fprintf_unfiltered (gdb_stdlog
,
4050 "gdbarch_find_by_info: info.tdep_info %s\n",
4051 host_address_to_string (info
.tdep_info
));
4054 /* Find the tdep code that knows about this architecture. */
4055 for (rego
= gdbarch_registry
;
4058 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
4063 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4064 "No matching architecture\n");
4068 /* Ask the tdep code for an architecture that matches "info". */
4069 new_gdbarch
= rego
->init (info
, rego
->arches
);
4071 /* Did the tdep code like it? No. Reject the change and revert to
4072 the old architecture. */
4073 if (new_gdbarch
== NULL
)
4076 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4077 "Target rejected architecture\n");
4081 /* Is this a pre-existing architecture (as determined by already
4082 being initialized)? Move it to the front of the architecture
4083 list (keeping the list sorted Most Recently Used). */
4084 if (new_gdbarch
->initialized_p
)
4086 struct gdbarch_list
**list
;
4087 struct gdbarch_list
*this;
4089 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4090 "Previous architecture %s (%s) selected\n",
4091 host_address_to_string (new_gdbarch
),
4092 new_gdbarch
->bfd_arch_info
->printable_name
);
4093 /* Find the existing arch in the list. */
4094 for (list
= ®o
->arches
;
4095 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
4096 list
= &(*list
)->next
);
4097 /* It had better be in the list of architectures. */
4098 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
4101 (*list
) = this->next
;
4102 /* Insert THIS at the front. */
4103 this->next
= rego
->arches
;
4104 rego
->arches
= this;
4109 /* It's a new architecture. */
4111 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4112 "New architecture %s (%s) selected\n",
4113 host_address_to_string (new_gdbarch
),
4114 new_gdbarch
->bfd_arch_info
->printable_name
);
4116 /* Insert the new architecture into the front of the architecture
4117 list (keep the list sorted Most Recently Used). */
4119 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
4120 this->next
= rego
->arches
;
4121 this->gdbarch
= new_gdbarch
;
4122 rego
->arches
= this;
4125 /* Check that the newly installed architecture is valid. Plug in
4126 any post init values. */
4127 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
4128 verify_gdbarch (new_gdbarch
);
4129 new_gdbarch
->initialized_p
= 1;
4132 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
4137 /* Make the specified architecture current. */
4140 deprecated_target_gdbarch_select_hack (struct gdbarch
*new_gdbarch
)
4142 gdb_assert (new_gdbarch
!= NULL
);
4143 gdb_assert (new_gdbarch
->initialized_p
);
4144 target_gdbarch
= new_gdbarch
;
4145 observer_notify_architecture_changed (new_gdbarch
);
4146 registers_changed ();
4149 extern void _initialize_gdbarch (void);
4152 _initialize_gdbarch (void)
4154 add_setshow_zinteger_cmd ("arch", class_maintenance
, &gdbarch_debug
, _("\
4155 Set architecture debugging."), _("\
4156 Show architecture debugging."), _("\
4157 When non-zero, architecture debugging is enabled."),
4160 &setdebuglist
, &showdebuglist
);