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
;
159 gdbarch_read_pc_ftype
*read_pc
;
160 gdbarch_write_pc_ftype
*write_pc
;
161 gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
;
162 gdbarch_pseudo_register_read_ftype
*pseudo_register_read
;
163 gdbarch_pseudo_register_write_ftype
*pseudo_register_write
;
170 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
171 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
172 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
173 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
174 gdbarch_register_name_ftype
*register_name
;
175 gdbarch_register_type_ftype
*register_type
;
176 gdbarch_dummy_id_ftype
*dummy_id
;
177 int deprecated_fp_regnum
;
178 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
179 int call_dummy_location
;
180 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
181 gdbarch_print_registers_info_ftype
*print_registers_info
;
182 gdbarch_print_float_info_ftype
*print_float_info
;
183 gdbarch_print_vector_info_ftype
*print_vector_info
;
184 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
185 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
186 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
187 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
188 int believe_pcc_promotion
;
189 gdbarch_convert_register_p_ftype
*convert_register_p
;
190 gdbarch_register_to_value_ftype
*register_to_value
;
191 gdbarch_value_to_register_ftype
*value_to_register
;
192 gdbarch_value_from_register_ftype
*value_from_register
;
193 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
194 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
195 gdbarch_integer_to_address_ftype
*integer_to_address
;
196 gdbarch_return_value_ftype
*return_value
;
197 gdbarch_skip_prologue_ftype
*skip_prologue
;
198 gdbarch_skip_main_prologue_ftype
*skip_main_prologue
;
199 gdbarch_inner_than_ftype
*inner_than
;
200 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
201 gdbarch_remote_breakpoint_from_pc_ftype
*remote_breakpoint_from_pc
;
202 gdbarch_adjust_breakpoint_address_ftype
*adjust_breakpoint_address
;
203 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
204 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
205 CORE_ADDR decr_pc_after_break
;
206 CORE_ADDR deprecated_function_start_offset
;
207 gdbarch_remote_register_number_ftype
*remote_register_number
;
208 gdbarch_fetch_tls_load_module_address_ftype
*fetch_tls_load_module_address
;
209 CORE_ADDR frame_args_skip
;
210 gdbarch_unwind_pc_ftype
*unwind_pc
;
211 gdbarch_unwind_sp_ftype
*unwind_sp
;
212 gdbarch_frame_num_args_ftype
*frame_num_args
;
213 gdbarch_frame_align_ftype
*frame_align
;
214 gdbarch_stabs_argument_has_addr_ftype
*stabs_argument_has_addr
;
215 int frame_red_zone_size
;
216 gdbarch_convert_from_func_ptr_addr_ftype
*convert_from_func_ptr_addr
;
217 gdbarch_addr_bits_remove_ftype
*addr_bits_remove
;
218 gdbarch_smash_text_address_ftype
*smash_text_address
;
219 gdbarch_software_single_step_ftype
*software_single_step
;
220 gdbarch_single_step_through_delay_ftype
*single_step_through_delay
;
221 gdbarch_print_insn_ftype
*print_insn
;
222 gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
;
223 gdbarch_skip_solib_resolver_ftype
*skip_solib_resolver
;
224 gdbarch_in_solib_return_trampoline_ftype
*in_solib_return_trampoline
;
225 gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
;
226 gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
;
227 gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
;
228 int cannot_step_breakpoint
;
229 int have_nonsteppable_watchpoint
;
230 gdbarch_address_class_type_flags_ftype
*address_class_type_flags
;
231 gdbarch_address_class_type_flags_to_name_ftype
*address_class_type_flags_to_name
;
232 gdbarch_address_class_name_to_type_flags_ftype
*address_class_name_to_type_flags
;
233 gdbarch_register_reggroup_p_ftype
*register_reggroup_p
;
234 gdbarch_fetch_pointer_argument_ftype
*fetch_pointer_argument
;
235 gdbarch_regset_from_core_section_ftype
*regset_from_core_section
;
236 int core_reg_section_encodes_pid
;
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 */
311 legacy_virtual_frame_pointer
, /* virtual_frame_pointer */
312 0, /* pseudo_register_read */
313 0, /* pseudo_register_write */
315 0, /* num_pseudo_regs */
320 no_op_reg_to_regnum
, /* stab_reg_to_regnum */
321 no_op_reg_to_regnum
, /* ecoff_reg_to_regnum */
322 no_op_reg_to_regnum
, /* sdb_reg_to_regnum */
323 no_op_reg_to_regnum
, /* dwarf2_reg_to_regnum */
324 0, /* register_name */
325 0, /* register_type */
327 -1, /* deprecated_fp_regnum */
328 0, /* push_dummy_call */
329 0, /* call_dummy_location */
330 0, /* push_dummy_code */
331 default_print_registers_info
, /* print_registers_info */
332 0, /* print_float_info */
333 0, /* print_vector_info */
334 legacy_register_sim_regno
, /* register_sim_regno */
335 cannot_register_not
, /* cannot_fetch_register */
336 cannot_register_not
, /* cannot_store_register */
337 0, /* get_longjmp_target */
338 0, /* believe_pcc_promotion */
339 generic_convert_register_p
, /* convert_register_p */
340 0, /* register_to_value */
341 0, /* value_to_register */
342 0, /* value_from_register */
343 unsigned_pointer_to_address
, /* pointer_to_address */
344 unsigned_address_to_pointer
, /* address_to_pointer */
345 0, /* integer_to_address */
346 0, /* return_value */
347 0, /* skip_prologue */
348 0, /* skip_main_prologue */
350 0, /* breakpoint_from_pc */
351 default_remote_breakpoint_from_pc
, /* remote_breakpoint_from_pc */
352 0, /* adjust_breakpoint_address */
353 default_memory_insert_breakpoint
, /* memory_insert_breakpoint */
354 default_memory_remove_breakpoint
, /* memory_remove_breakpoint */
355 0, /* decr_pc_after_break */
356 0, /* deprecated_function_start_offset */
357 default_remote_register_number
, /* remote_register_number */
358 0, /* fetch_tls_load_module_address */
359 0, /* frame_args_skip */
362 0, /* frame_num_args */
364 default_stabs_argument_has_addr
, /* stabs_argument_has_addr */
365 0, /* frame_red_zone_size */
366 convert_from_func_ptr_addr_identity
, /* convert_from_func_ptr_addr */
367 core_addr_identity
, /* addr_bits_remove */
368 core_addr_identity
, /* smash_text_address */
369 0, /* software_single_step */
370 0, /* single_step_through_delay */
372 0, /* skip_trampoline_code */
373 generic_skip_solib_resolver
, /* skip_solib_resolver */
374 generic_in_solib_return_trampoline
, /* in_solib_return_trampoline */
375 generic_in_function_epilogue_p
, /* in_function_epilogue_p */
376 0, /* elf_make_msymbol_special */
377 0, /* coff_make_msymbol_special */
378 0, /* cannot_step_breakpoint */
379 0, /* have_nonsteppable_watchpoint */
380 0, /* address_class_type_flags */
381 0, /* address_class_type_flags_to_name */
382 0, /* address_class_name_to_type_flags */
383 default_register_reggroup_p
, /* register_reggroup_p */
384 0, /* fetch_pointer_argument */
385 0, /* regset_from_core_section */
386 0, /* core_reg_section_encodes_pid */
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
->char_signed
== -1)
586 gdbarch
->char_signed
= 1;
587 /* Skip verify of read_pc, has predicate */
588 /* Skip verify of write_pc, has predicate */
589 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
590 /* Skip verify of pseudo_register_read, has predicate */
591 /* Skip verify of pseudo_register_write, has predicate */
592 if (gdbarch
->num_regs
== -1)
593 fprintf_unfiltered (log
, "\n\tnum_regs");
594 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
595 /* Skip verify of sp_regnum, invalid_p == 0 */
596 /* Skip verify of pc_regnum, invalid_p == 0 */
597 /* Skip verify of ps_regnum, invalid_p == 0 */
598 /* Skip verify of fp0_regnum, invalid_p == 0 */
599 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
600 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
601 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
602 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
603 if (gdbarch
->register_name
== 0)
604 fprintf_unfiltered (log
, "\n\tregister_name");
605 /* Skip verify of register_type, has predicate */
606 /* Skip verify of dummy_id, has predicate */
607 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
608 /* Skip verify of push_dummy_call, has predicate */
609 /* Skip verify of call_dummy_location, invalid_p == 0 */
610 /* Skip verify of push_dummy_code, has predicate */
611 /* Skip verify of print_registers_info, invalid_p == 0 */
612 /* Skip verify of print_float_info, has predicate */
613 /* Skip verify of print_vector_info, has predicate */
614 /* Skip verify of register_sim_regno, invalid_p == 0 */
615 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
616 /* Skip verify of cannot_store_register, invalid_p == 0 */
617 /* Skip verify of get_longjmp_target, has predicate */
618 /* Skip verify of convert_register_p, invalid_p == 0 */
619 /* Skip verify of value_from_register, invalid_p == 0 */
620 /* Skip verify of pointer_to_address, invalid_p == 0 */
621 /* Skip verify of address_to_pointer, invalid_p == 0 */
622 /* Skip verify of integer_to_address, has predicate */
623 /* Skip verify of return_value, has predicate */
624 if (gdbarch
->skip_prologue
== 0)
625 fprintf_unfiltered (log
, "\n\tskip_prologue");
626 /* Skip verify of skip_main_prologue, has predicate */
627 if (gdbarch
->inner_than
== 0)
628 fprintf_unfiltered (log
, "\n\tinner_than");
629 if (gdbarch
->breakpoint_from_pc
== 0)
630 fprintf_unfiltered (log
, "\n\tbreakpoint_from_pc");
631 /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
632 /* Skip verify of adjust_breakpoint_address, has predicate */
633 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
634 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
635 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
636 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
637 /* Skip verify of remote_register_number, invalid_p == 0 */
638 /* Skip verify of fetch_tls_load_module_address, has predicate */
639 /* Skip verify of frame_args_skip, invalid_p == 0 */
640 /* Skip verify of unwind_pc, has predicate */
641 /* Skip verify of unwind_sp, has predicate */
642 /* Skip verify of frame_num_args, has predicate */
643 /* Skip verify of frame_align, has predicate */
644 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
645 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
646 /* Skip verify of addr_bits_remove, invalid_p == 0 */
647 /* Skip verify of smash_text_address, invalid_p == 0 */
648 /* Skip verify of software_single_step, has predicate */
649 /* Skip verify of single_step_through_delay, has predicate */
650 if (gdbarch
->print_insn
== 0)
651 fprintf_unfiltered (log
, "\n\tprint_insn");
652 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
653 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
654 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
655 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
656 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
657 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
658 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
659 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
660 /* Skip verify of address_class_type_flags, has predicate */
661 /* Skip verify of address_class_type_flags_to_name, has predicate */
662 /* Skip verify of address_class_name_to_type_flags, has predicate */
663 /* Skip verify of register_reggroup_p, invalid_p == 0 */
664 /* Skip verify of fetch_pointer_argument, has predicate */
665 /* Skip verify of regset_from_core_section, has predicate */
666 /* Skip verify of core_reg_section_encodes_pid, invalid_p == 0 */
667 /* Skip verify of core_xfer_shared_libraries, has predicate */
668 /* Skip verify of core_pid_to_str, has predicate */
669 /* Skip verify of gcore_bfd_target, has predicate */
670 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
671 /* Skip verify of vbit_in_delta, invalid_p == 0 */
672 /* Skip verify of skip_permanent_breakpoint, has predicate */
673 /* Skip verify of max_insn_length, has predicate */
674 /* Skip verify of displaced_step_copy_insn, has predicate */
675 /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
676 /* Skip verify of displaced_step_fixup, has predicate */
677 if ((! gdbarch
->displaced_step_free_closure
) != (! gdbarch
->displaced_step_copy_insn
))
678 fprintf_unfiltered (log
, "\n\tdisplaced_step_free_closure");
679 if ((! gdbarch
->displaced_step_location
) != (! gdbarch
->displaced_step_copy_insn
))
680 fprintf_unfiltered (log
, "\n\tdisplaced_step_location");
681 /* Skip verify of relocate_instruction, has predicate */
682 /* Skip verify of overlay_update, has predicate */
683 /* Skip verify of core_read_description, has predicate */
684 /* Skip verify of static_transform_name, has predicate */
685 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
686 /* Skip verify of process_record, has predicate */
687 /* Skip verify of process_record_signal, has predicate */
688 /* Skip verify of target_signal_from_host, invalid_p == 0 */
689 /* Skip verify of target_signal_to_host, invalid_p == 0 */
690 /* Skip verify of get_siginfo_type, has predicate */
691 /* Skip verify of record_special_symbol, has predicate */
692 /* Skip verify of get_syscall_number, has predicate */
693 /* Skip verify of has_global_solist, invalid_p == 0 */
694 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
695 /* Skip verify of has_shared_address_space, invalid_p == 0 */
696 /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
697 /* Skip verify of auto_charset, invalid_p == 0 */
698 /* Skip verify of auto_wide_charset, invalid_p == 0 */
699 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
700 buf
= ui_file_xstrdup (log
, &length
);
701 make_cleanup (xfree
, buf
);
703 internal_error (__FILE__
, __LINE__
,
704 _("verify_gdbarch: the following are invalid ...%s"),
706 do_cleanups (cleanups
);
710 /* Print out the details of the current architecture. */
713 gdbarch_dump (struct gdbarch
*gdbarch
, struct ui_file
*file
)
715 const char *gdb_nm_file
= "<not-defined>";
717 #if defined (GDB_NM_FILE)
718 gdb_nm_file
= GDB_NM_FILE
;
720 fprintf_unfiltered (file
,
721 "gdbarch_dump: GDB_NM_FILE = %s\n",
723 fprintf_unfiltered (file
,
724 "gdbarch_dump: addr_bit = %s\n",
725 plongest (gdbarch
->addr_bit
));
726 fprintf_unfiltered (file
,
727 "gdbarch_dump: addr_bits_remove = <%s>\n",
728 host_address_to_string (gdbarch
->addr_bits_remove
));
729 fprintf_unfiltered (file
,
730 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
731 gdbarch_address_class_name_to_type_flags_p (gdbarch
));
732 fprintf_unfiltered (file
,
733 "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
734 host_address_to_string (gdbarch
->address_class_name_to_type_flags
));
735 fprintf_unfiltered (file
,
736 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
737 gdbarch_address_class_type_flags_p (gdbarch
));
738 fprintf_unfiltered (file
,
739 "gdbarch_dump: address_class_type_flags = <%s>\n",
740 host_address_to_string (gdbarch
->address_class_type_flags
));
741 fprintf_unfiltered (file
,
742 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
743 gdbarch_address_class_type_flags_to_name_p (gdbarch
));
744 fprintf_unfiltered (file
,
745 "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
746 host_address_to_string (gdbarch
->address_class_type_flags_to_name
));
747 fprintf_unfiltered (file
,
748 "gdbarch_dump: address_to_pointer = <%s>\n",
749 host_address_to_string (gdbarch
->address_to_pointer
));
750 fprintf_unfiltered (file
,
751 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
752 gdbarch_adjust_breakpoint_address_p (gdbarch
));
753 fprintf_unfiltered (file
,
754 "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
755 host_address_to_string (gdbarch
->adjust_breakpoint_address
));
756 fprintf_unfiltered (file
,
757 "gdbarch_dump: auto_charset = <%s>\n",
758 host_address_to_string (gdbarch
->auto_charset
));
759 fprintf_unfiltered (file
,
760 "gdbarch_dump: auto_wide_charset = <%s>\n",
761 host_address_to_string (gdbarch
->auto_wide_charset
));
762 fprintf_unfiltered (file
,
763 "gdbarch_dump: believe_pcc_promotion = %s\n",
764 plongest (gdbarch
->believe_pcc_promotion
));
765 fprintf_unfiltered (file
,
766 "gdbarch_dump: bfd_arch_info = %s\n",
767 gdbarch_bfd_arch_info (gdbarch
)->printable_name
);
768 fprintf_unfiltered (file
,
769 "gdbarch_dump: bits_big_endian = %s\n",
770 plongest (gdbarch
->bits_big_endian
));
771 fprintf_unfiltered (file
,
772 "gdbarch_dump: breakpoint_from_pc = <%s>\n",
773 host_address_to_string (gdbarch
->breakpoint_from_pc
));
774 fprintf_unfiltered (file
,
775 "gdbarch_dump: byte_order = %s\n",
776 plongest (gdbarch
->byte_order
));
777 fprintf_unfiltered (file
,
778 "gdbarch_dump: byte_order_for_code = %s\n",
779 plongest (gdbarch
->byte_order_for_code
));
780 fprintf_unfiltered (file
,
781 "gdbarch_dump: call_dummy_location = %s\n",
782 plongest (gdbarch
->call_dummy_location
));
783 fprintf_unfiltered (file
,
784 "gdbarch_dump: cannot_fetch_register = <%s>\n",
785 host_address_to_string (gdbarch
->cannot_fetch_register
));
786 fprintf_unfiltered (file
,
787 "gdbarch_dump: cannot_step_breakpoint = %s\n",
788 plongest (gdbarch
->cannot_step_breakpoint
));
789 fprintf_unfiltered (file
,
790 "gdbarch_dump: cannot_store_register = <%s>\n",
791 host_address_to_string (gdbarch
->cannot_store_register
));
792 fprintf_unfiltered (file
,
793 "gdbarch_dump: char_signed = %s\n",
794 plongest (gdbarch
->char_signed
));
795 fprintf_unfiltered (file
,
796 "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
797 host_address_to_string (gdbarch
->coff_make_msymbol_special
));
798 fprintf_unfiltered (file
,
799 "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
800 host_address_to_string (gdbarch
->convert_from_func_ptr_addr
));
801 fprintf_unfiltered (file
,
802 "gdbarch_dump: convert_register_p = <%s>\n",
803 host_address_to_string (gdbarch
->convert_register_p
));
804 fprintf_unfiltered (file
,
805 "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
806 gdbarch_core_pid_to_str_p (gdbarch
));
807 fprintf_unfiltered (file
,
808 "gdbarch_dump: core_pid_to_str = <%s>\n",
809 host_address_to_string (gdbarch
->core_pid_to_str
));
810 fprintf_unfiltered (file
,
811 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
812 gdbarch_core_read_description_p (gdbarch
));
813 fprintf_unfiltered (file
,
814 "gdbarch_dump: core_read_description = <%s>\n",
815 host_address_to_string (gdbarch
->core_read_description
));
816 fprintf_unfiltered (file
,
817 "gdbarch_dump: core_reg_section_encodes_pid = %s\n",
818 plongest (gdbarch
->core_reg_section_encodes_pid
));
819 fprintf_unfiltered (file
,
820 "gdbarch_dump: core_regset_sections = %s\n",
821 host_address_to_string (gdbarch
->core_regset_sections
));
822 fprintf_unfiltered (file
,
823 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
824 gdbarch_core_xfer_shared_libraries_p (gdbarch
));
825 fprintf_unfiltered (file
,
826 "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
827 host_address_to_string (gdbarch
->core_xfer_shared_libraries
));
828 fprintf_unfiltered (file
,
829 "gdbarch_dump: decr_pc_after_break = %s\n",
830 core_addr_to_string_nz (gdbarch
->decr_pc_after_break
));
831 fprintf_unfiltered (file
,
832 "gdbarch_dump: deprecated_fp_regnum = %s\n",
833 plongest (gdbarch
->deprecated_fp_regnum
));
834 fprintf_unfiltered (file
,
835 "gdbarch_dump: deprecated_function_start_offset = %s\n",
836 core_addr_to_string_nz (gdbarch
->deprecated_function_start_offset
));
837 fprintf_unfiltered (file
,
838 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
839 gdbarch_displaced_step_copy_insn_p (gdbarch
));
840 fprintf_unfiltered (file
,
841 "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
842 host_address_to_string (gdbarch
->displaced_step_copy_insn
));
843 fprintf_unfiltered (file
,
844 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
845 gdbarch_displaced_step_fixup_p (gdbarch
));
846 fprintf_unfiltered (file
,
847 "gdbarch_dump: displaced_step_fixup = <%s>\n",
848 host_address_to_string (gdbarch
->displaced_step_fixup
));
849 fprintf_unfiltered (file
,
850 "gdbarch_dump: displaced_step_free_closure = <%s>\n",
851 host_address_to_string (gdbarch
->displaced_step_free_closure
));
852 fprintf_unfiltered (file
,
853 "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
854 host_address_to_string (gdbarch
->displaced_step_hw_singlestep
));
855 fprintf_unfiltered (file
,
856 "gdbarch_dump: displaced_step_location = <%s>\n",
857 host_address_to_string (gdbarch
->displaced_step_location
));
858 fprintf_unfiltered (file
,
859 "gdbarch_dump: double_bit = %s\n",
860 plongest (gdbarch
->double_bit
));
861 fprintf_unfiltered (file
,
862 "gdbarch_dump: double_format = %s\n",
863 pformat (gdbarch
->double_format
));
864 fprintf_unfiltered (file
,
865 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
866 gdbarch_dummy_id_p (gdbarch
));
867 fprintf_unfiltered (file
,
868 "gdbarch_dump: dummy_id = <%s>\n",
869 host_address_to_string (gdbarch
->dummy_id
));
870 fprintf_unfiltered (file
,
871 "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
872 host_address_to_string (gdbarch
->dwarf2_reg_to_regnum
));
873 fprintf_unfiltered (file
,
874 "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
875 host_address_to_string (gdbarch
->ecoff_reg_to_regnum
));
876 fprintf_unfiltered (file
,
877 "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
878 host_address_to_string (gdbarch
->elf_make_msymbol_special
));
879 fprintf_unfiltered (file
,
880 "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
881 host_address_to_string (gdbarch
->fast_tracepoint_valid_at
));
882 fprintf_unfiltered (file
,
883 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
884 gdbarch_fetch_pointer_argument_p (gdbarch
));
885 fprintf_unfiltered (file
,
886 "gdbarch_dump: fetch_pointer_argument = <%s>\n",
887 host_address_to_string (gdbarch
->fetch_pointer_argument
));
888 fprintf_unfiltered (file
,
889 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
890 gdbarch_fetch_tls_load_module_address_p (gdbarch
));
891 fprintf_unfiltered (file
,
892 "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
893 host_address_to_string (gdbarch
->fetch_tls_load_module_address
));
894 fprintf_unfiltered (file
,
895 "gdbarch_dump: float_bit = %s\n",
896 plongest (gdbarch
->float_bit
));
897 fprintf_unfiltered (file
,
898 "gdbarch_dump: float_format = %s\n",
899 pformat (gdbarch
->float_format
));
900 fprintf_unfiltered (file
,
901 "gdbarch_dump: fp0_regnum = %s\n",
902 plongest (gdbarch
->fp0_regnum
));
903 fprintf_unfiltered (file
,
904 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
905 gdbarch_frame_align_p (gdbarch
));
906 fprintf_unfiltered (file
,
907 "gdbarch_dump: frame_align = <%s>\n",
908 host_address_to_string (gdbarch
->frame_align
));
909 fprintf_unfiltered (file
,
910 "gdbarch_dump: frame_args_skip = %s\n",
911 core_addr_to_string_nz (gdbarch
->frame_args_skip
));
912 fprintf_unfiltered (file
,
913 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
914 gdbarch_frame_num_args_p (gdbarch
));
915 fprintf_unfiltered (file
,
916 "gdbarch_dump: frame_num_args = <%s>\n",
917 host_address_to_string (gdbarch
->frame_num_args
));
918 fprintf_unfiltered (file
,
919 "gdbarch_dump: frame_red_zone_size = %s\n",
920 plongest (gdbarch
->frame_red_zone_size
));
921 fprintf_unfiltered (file
,
922 "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
923 gdbarch_gcore_bfd_target_p (gdbarch
));
924 fprintf_unfiltered (file
,
925 "gdbarch_dump: gcore_bfd_target = %s\n",
926 gdbarch
->gcore_bfd_target
);
927 fprintf_unfiltered (file
,
928 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
929 gdbarch_get_longjmp_target_p (gdbarch
));
930 fprintf_unfiltered (file
,
931 "gdbarch_dump: get_longjmp_target = <%s>\n",
932 host_address_to_string (gdbarch
->get_longjmp_target
));
933 fprintf_unfiltered (file
,
934 "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
935 gdbarch_get_siginfo_type_p (gdbarch
));
936 fprintf_unfiltered (file
,
937 "gdbarch_dump: get_siginfo_type = <%s>\n",
938 host_address_to_string (gdbarch
->get_siginfo_type
));
939 fprintf_unfiltered (file
,
940 "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
941 gdbarch_get_syscall_number_p (gdbarch
));
942 fprintf_unfiltered (file
,
943 "gdbarch_dump: get_syscall_number = <%s>\n",
944 host_address_to_string (gdbarch
->get_syscall_number
));
945 fprintf_unfiltered (file
,
946 "gdbarch_dump: half_bit = %s\n",
947 plongest (gdbarch
->half_bit
));
948 fprintf_unfiltered (file
,
949 "gdbarch_dump: half_format = %s\n",
950 pformat (gdbarch
->half_format
));
951 fprintf_unfiltered (file
,
952 "gdbarch_dump: has_dos_based_file_system = %s\n",
953 plongest (gdbarch
->has_dos_based_file_system
));
954 fprintf_unfiltered (file
,
955 "gdbarch_dump: has_global_breakpoints = %s\n",
956 plongest (gdbarch
->has_global_breakpoints
));
957 fprintf_unfiltered (file
,
958 "gdbarch_dump: has_global_solist = %s\n",
959 plongest (gdbarch
->has_global_solist
));
960 fprintf_unfiltered (file
,
961 "gdbarch_dump: has_shared_address_space = <%s>\n",
962 host_address_to_string (gdbarch
->has_shared_address_space
));
963 fprintf_unfiltered (file
,
964 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
965 plongest (gdbarch
->have_nonsteppable_watchpoint
));
966 fprintf_unfiltered (file
,
967 "gdbarch_dump: in_function_epilogue_p = <%s>\n",
968 host_address_to_string (gdbarch
->in_function_epilogue_p
));
969 fprintf_unfiltered (file
,
970 "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
971 host_address_to_string (gdbarch
->in_solib_return_trampoline
));
972 fprintf_unfiltered (file
,
973 "gdbarch_dump: inner_than = <%s>\n",
974 host_address_to_string (gdbarch
->inner_than
));
975 fprintf_unfiltered (file
,
976 "gdbarch_dump: int_bit = %s\n",
977 plongest (gdbarch
->int_bit
));
978 fprintf_unfiltered (file
,
979 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
980 gdbarch_integer_to_address_p (gdbarch
));
981 fprintf_unfiltered (file
,
982 "gdbarch_dump: integer_to_address = <%s>\n",
983 host_address_to_string (gdbarch
->integer_to_address
));
984 fprintf_unfiltered (file
,
985 "gdbarch_dump: long_bit = %s\n",
986 plongest (gdbarch
->long_bit
));
987 fprintf_unfiltered (file
,
988 "gdbarch_dump: long_double_bit = %s\n",
989 plongest (gdbarch
->long_double_bit
));
990 fprintf_unfiltered (file
,
991 "gdbarch_dump: long_double_format = %s\n",
992 pformat (gdbarch
->long_double_format
));
993 fprintf_unfiltered (file
,
994 "gdbarch_dump: long_long_bit = %s\n",
995 plongest (gdbarch
->long_long_bit
));
996 fprintf_unfiltered (file
,
997 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
998 gdbarch_max_insn_length_p (gdbarch
));
999 fprintf_unfiltered (file
,
1000 "gdbarch_dump: max_insn_length = %s\n",
1001 plongest (gdbarch
->max_insn_length
));
1002 fprintf_unfiltered (file
,
1003 "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
1004 host_address_to_string (gdbarch
->memory_insert_breakpoint
));
1005 fprintf_unfiltered (file
,
1006 "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
1007 host_address_to_string (gdbarch
->memory_remove_breakpoint
));
1008 fprintf_unfiltered (file
,
1009 "gdbarch_dump: num_pseudo_regs = %s\n",
1010 plongest (gdbarch
->num_pseudo_regs
));
1011 fprintf_unfiltered (file
,
1012 "gdbarch_dump: num_regs = %s\n",
1013 plongest (gdbarch
->num_regs
));
1014 fprintf_unfiltered (file
,
1015 "gdbarch_dump: osabi = %s\n",
1016 plongest (gdbarch
->osabi
));
1017 fprintf_unfiltered (file
,
1018 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
1019 gdbarch_overlay_update_p (gdbarch
));
1020 fprintf_unfiltered (file
,
1021 "gdbarch_dump: overlay_update = <%s>\n",
1022 host_address_to_string (gdbarch
->overlay_update
));
1023 fprintf_unfiltered (file
,
1024 "gdbarch_dump: pc_regnum = %s\n",
1025 plongest (gdbarch
->pc_regnum
));
1026 fprintf_unfiltered (file
,
1027 "gdbarch_dump: pointer_to_address = <%s>\n",
1028 host_address_to_string (gdbarch
->pointer_to_address
));
1029 fprintf_unfiltered (file
,
1030 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1031 gdbarch_print_float_info_p (gdbarch
));
1032 fprintf_unfiltered (file
,
1033 "gdbarch_dump: print_float_info = <%s>\n",
1034 host_address_to_string (gdbarch
->print_float_info
));
1035 fprintf_unfiltered (file
,
1036 "gdbarch_dump: print_insn = <%s>\n",
1037 host_address_to_string (gdbarch
->print_insn
));
1038 fprintf_unfiltered (file
,
1039 "gdbarch_dump: print_registers_info = <%s>\n",
1040 host_address_to_string (gdbarch
->print_registers_info
));
1041 fprintf_unfiltered (file
,
1042 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1043 gdbarch_print_vector_info_p (gdbarch
));
1044 fprintf_unfiltered (file
,
1045 "gdbarch_dump: print_vector_info = <%s>\n",
1046 host_address_to_string (gdbarch
->print_vector_info
));
1047 fprintf_unfiltered (file
,
1048 "gdbarch_dump: gdbarch_process_record_p() = %d\n",
1049 gdbarch_process_record_p (gdbarch
));
1050 fprintf_unfiltered (file
,
1051 "gdbarch_dump: process_record = <%s>\n",
1052 host_address_to_string (gdbarch
->process_record
));
1053 fprintf_unfiltered (file
,
1054 "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
1055 gdbarch_process_record_signal_p (gdbarch
));
1056 fprintf_unfiltered (file
,
1057 "gdbarch_dump: process_record_signal = <%s>\n",
1058 host_address_to_string (gdbarch
->process_record_signal
));
1059 fprintf_unfiltered (file
,
1060 "gdbarch_dump: ps_regnum = %s\n",
1061 plongest (gdbarch
->ps_regnum
));
1062 fprintf_unfiltered (file
,
1063 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1064 gdbarch_pseudo_register_read_p (gdbarch
));
1065 fprintf_unfiltered (file
,
1066 "gdbarch_dump: pseudo_register_read = <%s>\n",
1067 host_address_to_string (gdbarch
->pseudo_register_read
));
1068 fprintf_unfiltered (file
,
1069 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1070 gdbarch_pseudo_register_write_p (gdbarch
));
1071 fprintf_unfiltered (file
,
1072 "gdbarch_dump: pseudo_register_write = <%s>\n",
1073 host_address_to_string (gdbarch
->pseudo_register_write
));
1074 fprintf_unfiltered (file
,
1075 "gdbarch_dump: ptr_bit = %s\n",
1076 plongest (gdbarch
->ptr_bit
));
1077 fprintf_unfiltered (file
,
1078 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1079 gdbarch_push_dummy_call_p (gdbarch
));
1080 fprintf_unfiltered (file
,
1081 "gdbarch_dump: push_dummy_call = <%s>\n",
1082 host_address_to_string (gdbarch
->push_dummy_call
));
1083 fprintf_unfiltered (file
,
1084 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1085 gdbarch_push_dummy_code_p (gdbarch
));
1086 fprintf_unfiltered (file
,
1087 "gdbarch_dump: push_dummy_code = <%s>\n",
1088 host_address_to_string (gdbarch
->push_dummy_code
));
1089 fprintf_unfiltered (file
,
1090 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1091 gdbarch_read_pc_p (gdbarch
));
1092 fprintf_unfiltered (file
,
1093 "gdbarch_dump: read_pc = <%s>\n",
1094 host_address_to_string (gdbarch
->read_pc
));
1095 fprintf_unfiltered (file
,
1096 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
1097 gdbarch_record_special_symbol_p (gdbarch
));
1098 fprintf_unfiltered (file
,
1099 "gdbarch_dump: record_special_symbol = <%s>\n",
1100 host_address_to_string (gdbarch
->record_special_symbol
));
1101 fprintf_unfiltered (file
,
1102 "gdbarch_dump: register_name = <%s>\n",
1103 host_address_to_string (gdbarch
->register_name
));
1104 fprintf_unfiltered (file
,
1105 "gdbarch_dump: register_reggroup_p = <%s>\n",
1106 host_address_to_string (gdbarch
->register_reggroup_p
));
1107 fprintf_unfiltered (file
,
1108 "gdbarch_dump: register_sim_regno = <%s>\n",
1109 host_address_to_string (gdbarch
->register_sim_regno
));
1110 fprintf_unfiltered (file
,
1111 "gdbarch_dump: register_to_value = <%s>\n",
1112 host_address_to_string (gdbarch
->register_to_value
));
1113 fprintf_unfiltered (file
,
1114 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1115 gdbarch_register_type_p (gdbarch
));
1116 fprintf_unfiltered (file
,
1117 "gdbarch_dump: register_type = <%s>\n",
1118 host_address_to_string (gdbarch
->register_type
));
1119 fprintf_unfiltered (file
,
1120 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1121 gdbarch_regset_from_core_section_p (gdbarch
));
1122 fprintf_unfiltered (file
,
1123 "gdbarch_dump: regset_from_core_section = <%s>\n",
1124 host_address_to_string (gdbarch
->regset_from_core_section
));
1125 fprintf_unfiltered (file
,
1126 "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n",
1127 gdbarch_relocate_instruction_p (gdbarch
));
1128 fprintf_unfiltered (file
,
1129 "gdbarch_dump: relocate_instruction = <%s>\n",
1130 host_address_to_string (gdbarch
->relocate_instruction
));
1131 fprintf_unfiltered (file
,
1132 "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
1133 host_address_to_string (gdbarch
->remote_breakpoint_from_pc
));
1134 fprintf_unfiltered (file
,
1135 "gdbarch_dump: remote_register_number = <%s>\n",
1136 host_address_to_string (gdbarch
->remote_register_number
));
1137 fprintf_unfiltered (file
,
1138 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1139 gdbarch_return_value_p (gdbarch
));
1140 fprintf_unfiltered (file
,
1141 "gdbarch_dump: return_value = <%s>\n",
1142 host_address_to_string (gdbarch
->return_value
));
1143 fprintf_unfiltered (file
,
1144 "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
1145 host_address_to_string (gdbarch
->sdb_reg_to_regnum
));
1146 fprintf_unfiltered (file
,
1147 "gdbarch_dump: short_bit = %s\n",
1148 plongest (gdbarch
->short_bit
));
1149 fprintf_unfiltered (file
,
1150 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1151 gdbarch_single_step_through_delay_p (gdbarch
));
1152 fprintf_unfiltered (file
,
1153 "gdbarch_dump: single_step_through_delay = <%s>\n",
1154 host_address_to_string (gdbarch
->single_step_through_delay
));
1155 fprintf_unfiltered (file
,
1156 "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
1157 gdbarch_skip_main_prologue_p (gdbarch
));
1158 fprintf_unfiltered (file
,
1159 "gdbarch_dump: skip_main_prologue = <%s>\n",
1160 host_address_to_string (gdbarch
->skip_main_prologue
));
1161 fprintf_unfiltered (file
,
1162 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1163 gdbarch_skip_permanent_breakpoint_p (gdbarch
));
1164 fprintf_unfiltered (file
,
1165 "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
1166 host_address_to_string (gdbarch
->skip_permanent_breakpoint
));
1167 fprintf_unfiltered (file
,
1168 "gdbarch_dump: skip_prologue = <%s>\n",
1169 host_address_to_string (gdbarch
->skip_prologue
));
1170 fprintf_unfiltered (file
,
1171 "gdbarch_dump: skip_solib_resolver = <%s>\n",
1172 host_address_to_string (gdbarch
->skip_solib_resolver
));
1173 fprintf_unfiltered (file
,
1174 "gdbarch_dump: skip_trampoline_code = <%s>\n",
1175 host_address_to_string (gdbarch
->skip_trampoline_code
));
1176 fprintf_unfiltered (file
,
1177 "gdbarch_dump: smash_text_address = <%s>\n",
1178 host_address_to_string (gdbarch
->smash_text_address
));
1179 fprintf_unfiltered (file
,
1180 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1181 gdbarch_software_single_step_p (gdbarch
));
1182 fprintf_unfiltered (file
,
1183 "gdbarch_dump: software_single_step = <%s>\n",
1184 host_address_to_string (gdbarch
->software_single_step
));
1185 fprintf_unfiltered (file
,
1186 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1187 plongest (gdbarch
->sofun_address_maybe_missing
));
1188 fprintf_unfiltered (file
,
1189 "gdbarch_dump: solib_symbols_extension = %s\n",
1190 pstring (gdbarch
->solib_symbols_extension
));
1191 fprintf_unfiltered (file
,
1192 "gdbarch_dump: sp_regnum = %s\n",
1193 plongest (gdbarch
->sp_regnum
));
1194 fprintf_unfiltered (file
,
1195 "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
1196 host_address_to_string (gdbarch
->stab_reg_to_regnum
));
1197 fprintf_unfiltered (file
,
1198 "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
1199 host_address_to_string (gdbarch
->stabs_argument_has_addr
));
1200 fprintf_unfiltered (file
,
1201 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1202 gdbarch_static_transform_name_p (gdbarch
));
1203 fprintf_unfiltered (file
,
1204 "gdbarch_dump: static_transform_name = <%s>\n",
1205 host_address_to_string (gdbarch
->static_transform_name
));
1206 fprintf_unfiltered (file
,
1207 "gdbarch_dump: target_desc = %s\n",
1208 host_address_to_string (gdbarch
->target_desc
));
1209 fprintf_unfiltered (file
,
1210 "gdbarch_dump: target_signal_from_host = <%s>\n",
1211 host_address_to_string (gdbarch
->target_signal_from_host
));
1212 fprintf_unfiltered (file
,
1213 "gdbarch_dump: target_signal_to_host = <%s>\n",
1214 host_address_to_string (gdbarch
->target_signal_to_host
));
1215 fprintf_unfiltered (file
,
1216 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1217 gdbarch_unwind_pc_p (gdbarch
));
1218 fprintf_unfiltered (file
,
1219 "gdbarch_dump: unwind_pc = <%s>\n",
1220 host_address_to_string (gdbarch
->unwind_pc
));
1221 fprintf_unfiltered (file
,
1222 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1223 gdbarch_unwind_sp_p (gdbarch
));
1224 fprintf_unfiltered (file
,
1225 "gdbarch_dump: unwind_sp = <%s>\n",
1226 host_address_to_string (gdbarch
->unwind_sp
));
1227 fprintf_unfiltered (file
,
1228 "gdbarch_dump: value_from_register = <%s>\n",
1229 host_address_to_string (gdbarch
->value_from_register
));
1230 fprintf_unfiltered (file
,
1231 "gdbarch_dump: value_to_register = <%s>\n",
1232 host_address_to_string (gdbarch
->value_to_register
));
1233 fprintf_unfiltered (file
,
1234 "gdbarch_dump: vbit_in_delta = %s\n",
1235 plongest (gdbarch
->vbit_in_delta
));
1236 fprintf_unfiltered (file
,
1237 "gdbarch_dump: virtual_frame_pointer = <%s>\n",
1238 host_address_to_string (gdbarch
->virtual_frame_pointer
));
1239 fprintf_unfiltered (file
,
1240 "gdbarch_dump: vtable_function_descriptors = %s\n",
1241 plongest (gdbarch
->vtable_function_descriptors
));
1242 fprintf_unfiltered (file
,
1243 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1244 gdbarch_write_pc_p (gdbarch
));
1245 fprintf_unfiltered (file
,
1246 "gdbarch_dump: write_pc = <%s>\n",
1247 host_address_to_string (gdbarch
->write_pc
));
1248 if (gdbarch
->dump_tdep
!= NULL
)
1249 gdbarch
->dump_tdep (gdbarch
, file
);
1252 struct gdbarch_tdep
*
1253 gdbarch_tdep (struct gdbarch
*gdbarch
)
1255 if (gdbarch_debug
>= 2)
1256 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1257 return gdbarch
->tdep
;
1261 const struct bfd_arch_info
*
1262 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1264 gdb_assert (gdbarch
!= NULL
);
1265 if (gdbarch_debug
>= 2)
1266 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1267 return gdbarch
->bfd_arch_info
;
1271 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1273 gdb_assert (gdbarch
!= NULL
);
1274 if (gdbarch_debug
>= 2)
1275 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1276 return gdbarch
->byte_order
;
1280 gdbarch_byte_order_for_code (struct gdbarch
*gdbarch
)
1282 gdb_assert (gdbarch
!= NULL
);
1283 if (gdbarch_debug
>= 2)
1284 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order_for_code called\n");
1285 return gdbarch
->byte_order_for_code
;
1289 gdbarch_osabi (struct gdbarch
*gdbarch
)
1291 gdb_assert (gdbarch
!= NULL
);
1292 if (gdbarch_debug
>= 2)
1293 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1294 return gdbarch
->osabi
;
1297 const struct target_desc
*
1298 gdbarch_target_desc (struct gdbarch
*gdbarch
)
1300 gdb_assert (gdbarch
!= NULL
);
1301 if (gdbarch_debug
>= 2)
1302 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_desc called\n");
1303 return gdbarch
->target_desc
;
1307 gdbarch_bits_big_endian (struct gdbarch
*gdbarch
)
1309 gdb_assert (gdbarch
!= NULL
);
1310 /* Skip verify of bits_big_endian, invalid_p == 0 */
1311 if (gdbarch_debug
>= 2)
1312 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bits_big_endian called\n");
1313 return gdbarch
->bits_big_endian
;
1317 set_gdbarch_bits_big_endian (struct gdbarch
*gdbarch
,
1318 int bits_big_endian
)
1320 gdbarch
->bits_big_endian
= bits_big_endian
;
1324 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1326 gdb_assert (gdbarch
!= NULL
);
1327 /* Skip verify of short_bit, invalid_p == 0 */
1328 if (gdbarch_debug
>= 2)
1329 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1330 return gdbarch
->short_bit
;
1334 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1337 gdbarch
->short_bit
= short_bit
;
1341 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1343 gdb_assert (gdbarch
!= NULL
);
1344 /* Skip verify of int_bit, invalid_p == 0 */
1345 if (gdbarch_debug
>= 2)
1346 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1347 return gdbarch
->int_bit
;
1351 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1354 gdbarch
->int_bit
= int_bit
;
1358 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1360 gdb_assert (gdbarch
!= NULL
);
1361 /* Skip verify of long_bit, invalid_p == 0 */
1362 if (gdbarch_debug
>= 2)
1363 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1364 return gdbarch
->long_bit
;
1368 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1371 gdbarch
->long_bit
= long_bit
;
1375 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1377 gdb_assert (gdbarch
!= NULL
);
1378 /* Skip verify of long_long_bit, invalid_p == 0 */
1379 if (gdbarch_debug
>= 2)
1380 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1381 return gdbarch
->long_long_bit
;
1385 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1388 gdbarch
->long_long_bit
= long_long_bit
;
1392 gdbarch_half_bit (struct gdbarch
*gdbarch
)
1394 gdb_assert (gdbarch
!= NULL
);
1395 /* Skip verify of half_bit, invalid_p == 0 */
1396 if (gdbarch_debug
>= 2)
1397 fprintf_unfiltered (gdb_stdlog
, "gdbarch_half_bit called\n");
1398 return gdbarch
->half_bit
;
1402 set_gdbarch_half_bit (struct gdbarch
*gdbarch
,
1405 gdbarch
->half_bit
= half_bit
;
1408 const struct floatformat
**
1409 gdbarch_half_format (struct gdbarch
*gdbarch
)
1411 gdb_assert (gdbarch
!= NULL
);
1412 if (gdbarch_debug
>= 2)
1413 fprintf_unfiltered (gdb_stdlog
, "gdbarch_half_format called\n");
1414 return gdbarch
->half_format
;
1418 set_gdbarch_half_format (struct gdbarch
*gdbarch
,
1419 const struct floatformat
** half_format
)
1421 gdbarch
->half_format
= half_format
;
1425 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1427 gdb_assert (gdbarch
!= NULL
);
1428 /* Skip verify of float_bit, invalid_p == 0 */
1429 if (gdbarch_debug
>= 2)
1430 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1431 return gdbarch
->float_bit
;
1435 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1438 gdbarch
->float_bit
= float_bit
;
1441 const struct floatformat
**
1442 gdbarch_float_format (struct gdbarch
*gdbarch
)
1444 gdb_assert (gdbarch
!= NULL
);
1445 if (gdbarch_debug
>= 2)
1446 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
1447 return gdbarch
->float_format
;
1451 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
1452 const struct floatformat
** float_format
)
1454 gdbarch
->float_format
= float_format
;
1458 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1460 gdb_assert (gdbarch
!= NULL
);
1461 /* Skip verify of double_bit, invalid_p == 0 */
1462 if (gdbarch_debug
>= 2)
1463 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1464 return gdbarch
->double_bit
;
1468 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1471 gdbarch
->double_bit
= double_bit
;
1474 const struct floatformat
**
1475 gdbarch_double_format (struct gdbarch
*gdbarch
)
1477 gdb_assert (gdbarch
!= NULL
);
1478 if (gdbarch_debug
>= 2)
1479 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
1480 return gdbarch
->double_format
;
1484 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
1485 const struct floatformat
** double_format
)
1487 gdbarch
->double_format
= double_format
;
1491 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1493 gdb_assert (gdbarch
!= NULL
);
1494 /* Skip verify of long_double_bit, invalid_p == 0 */
1495 if (gdbarch_debug
>= 2)
1496 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1497 return gdbarch
->long_double_bit
;
1501 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1502 int long_double_bit
)
1504 gdbarch
->long_double_bit
= long_double_bit
;
1507 const struct floatformat
**
1508 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
1510 gdb_assert (gdbarch
!= NULL
);
1511 if (gdbarch_debug
>= 2)
1512 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
1513 return gdbarch
->long_double_format
;
1517 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
1518 const struct floatformat
** long_double_format
)
1520 gdbarch
->long_double_format
= long_double_format
;
1524 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1526 gdb_assert (gdbarch
!= NULL
);
1527 /* Skip verify of ptr_bit, invalid_p == 0 */
1528 if (gdbarch_debug
>= 2)
1529 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1530 return gdbarch
->ptr_bit
;
1534 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1537 gdbarch
->ptr_bit
= ptr_bit
;
1541 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1543 gdb_assert (gdbarch
!= NULL
);
1544 /* Check variable changed from pre-default. */
1545 gdb_assert (gdbarch
->addr_bit
!= 0);
1546 if (gdbarch_debug
>= 2)
1547 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1548 return gdbarch
->addr_bit
;
1552 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1555 gdbarch
->addr_bit
= addr_bit
;
1559 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1561 gdb_assert (gdbarch
!= NULL
);
1562 /* Check variable changed from pre-default. */
1563 gdb_assert (gdbarch
->char_signed
!= -1);
1564 if (gdbarch_debug
>= 2)
1565 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1566 return gdbarch
->char_signed
;
1570 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1573 gdbarch
->char_signed
= char_signed
;
1577 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1579 gdb_assert (gdbarch
!= NULL
);
1580 return gdbarch
->read_pc
!= NULL
;
1584 gdbarch_read_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
1586 gdb_assert (gdbarch
!= NULL
);
1587 gdb_assert (gdbarch
->read_pc
!= NULL
);
1588 if (gdbarch_debug
>= 2)
1589 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1590 return gdbarch
->read_pc (regcache
);
1594 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1595 gdbarch_read_pc_ftype read_pc
)
1597 gdbarch
->read_pc
= read_pc
;
1601 gdbarch_write_pc_p (struct gdbarch
*gdbarch
)
1603 gdb_assert (gdbarch
!= NULL
);
1604 return gdbarch
->write_pc
!= NULL
;
1608 gdbarch_write_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR val
)
1610 gdb_assert (gdbarch
!= NULL
);
1611 gdb_assert (gdbarch
->write_pc
!= NULL
);
1612 if (gdbarch_debug
>= 2)
1613 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1614 gdbarch
->write_pc (regcache
, val
);
1618 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1619 gdbarch_write_pc_ftype write_pc
)
1621 gdbarch
->write_pc
= write_pc
;
1625 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1627 gdb_assert (gdbarch
!= NULL
);
1628 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1629 if (gdbarch_debug
>= 2)
1630 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1631 gdbarch
->virtual_frame_pointer (gdbarch
, pc
, frame_regnum
, frame_offset
);
1635 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1636 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1638 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1642 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1644 gdb_assert (gdbarch
!= NULL
);
1645 return gdbarch
->pseudo_register_read
!= NULL
;
1649 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, gdb_byte
*buf
)
1651 gdb_assert (gdbarch
!= NULL
);
1652 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
1653 if (gdbarch_debug
>= 2)
1654 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
1655 gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
1659 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
1660 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
1662 gdbarch
->pseudo_register_read
= pseudo_register_read
;
1666 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
1668 gdb_assert (gdbarch
!= NULL
);
1669 return gdbarch
->pseudo_register_write
!= NULL
;
1673 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const gdb_byte
*buf
)
1675 gdb_assert (gdbarch
!= NULL
);
1676 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
1677 if (gdbarch_debug
>= 2)
1678 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
1679 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
1683 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
1684 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
1686 gdbarch
->pseudo_register_write
= pseudo_register_write
;
1690 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1692 gdb_assert (gdbarch
!= NULL
);
1693 /* Check variable changed from pre-default. */
1694 gdb_assert (gdbarch
->num_regs
!= -1);
1695 if (gdbarch_debug
>= 2)
1696 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1697 return gdbarch
->num_regs
;
1701 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1704 gdbarch
->num_regs
= num_regs
;
1708 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
1710 gdb_assert (gdbarch
!= NULL
);
1711 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1712 if (gdbarch_debug
>= 2)
1713 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
1714 return gdbarch
->num_pseudo_regs
;
1718 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
1719 int num_pseudo_regs
)
1721 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
1725 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1727 gdb_assert (gdbarch
!= NULL
);
1728 /* Skip verify of sp_regnum, invalid_p == 0 */
1729 if (gdbarch_debug
>= 2)
1730 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1731 return gdbarch
->sp_regnum
;
1735 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1738 gdbarch
->sp_regnum
= sp_regnum
;
1742 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1744 gdb_assert (gdbarch
!= NULL
);
1745 /* Skip verify of pc_regnum, invalid_p == 0 */
1746 if (gdbarch_debug
>= 2)
1747 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1748 return gdbarch
->pc_regnum
;
1752 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1755 gdbarch
->pc_regnum
= pc_regnum
;
1759 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
1761 gdb_assert (gdbarch
!= NULL
);
1762 /* Skip verify of ps_regnum, invalid_p == 0 */
1763 if (gdbarch_debug
>= 2)
1764 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
1765 return gdbarch
->ps_regnum
;
1769 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
1772 gdbarch
->ps_regnum
= ps_regnum
;
1776 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
1778 gdb_assert (gdbarch
!= NULL
);
1779 /* Skip verify of fp0_regnum, invalid_p == 0 */
1780 if (gdbarch_debug
>= 2)
1781 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
1782 return gdbarch
->fp0_regnum
;
1786 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
1789 gdbarch
->fp0_regnum
= fp0_regnum
;
1793 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
1795 gdb_assert (gdbarch
!= NULL
);
1796 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
1797 if (gdbarch_debug
>= 2)
1798 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
1799 return gdbarch
->stab_reg_to_regnum (gdbarch
, stab_regnr
);
1803 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
1804 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
1806 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
1810 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
1812 gdb_assert (gdbarch
!= NULL
);
1813 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
1814 if (gdbarch_debug
>= 2)
1815 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
1816 return gdbarch
->ecoff_reg_to_regnum (gdbarch
, ecoff_regnr
);
1820 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
1821 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
1823 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
1827 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
1829 gdb_assert (gdbarch
!= NULL
);
1830 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
1831 if (gdbarch_debug
>= 2)
1832 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
1833 return gdbarch
->sdb_reg_to_regnum (gdbarch
, sdb_regnr
);
1837 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
1838 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
1840 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
1844 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
1846 gdb_assert (gdbarch
!= NULL
);
1847 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
1848 if (gdbarch_debug
>= 2)
1849 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
1850 return gdbarch
->dwarf2_reg_to_regnum (gdbarch
, dwarf2_regnr
);
1854 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
1855 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
1857 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
1861 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1863 gdb_assert (gdbarch
!= NULL
);
1864 gdb_assert (gdbarch
->register_name
!= NULL
);
1865 if (gdbarch_debug
>= 2)
1866 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1867 return gdbarch
->register_name (gdbarch
, regnr
);
1871 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1872 gdbarch_register_name_ftype register_name
)
1874 gdbarch
->register_name
= register_name
;
1878 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
1880 gdb_assert (gdbarch
!= NULL
);
1881 return gdbarch
->register_type
!= NULL
;
1885 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
1887 gdb_assert (gdbarch
!= NULL
);
1888 gdb_assert (gdbarch
->register_type
!= NULL
);
1889 if (gdbarch_debug
>= 2)
1890 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
1891 return gdbarch
->register_type (gdbarch
, reg_nr
);
1895 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
1896 gdbarch_register_type_ftype register_type
)
1898 gdbarch
->register_type
= register_type
;
1902 gdbarch_dummy_id_p (struct gdbarch
*gdbarch
)
1904 gdb_assert (gdbarch
!= NULL
);
1905 return gdbarch
->dummy_id
!= NULL
;
1909 gdbarch_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*this_frame
)
1911 gdb_assert (gdbarch
!= NULL
);
1912 gdb_assert (gdbarch
->dummy_id
!= NULL
);
1913 if (gdbarch_debug
>= 2)
1914 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dummy_id called\n");
1915 return gdbarch
->dummy_id (gdbarch
, this_frame
);
1919 set_gdbarch_dummy_id (struct gdbarch
*gdbarch
,
1920 gdbarch_dummy_id_ftype dummy_id
)
1922 gdbarch
->dummy_id
= dummy_id
;
1926 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
1928 gdb_assert (gdbarch
!= NULL
);
1929 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1930 if (gdbarch_debug
>= 2)
1931 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
1932 return gdbarch
->deprecated_fp_regnum
;
1936 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
1937 int deprecated_fp_regnum
)
1939 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
1943 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
1945 gdb_assert (gdbarch
!= NULL
);
1946 return gdbarch
->push_dummy_call
!= NULL
;
1950 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
)
1952 gdb_assert (gdbarch
!= NULL
);
1953 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
1954 if (gdbarch_debug
>= 2)
1955 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
1956 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
1960 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
1961 gdbarch_push_dummy_call_ftype push_dummy_call
)
1963 gdbarch
->push_dummy_call
= push_dummy_call
;
1967 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1969 gdb_assert (gdbarch
!= NULL
);
1970 /* Skip verify of call_dummy_location, invalid_p == 0 */
1971 if (gdbarch_debug
>= 2)
1972 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1973 return gdbarch
->call_dummy_location
;
1977 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1978 int call_dummy_location
)
1980 gdbarch
->call_dummy_location
= call_dummy_location
;
1984 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
1986 gdb_assert (gdbarch
!= NULL
);
1987 return gdbarch
->push_dummy_code
!= NULL
;
1991 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
)
1993 gdb_assert (gdbarch
!= NULL
);
1994 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
1995 if (gdbarch_debug
>= 2)
1996 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
1997 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, args
, nargs
, value_type
, real_pc
, bp_addr
, regcache
);
2001 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
2002 gdbarch_push_dummy_code_ftype push_dummy_code
)
2004 gdbarch
->push_dummy_code
= push_dummy_code
;
2008 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
2010 gdb_assert (gdbarch
!= NULL
);
2011 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
2012 if (gdbarch_debug
>= 2)
2013 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
2014 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
2018 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
2019 gdbarch_print_registers_info_ftype print_registers_info
)
2021 gdbarch
->print_registers_info
= print_registers_info
;
2025 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
2027 gdb_assert (gdbarch
!= NULL
);
2028 return gdbarch
->print_float_info
!= NULL
;
2032 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2034 gdb_assert (gdbarch
!= NULL
);
2035 gdb_assert (gdbarch
->print_float_info
!= NULL
);
2036 if (gdbarch_debug
>= 2)
2037 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
2038 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
2042 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
2043 gdbarch_print_float_info_ftype print_float_info
)
2045 gdbarch
->print_float_info
= print_float_info
;
2049 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
2051 gdb_assert (gdbarch
!= NULL
);
2052 return gdbarch
->print_vector_info
!= NULL
;
2056 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2058 gdb_assert (gdbarch
!= NULL
);
2059 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
2060 if (gdbarch_debug
>= 2)
2061 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
2062 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
2066 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
2067 gdbarch_print_vector_info_ftype print_vector_info
)
2069 gdbarch
->print_vector_info
= print_vector_info
;
2073 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
2075 gdb_assert (gdbarch
!= NULL
);
2076 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
2077 if (gdbarch_debug
>= 2)
2078 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
2079 return gdbarch
->register_sim_regno (gdbarch
, reg_nr
);
2083 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
2084 gdbarch_register_sim_regno_ftype register_sim_regno
)
2086 gdbarch
->register_sim_regno
= register_sim_regno
;
2090 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
2092 gdb_assert (gdbarch
!= NULL
);
2093 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
2094 if (gdbarch_debug
>= 2)
2095 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
2096 return gdbarch
->cannot_fetch_register (gdbarch
, regnum
);
2100 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
2101 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
2103 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
2107 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
2109 gdb_assert (gdbarch
!= NULL
);
2110 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
2111 if (gdbarch_debug
>= 2)
2112 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
2113 return gdbarch
->cannot_store_register (gdbarch
, regnum
);
2117 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
2118 gdbarch_cannot_store_register_ftype cannot_store_register
)
2120 gdbarch
->cannot_store_register
= cannot_store_register
;
2124 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
2126 gdb_assert (gdbarch
!= NULL
);
2127 return gdbarch
->get_longjmp_target
!= NULL
;
2131 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR
*pc
)
2133 gdb_assert (gdbarch
!= NULL
);
2134 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
2135 if (gdbarch_debug
>= 2)
2136 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
2137 return gdbarch
->get_longjmp_target (frame
, pc
);
2141 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
2142 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
2144 gdbarch
->get_longjmp_target
= get_longjmp_target
;
2148 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
2150 gdb_assert (gdbarch
!= NULL
);
2151 if (gdbarch_debug
>= 2)
2152 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
2153 return gdbarch
->believe_pcc_promotion
;
2157 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
2158 int believe_pcc_promotion
)
2160 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2164 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
2166 gdb_assert (gdbarch
!= NULL
);
2167 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
2168 if (gdbarch_debug
>= 2)
2169 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
2170 return gdbarch
->convert_register_p (gdbarch
, regnum
, type
);
2174 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
2175 gdbarch_convert_register_p_ftype convert_register_p
)
2177 gdbarch
->convert_register_p
= convert_register_p
;
2181 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, gdb_byte
*buf
)
2183 gdb_assert (gdbarch
!= NULL
);
2184 gdb_assert (gdbarch
->register_to_value
!= NULL
);
2185 if (gdbarch_debug
>= 2)
2186 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2187 gdbarch
->register_to_value (frame
, regnum
, type
, buf
);
2191 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2192 gdbarch_register_to_value_ftype register_to_value
)
2194 gdbarch
->register_to_value
= register_to_value
;
2198 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const gdb_byte
*buf
)
2200 gdb_assert (gdbarch
!= NULL
);
2201 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2202 if (gdbarch_debug
>= 2)
2203 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2204 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2208 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2209 gdbarch_value_to_register_ftype value_to_register
)
2211 gdbarch
->value_to_register
= value_to_register
;
2215 gdbarch_value_from_register (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, struct frame_info
*frame
)
2217 gdb_assert (gdbarch
!= NULL
);
2218 gdb_assert (gdbarch
->value_from_register
!= NULL
);
2219 if (gdbarch_debug
>= 2)
2220 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_from_register called\n");
2221 return gdbarch
->value_from_register (type
, regnum
, frame
);
2225 set_gdbarch_value_from_register (struct gdbarch
*gdbarch
,
2226 gdbarch_value_from_register_ftype value_from_register
)
2228 gdbarch
->value_from_register
= value_from_register
;
2232 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2234 gdb_assert (gdbarch
!= NULL
);
2235 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2236 if (gdbarch_debug
>= 2)
2237 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2238 return gdbarch
->pointer_to_address (gdbarch
, type
, buf
);
2242 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2243 gdbarch_pointer_to_address_ftype pointer_to_address
)
2245 gdbarch
->pointer_to_address
= pointer_to_address
;
2249 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*buf
, CORE_ADDR addr
)
2251 gdb_assert (gdbarch
!= NULL
);
2252 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2253 if (gdbarch_debug
>= 2)
2254 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2255 gdbarch
->address_to_pointer (gdbarch
, type
, buf
, addr
);
2259 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2260 gdbarch_address_to_pointer_ftype address_to_pointer
)
2262 gdbarch
->address_to_pointer
= address_to_pointer
;
2266 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2268 gdb_assert (gdbarch
!= NULL
);
2269 return gdbarch
->integer_to_address
!= NULL
;
2273 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2275 gdb_assert (gdbarch
!= NULL
);
2276 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2277 if (gdbarch_debug
>= 2)
2278 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2279 return gdbarch
->integer_to_address (gdbarch
, type
, buf
);
2283 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2284 gdbarch_integer_to_address_ftype integer_to_address
)
2286 gdbarch
->integer_to_address
= integer_to_address
;
2290 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2292 gdb_assert (gdbarch
!= NULL
);
2293 return gdbarch
->return_value
!= NULL
;
2296 enum return_value_convention
2297 gdbarch_return_value (struct gdbarch
*gdbarch
, struct type
*functype
, struct type
*valtype
, struct regcache
*regcache
, gdb_byte
*readbuf
, const gdb_byte
*writebuf
)
2299 gdb_assert (gdbarch
!= NULL
);
2300 gdb_assert (gdbarch
->return_value
!= NULL
);
2301 if (gdbarch_debug
>= 2)
2302 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2303 return gdbarch
->return_value (gdbarch
, functype
, valtype
, regcache
, readbuf
, writebuf
);
2307 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2308 gdbarch_return_value_ftype return_value
)
2310 gdbarch
->return_value
= return_value
;
2314 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2316 gdb_assert (gdbarch
!= NULL
);
2317 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2318 if (gdbarch_debug
>= 2)
2319 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2320 return gdbarch
->skip_prologue (gdbarch
, ip
);
2324 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2325 gdbarch_skip_prologue_ftype skip_prologue
)
2327 gdbarch
->skip_prologue
= skip_prologue
;
2331 gdbarch_skip_main_prologue_p (struct gdbarch
*gdbarch
)
2333 gdb_assert (gdbarch
!= NULL
);
2334 return gdbarch
->skip_main_prologue
!= NULL
;
2338 gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2340 gdb_assert (gdbarch
!= NULL
);
2341 gdb_assert (gdbarch
->skip_main_prologue
!= NULL
);
2342 if (gdbarch_debug
>= 2)
2343 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_main_prologue called\n");
2344 return gdbarch
->skip_main_prologue (gdbarch
, ip
);
2348 set_gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
,
2349 gdbarch_skip_main_prologue_ftype skip_main_prologue
)
2351 gdbarch
->skip_main_prologue
= skip_main_prologue
;
2355 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2357 gdb_assert (gdbarch
!= NULL
);
2358 gdb_assert (gdbarch
->inner_than
!= NULL
);
2359 if (gdbarch_debug
>= 2)
2360 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2361 return gdbarch
->inner_than (lhs
, rhs
);
2365 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2366 gdbarch_inner_than_ftype inner_than
)
2368 gdbarch
->inner_than
= inner_than
;
2372 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2374 gdb_assert (gdbarch
!= NULL
);
2375 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2376 if (gdbarch_debug
>= 2)
2377 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2378 return gdbarch
->breakpoint_from_pc (gdbarch
, pcptr
, lenptr
);
2382 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2383 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2385 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2389 gdbarch_remote_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *kindptr
)
2391 gdb_assert (gdbarch
!= NULL
);
2392 gdb_assert (gdbarch
->remote_breakpoint_from_pc
!= NULL
);
2393 if (gdbarch_debug
>= 2)
2394 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_breakpoint_from_pc called\n");
2395 gdbarch
->remote_breakpoint_from_pc (gdbarch
, pcptr
, kindptr
);
2399 set_gdbarch_remote_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2400 gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc
)
2402 gdbarch
->remote_breakpoint_from_pc
= remote_breakpoint_from_pc
;
2406 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2408 gdb_assert (gdbarch
!= NULL
);
2409 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2413 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2415 gdb_assert (gdbarch
!= NULL
);
2416 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2417 if (gdbarch_debug
>= 2)
2418 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2419 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2423 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2424 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2426 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2430 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2432 gdb_assert (gdbarch
!= NULL
);
2433 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2434 if (gdbarch_debug
>= 2)
2435 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2436 return gdbarch
->memory_insert_breakpoint (gdbarch
, bp_tgt
);
2440 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2441 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2443 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2447 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2449 gdb_assert (gdbarch
!= NULL
);
2450 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2451 if (gdbarch_debug
>= 2)
2452 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2453 return gdbarch
->memory_remove_breakpoint (gdbarch
, bp_tgt
);
2457 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2458 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2460 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2464 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2466 gdb_assert (gdbarch
!= NULL
);
2467 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2468 if (gdbarch_debug
>= 2)
2469 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2470 return gdbarch
->decr_pc_after_break
;
2474 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2475 CORE_ADDR decr_pc_after_break
)
2477 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2481 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
2483 gdb_assert (gdbarch
!= NULL
);
2484 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2485 if (gdbarch_debug
>= 2)
2486 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
2487 return gdbarch
->deprecated_function_start_offset
;
2491 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
2492 CORE_ADDR deprecated_function_start_offset
)
2494 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
2498 gdbarch_remote_register_number (struct gdbarch
*gdbarch
, int regno
)
2500 gdb_assert (gdbarch
!= NULL
);
2501 gdb_assert (gdbarch
->remote_register_number
!= NULL
);
2502 if (gdbarch_debug
>= 2)
2503 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_register_number called\n");
2504 return gdbarch
->remote_register_number (gdbarch
, regno
);
2508 set_gdbarch_remote_register_number (struct gdbarch
*gdbarch
,
2509 gdbarch_remote_register_number_ftype remote_register_number
)
2511 gdbarch
->remote_register_number
= remote_register_number
;
2515 gdbarch_fetch_tls_load_module_address_p (struct gdbarch
*gdbarch
)
2517 gdb_assert (gdbarch
!= NULL
);
2518 return gdbarch
->fetch_tls_load_module_address
!= NULL
;
2522 gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
, struct objfile
*objfile
)
2524 gdb_assert (gdbarch
!= NULL
);
2525 gdb_assert (gdbarch
->fetch_tls_load_module_address
!= NULL
);
2526 if (gdbarch_debug
>= 2)
2527 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_tls_load_module_address called\n");
2528 return gdbarch
->fetch_tls_load_module_address (objfile
);
2532 set_gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
,
2533 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address
)
2535 gdbarch
->fetch_tls_load_module_address
= fetch_tls_load_module_address
;
2539 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2541 gdb_assert (gdbarch
!= NULL
);
2542 /* Skip verify of frame_args_skip, invalid_p == 0 */
2543 if (gdbarch_debug
>= 2)
2544 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2545 return gdbarch
->frame_args_skip
;
2549 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2550 CORE_ADDR frame_args_skip
)
2552 gdbarch
->frame_args_skip
= frame_args_skip
;
2556 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
2558 gdb_assert (gdbarch
!= NULL
);
2559 return gdbarch
->unwind_pc
!= NULL
;
2563 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2565 gdb_assert (gdbarch
!= NULL
);
2566 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
2567 if (gdbarch_debug
>= 2)
2568 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
2569 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
2573 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
2574 gdbarch_unwind_pc_ftype unwind_pc
)
2576 gdbarch
->unwind_pc
= unwind_pc
;
2580 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
2582 gdb_assert (gdbarch
!= NULL
);
2583 return gdbarch
->unwind_sp
!= NULL
;
2587 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2589 gdb_assert (gdbarch
!= NULL
);
2590 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
2591 if (gdbarch_debug
>= 2)
2592 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
2593 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
2597 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
2598 gdbarch_unwind_sp_ftype unwind_sp
)
2600 gdbarch
->unwind_sp
= unwind_sp
;
2604 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
2606 gdb_assert (gdbarch
!= NULL
);
2607 return gdbarch
->frame_num_args
!= NULL
;
2611 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2613 gdb_assert (gdbarch
!= NULL
);
2614 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
2615 if (gdbarch_debug
>= 2)
2616 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2617 return gdbarch
->frame_num_args (frame
);
2621 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2622 gdbarch_frame_num_args_ftype frame_num_args
)
2624 gdbarch
->frame_num_args
= frame_num_args
;
2628 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
2630 gdb_assert (gdbarch
!= NULL
);
2631 return gdbarch
->frame_align
!= NULL
;
2635 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
2637 gdb_assert (gdbarch
!= NULL
);
2638 gdb_assert (gdbarch
->frame_align
!= NULL
);
2639 if (gdbarch_debug
>= 2)
2640 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
2641 return gdbarch
->frame_align (gdbarch
, address
);
2645 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
2646 gdbarch_frame_align_ftype frame_align
)
2648 gdbarch
->frame_align
= frame_align
;
2652 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
2654 gdb_assert (gdbarch
!= NULL
);
2655 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
2656 if (gdbarch_debug
>= 2)
2657 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
2658 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
2662 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
2663 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
2665 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
2669 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
2671 gdb_assert (gdbarch
!= NULL
);
2672 if (gdbarch_debug
>= 2)
2673 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
2674 return gdbarch
->frame_red_zone_size
;
2678 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
2679 int frame_red_zone_size
)
2681 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
2685 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
2687 gdb_assert (gdbarch
!= NULL
);
2688 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
2689 if (gdbarch_debug
>= 2)
2690 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
2691 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
2695 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
2696 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
2698 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
2702 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2704 gdb_assert (gdbarch
!= NULL
);
2705 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
2706 if (gdbarch_debug
>= 2)
2707 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
2708 return gdbarch
->addr_bits_remove (gdbarch
, addr
);
2712 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
2713 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
2715 gdbarch
->addr_bits_remove
= addr_bits_remove
;
2719 gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2721 gdb_assert (gdbarch
!= NULL
);
2722 gdb_assert (gdbarch
->smash_text_address
!= NULL
);
2723 if (gdbarch_debug
>= 2)
2724 fprintf_unfiltered (gdb_stdlog
, "gdbarch_smash_text_address called\n");
2725 return gdbarch
->smash_text_address (gdbarch
, addr
);
2729 set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
,
2730 gdbarch_smash_text_address_ftype smash_text_address
)
2732 gdbarch
->smash_text_address
= smash_text_address
;
2736 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
2738 gdb_assert (gdbarch
!= NULL
);
2739 return gdbarch
->software_single_step
!= NULL
;
2743 gdbarch_software_single_step (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2745 gdb_assert (gdbarch
!= NULL
);
2746 gdb_assert (gdbarch
->software_single_step
!= NULL
);
2747 if (gdbarch_debug
>= 2)
2748 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
2749 return gdbarch
->software_single_step (frame
);
2753 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
2754 gdbarch_software_single_step_ftype software_single_step
)
2756 gdbarch
->software_single_step
= software_single_step
;
2760 gdbarch_single_step_through_delay_p (struct gdbarch
*gdbarch
)
2762 gdb_assert (gdbarch
!= NULL
);
2763 return gdbarch
->single_step_through_delay
!= NULL
;
2767 gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2769 gdb_assert (gdbarch
!= NULL
);
2770 gdb_assert (gdbarch
->single_step_through_delay
!= NULL
);
2771 if (gdbarch_debug
>= 2)
2772 fprintf_unfiltered (gdb_stdlog
, "gdbarch_single_step_through_delay called\n");
2773 return gdbarch
->single_step_through_delay (gdbarch
, frame
);
2777 set_gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
,
2778 gdbarch_single_step_through_delay_ftype single_step_through_delay
)
2780 gdbarch
->single_step_through_delay
= single_step_through_delay
;
2784 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
2786 gdb_assert (gdbarch
!= NULL
);
2787 gdb_assert (gdbarch
->print_insn
!= NULL
);
2788 if (gdbarch_debug
>= 2)
2789 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
2790 return gdbarch
->print_insn (vma
, info
);
2794 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
2795 gdbarch_print_insn_ftype print_insn
)
2797 gdbarch
->print_insn
= print_insn
;
2801 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR pc
)
2803 gdb_assert (gdbarch
!= NULL
);
2804 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
2805 if (gdbarch_debug
>= 2)
2806 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
2807 return gdbarch
->skip_trampoline_code (frame
, pc
);
2811 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
2812 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
2814 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
2818 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
2820 gdb_assert (gdbarch
!= NULL
);
2821 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
2822 if (gdbarch_debug
>= 2)
2823 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
2824 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
2828 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
2829 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
2831 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
2835 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
)
2837 gdb_assert (gdbarch
!= NULL
);
2838 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
2839 if (gdbarch_debug
>= 2)
2840 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
2841 return gdbarch
->in_solib_return_trampoline (gdbarch
, pc
, name
);
2845 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
2846 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
2848 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
2852 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2854 gdb_assert (gdbarch
!= NULL
);
2855 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
2856 if (gdbarch_debug
>= 2)
2857 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
2858 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
2862 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
2863 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
2865 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
2869 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
2871 gdb_assert (gdbarch
!= NULL
);
2872 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
2873 if (gdbarch_debug
>= 2)
2874 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
2875 gdbarch
->elf_make_msymbol_special (sym
, msym
);
2879 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
2880 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
2882 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
2886 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
2888 gdb_assert (gdbarch
!= NULL
);
2889 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
2890 if (gdbarch_debug
>= 2)
2891 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
2892 gdbarch
->coff_make_msymbol_special (val
, msym
);
2896 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
2897 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
2899 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
2903 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
2905 gdb_assert (gdbarch
!= NULL
);
2906 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2907 if (gdbarch_debug
>= 2)
2908 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
2909 return gdbarch
->cannot_step_breakpoint
;
2913 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
2914 int cannot_step_breakpoint
)
2916 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
2920 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
2922 gdb_assert (gdbarch
!= NULL
);
2923 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2924 if (gdbarch_debug
>= 2)
2925 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
2926 return gdbarch
->have_nonsteppable_watchpoint
;
2930 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
2931 int have_nonsteppable_watchpoint
)
2933 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
2937 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
2939 gdb_assert (gdbarch
!= NULL
);
2940 return gdbarch
->address_class_type_flags
!= NULL
;
2944 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
2946 gdb_assert (gdbarch
!= NULL
);
2947 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
2948 if (gdbarch_debug
>= 2)
2949 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
2950 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
2954 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
2955 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
2957 gdbarch
->address_class_type_flags
= address_class_type_flags
;
2961 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
2963 gdb_assert (gdbarch
!= NULL
);
2964 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
2968 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
2970 gdb_assert (gdbarch
!= NULL
);
2971 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
2972 if (gdbarch_debug
>= 2)
2973 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
2974 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
2978 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
2979 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
2981 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
2985 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
2987 gdb_assert (gdbarch
!= NULL
);
2988 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
2992 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
2994 gdb_assert (gdbarch
!= NULL
);
2995 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
2996 if (gdbarch_debug
>= 2)
2997 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
2998 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
3002 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
3003 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
3005 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
3009 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
3011 gdb_assert (gdbarch
!= NULL
);
3012 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
3013 if (gdbarch_debug
>= 2)
3014 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
3015 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
3019 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
3020 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
3022 gdbarch
->register_reggroup_p
= register_reggroup_p
;
3026 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
3028 gdb_assert (gdbarch
!= NULL
);
3029 return gdbarch
->fetch_pointer_argument
!= NULL
;
3033 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
3035 gdb_assert (gdbarch
!= NULL
);
3036 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
3037 if (gdbarch_debug
>= 2)
3038 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
3039 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
3043 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
3044 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
3046 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
3050 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
3052 gdb_assert (gdbarch
!= NULL
);
3053 return gdbarch
->regset_from_core_section
!= NULL
;
3056 const struct regset
*
3057 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
3059 gdb_assert (gdbarch
!= NULL
);
3060 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
3061 if (gdbarch_debug
>= 2)
3062 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
3063 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
3067 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
3068 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
3070 gdbarch
->regset_from_core_section
= regset_from_core_section
;
3074 gdbarch_core_reg_section_encodes_pid (struct gdbarch
*gdbarch
)
3076 gdb_assert (gdbarch
!= NULL
);
3077 /* Skip verify of core_reg_section_encodes_pid, invalid_p == 0 */
3078 if (gdbarch_debug
>= 2)
3079 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_reg_section_encodes_pid called\n");
3080 return gdbarch
->core_reg_section_encodes_pid
;
3084 set_gdbarch_core_reg_section_encodes_pid (struct gdbarch
*gdbarch
,
3085 int core_reg_section_encodes_pid
)
3087 gdbarch
->core_reg_section_encodes_pid
= core_reg_section_encodes_pid
;
3090 struct core_regset_section
*
3091 gdbarch_core_regset_sections (struct gdbarch
*gdbarch
)
3093 gdb_assert (gdbarch
!= NULL
);
3094 if (gdbarch_debug
>= 2)
3095 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_regset_sections called\n");
3096 return gdbarch
->core_regset_sections
;
3100 set_gdbarch_core_regset_sections (struct gdbarch
*gdbarch
,
3101 struct core_regset_section
* core_regset_sections
)
3103 gdbarch
->core_regset_sections
= core_regset_sections
;
3107 gdbarch_core_xfer_shared_libraries_p (struct gdbarch
*gdbarch
)
3109 gdb_assert (gdbarch
!= NULL
);
3110 return gdbarch
->core_xfer_shared_libraries
!= NULL
;
3114 gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
, gdb_byte
*readbuf
, ULONGEST offset
, LONGEST len
)
3116 gdb_assert (gdbarch
!= NULL
);
3117 gdb_assert (gdbarch
->core_xfer_shared_libraries
!= NULL
);
3118 if (gdbarch_debug
>= 2)
3119 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_xfer_shared_libraries called\n");
3120 return gdbarch
->core_xfer_shared_libraries (gdbarch
, readbuf
, offset
, len
);
3124 set_gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
,
3125 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries
)
3127 gdbarch
->core_xfer_shared_libraries
= core_xfer_shared_libraries
;
3131 gdbarch_core_pid_to_str_p (struct gdbarch
*gdbarch
)
3133 gdb_assert (gdbarch
!= NULL
);
3134 return gdbarch
->core_pid_to_str
!= NULL
;
3138 gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
, ptid_t ptid
)
3140 gdb_assert (gdbarch
!= NULL
);
3141 gdb_assert (gdbarch
->core_pid_to_str
!= NULL
);
3142 if (gdbarch_debug
>= 2)
3143 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_pid_to_str called\n");
3144 return gdbarch
->core_pid_to_str (gdbarch
, ptid
);
3148 set_gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
,
3149 gdbarch_core_pid_to_str_ftype core_pid_to_str
)
3151 gdbarch
->core_pid_to_str
= core_pid_to_str
;
3155 gdbarch_gcore_bfd_target_p (struct gdbarch
*gdbarch
)
3157 gdb_assert (gdbarch
!= NULL
);
3158 return gdbarch
->gcore_bfd_target
!= 0;
3162 gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
)
3164 gdb_assert (gdbarch
!= NULL
);
3165 /* Check variable changed from pre-default. */
3166 gdb_assert (gdbarch
->gcore_bfd_target
!= 0);
3167 if (gdbarch_debug
>= 2)
3168 fprintf_unfiltered (gdb_stdlog
, "gdbarch_gcore_bfd_target called\n");
3169 return gdbarch
->gcore_bfd_target
;
3173 set_gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
,
3174 const char * gcore_bfd_target
)
3176 gdbarch
->gcore_bfd_target
= gcore_bfd_target
;
3180 gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
)
3182 gdb_assert (gdbarch
!= NULL
);
3183 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3184 if (gdbarch_debug
>= 2)
3185 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vtable_function_descriptors called\n");
3186 return gdbarch
->vtable_function_descriptors
;
3190 set_gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
,
3191 int vtable_function_descriptors
)
3193 gdbarch
->vtable_function_descriptors
= vtable_function_descriptors
;
3197 gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
)
3199 gdb_assert (gdbarch
!= NULL
);
3200 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3201 if (gdbarch_debug
>= 2)
3202 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vbit_in_delta called\n");
3203 return gdbarch
->vbit_in_delta
;
3207 set_gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
,
3210 gdbarch
->vbit_in_delta
= vbit_in_delta
;
3214 gdbarch_skip_permanent_breakpoint_p (struct gdbarch
*gdbarch
)
3216 gdb_assert (gdbarch
!= NULL
);
3217 return gdbarch
->skip_permanent_breakpoint
!= NULL
;
3221 gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
3223 gdb_assert (gdbarch
!= NULL
);
3224 gdb_assert (gdbarch
->skip_permanent_breakpoint
!= NULL
);
3225 if (gdbarch_debug
>= 2)
3226 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_permanent_breakpoint called\n");
3227 gdbarch
->skip_permanent_breakpoint (regcache
);
3231 set_gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
,
3232 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint
)
3234 gdbarch
->skip_permanent_breakpoint
= skip_permanent_breakpoint
;
3238 gdbarch_max_insn_length_p (struct gdbarch
*gdbarch
)
3240 gdb_assert (gdbarch
!= NULL
);
3241 return gdbarch
->max_insn_length
!= 0;
3245 gdbarch_max_insn_length (struct gdbarch
*gdbarch
)
3247 gdb_assert (gdbarch
!= NULL
);
3248 /* Check variable changed from pre-default. */
3249 gdb_assert (gdbarch
->max_insn_length
!= 0);
3250 if (gdbarch_debug
>= 2)
3251 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_insn_length called\n");
3252 return gdbarch
->max_insn_length
;
3256 set_gdbarch_max_insn_length (struct gdbarch
*gdbarch
,
3257 ULONGEST max_insn_length
)
3259 gdbarch
->max_insn_length
= max_insn_length
;
3263 gdbarch_displaced_step_copy_insn_p (struct gdbarch
*gdbarch
)
3265 gdb_assert (gdbarch
!= NULL
);
3266 return gdbarch
->displaced_step_copy_insn
!= NULL
;
3269 struct displaced_step_closure
*
3270 gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3272 gdb_assert (gdbarch
!= NULL
);
3273 gdb_assert (gdbarch
->displaced_step_copy_insn
!= NULL
);
3274 if (gdbarch_debug
>= 2)
3275 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_copy_insn called\n");
3276 return gdbarch
->displaced_step_copy_insn (gdbarch
, from
, to
, regs
);
3280 set_gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
,
3281 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn
)
3283 gdbarch
->displaced_step_copy_insn
= displaced_step_copy_insn
;
3287 gdbarch_displaced_step_hw_singlestep (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3289 gdb_assert (gdbarch
!= NULL
);
3290 gdb_assert (gdbarch
->displaced_step_hw_singlestep
!= NULL
);
3291 if (gdbarch_debug
>= 2)
3292 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_hw_singlestep called\n");
3293 return gdbarch
->displaced_step_hw_singlestep (gdbarch
, closure
);
3297 set_gdbarch_displaced_step_hw_singlestep (struct gdbarch
*gdbarch
,
3298 gdbarch_displaced_step_hw_singlestep_ftype displaced_step_hw_singlestep
)
3300 gdbarch
->displaced_step_hw_singlestep
= displaced_step_hw_singlestep
;
3304 gdbarch_displaced_step_fixup_p (struct gdbarch
*gdbarch
)
3306 gdb_assert (gdbarch
!= NULL
);
3307 return gdbarch
->displaced_step_fixup
!= NULL
;
3311 gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3313 gdb_assert (gdbarch
!= NULL
);
3314 gdb_assert (gdbarch
->displaced_step_fixup
!= NULL
);
3315 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3316 if (gdbarch_debug
>= 2)
3317 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_fixup called\n");
3318 gdbarch
->displaced_step_fixup (gdbarch
, closure
, from
, to
, regs
);
3322 set_gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
,
3323 gdbarch_displaced_step_fixup_ftype displaced_step_fixup
)
3325 gdbarch
->displaced_step_fixup
= displaced_step_fixup
;
3329 gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3331 gdb_assert (gdbarch
!= NULL
);
3332 gdb_assert (gdbarch
->displaced_step_free_closure
!= NULL
);
3333 if (gdbarch_debug
>= 2)
3334 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_free_closure called\n");
3335 gdbarch
->displaced_step_free_closure (gdbarch
, closure
);
3339 set_gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
,
3340 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure
)
3342 gdbarch
->displaced_step_free_closure
= displaced_step_free_closure
;
3346 gdbarch_displaced_step_location (struct gdbarch
*gdbarch
)
3348 gdb_assert (gdbarch
!= NULL
);
3349 gdb_assert (gdbarch
->displaced_step_location
!= NULL
);
3350 if (gdbarch_debug
>= 2)
3351 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_location called\n");
3352 return gdbarch
->displaced_step_location (gdbarch
);
3356 set_gdbarch_displaced_step_location (struct gdbarch
*gdbarch
,
3357 gdbarch_displaced_step_location_ftype displaced_step_location
)
3359 gdbarch
->displaced_step_location
= displaced_step_location
;
3363 gdbarch_relocate_instruction_p (struct gdbarch
*gdbarch
)
3365 gdb_assert (gdbarch
!= NULL
);
3366 return gdbarch
->relocate_instruction
!= NULL
;
3370 gdbarch_relocate_instruction (struct gdbarch
*gdbarch
, CORE_ADDR
*to
, CORE_ADDR from
)
3372 gdb_assert (gdbarch
!= NULL
);
3373 gdb_assert (gdbarch
->relocate_instruction
!= NULL
);
3374 /* Do not check predicate: gdbarch->relocate_instruction != NULL, allow call. */
3375 if (gdbarch_debug
>= 2)
3376 fprintf_unfiltered (gdb_stdlog
, "gdbarch_relocate_instruction called\n");
3377 gdbarch
->relocate_instruction (gdbarch
, to
, from
);
3381 set_gdbarch_relocate_instruction (struct gdbarch
*gdbarch
,
3382 gdbarch_relocate_instruction_ftype relocate_instruction
)
3384 gdbarch
->relocate_instruction
= relocate_instruction
;
3388 gdbarch_overlay_update_p (struct gdbarch
*gdbarch
)
3390 gdb_assert (gdbarch
!= NULL
);
3391 return gdbarch
->overlay_update
!= NULL
;
3395 gdbarch_overlay_update (struct gdbarch
*gdbarch
, struct obj_section
*osect
)
3397 gdb_assert (gdbarch
!= NULL
);
3398 gdb_assert (gdbarch
->overlay_update
!= NULL
);
3399 if (gdbarch_debug
>= 2)
3400 fprintf_unfiltered (gdb_stdlog
, "gdbarch_overlay_update called\n");
3401 gdbarch
->overlay_update (osect
);
3405 set_gdbarch_overlay_update (struct gdbarch
*gdbarch
,
3406 gdbarch_overlay_update_ftype overlay_update
)
3408 gdbarch
->overlay_update
= overlay_update
;
3412 gdbarch_core_read_description_p (struct gdbarch
*gdbarch
)
3414 gdb_assert (gdbarch
!= NULL
);
3415 return gdbarch
->core_read_description
!= NULL
;
3418 const struct target_desc
*
3419 gdbarch_core_read_description (struct gdbarch
*gdbarch
, struct target_ops
*target
, bfd
*abfd
)
3421 gdb_assert (gdbarch
!= NULL
);
3422 gdb_assert (gdbarch
->core_read_description
!= NULL
);
3423 if (gdbarch_debug
>= 2)
3424 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_read_description called\n");
3425 return gdbarch
->core_read_description (gdbarch
, target
, abfd
);
3429 set_gdbarch_core_read_description (struct gdbarch
*gdbarch
,
3430 gdbarch_core_read_description_ftype core_read_description
)
3432 gdbarch
->core_read_description
= core_read_description
;
3436 gdbarch_static_transform_name_p (struct gdbarch
*gdbarch
)
3438 gdb_assert (gdbarch
!= NULL
);
3439 return gdbarch
->static_transform_name
!= NULL
;
3443 gdbarch_static_transform_name (struct gdbarch
*gdbarch
, char *name
)
3445 gdb_assert (gdbarch
!= NULL
);
3446 gdb_assert (gdbarch
->static_transform_name
!= NULL
);
3447 if (gdbarch_debug
>= 2)
3448 fprintf_unfiltered (gdb_stdlog
, "gdbarch_static_transform_name called\n");
3449 return gdbarch
->static_transform_name (name
);
3453 set_gdbarch_static_transform_name (struct gdbarch
*gdbarch
,
3454 gdbarch_static_transform_name_ftype static_transform_name
)
3456 gdbarch
->static_transform_name
= static_transform_name
;
3460 gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
)
3462 gdb_assert (gdbarch
!= NULL
);
3463 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3464 if (gdbarch_debug
>= 2)
3465 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sofun_address_maybe_missing called\n");
3466 return gdbarch
->sofun_address_maybe_missing
;
3470 set_gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
,
3471 int sofun_address_maybe_missing
)
3473 gdbarch
->sofun_address_maybe_missing
= sofun_address_maybe_missing
;
3477 gdbarch_process_record_p (struct gdbarch
*gdbarch
)
3479 gdb_assert (gdbarch
!= NULL
);
3480 return gdbarch
->process_record
!= NULL
;
3484 gdbarch_process_record (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR addr
)
3486 gdb_assert (gdbarch
!= NULL
);
3487 gdb_assert (gdbarch
->process_record
!= NULL
);
3488 if (gdbarch_debug
>= 2)
3489 fprintf_unfiltered (gdb_stdlog
, "gdbarch_process_record called\n");
3490 return gdbarch
->process_record (gdbarch
, regcache
, addr
);
3494 set_gdbarch_process_record (struct gdbarch
*gdbarch
,
3495 gdbarch_process_record_ftype process_record
)
3497 gdbarch
->process_record
= process_record
;
3501 gdbarch_process_record_signal_p (struct gdbarch
*gdbarch
)
3503 gdb_assert (gdbarch
!= NULL
);
3504 return gdbarch
->process_record_signal
!= NULL
;
3508 gdbarch_process_record_signal (struct gdbarch
*gdbarch
, struct regcache
*regcache
, enum target_signal signal
)
3510 gdb_assert (gdbarch
!= NULL
);
3511 gdb_assert (gdbarch
->process_record_signal
!= NULL
);
3512 if (gdbarch_debug
>= 2)
3513 fprintf_unfiltered (gdb_stdlog
, "gdbarch_process_record_signal called\n");
3514 return gdbarch
->process_record_signal (gdbarch
, regcache
, signal
);
3518 set_gdbarch_process_record_signal (struct gdbarch
*gdbarch
,
3519 gdbarch_process_record_signal_ftype process_record_signal
)
3521 gdbarch
->process_record_signal
= process_record_signal
;
3525 gdbarch_target_signal_from_host (struct gdbarch
*gdbarch
, int signo
)
3527 gdb_assert (gdbarch
!= NULL
);
3528 gdb_assert (gdbarch
->target_signal_from_host
!= NULL
);
3529 if (gdbarch_debug
>= 2)
3530 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_signal_from_host called\n");
3531 return gdbarch
->target_signal_from_host (gdbarch
, signo
);
3535 set_gdbarch_target_signal_from_host (struct gdbarch
*gdbarch
,
3536 gdbarch_target_signal_from_host_ftype target_signal_from_host
)
3538 gdbarch
->target_signal_from_host
= target_signal_from_host
;
3542 gdbarch_target_signal_to_host (struct gdbarch
*gdbarch
, enum target_signal ts
)
3544 gdb_assert (gdbarch
!= NULL
);
3545 gdb_assert (gdbarch
->target_signal_to_host
!= NULL
);
3546 if (gdbarch_debug
>= 2)
3547 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_signal_to_host called\n");
3548 return gdbarch
->target_signal_to_host (gdbarch
, ts
);
3552 set_gdbarch_target_signal_to_host (struct gdbarch
*gdbarch
,
3553 gdbarch_target_signal_to_host_ftype target_signal_to_host
)
3555 gdbarch
->target_signal_to_host
= target_signal_to_host
;
3559 gdbarch_get_siginfo_type_p (struct gdbarch
*gdbarch
)
3561 gdb_assert (gdbarch
!= NULL
);
3562 return gdbarch
->get_siginfo_type
!= NULL
;
3566 gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
)
3568 gdb_assert (gdbarch
!= NULL
);
3569 gdb_assert (gdbarch
->get_siginfo_type
!= NULL
);
3570 if (gdbarch_debug
>= 2)
3571 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_siginfo_type called\n");
3572 return gdbarch
->get_siginfo_type (gdbarch
);
3576 set_gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
,
3577 gdbarch_get_siginfo_type_ftype get_siginfo_type
)
3579 gdbarch
->get_siginfo_type
= get_siginfo_type
;
3583 gdbarch_record_special_symbol_p (struct gdbarch
*gdbarch
)
3585 gdb_assert (gdbarch
!= NULL
);
3586 return gdbarch
->record_special_symbol
!= NULL
;
3590 gdbarch_record_special_symbol (struct gdbarch
*gdbarch
, struct objfile
*objfile
, asymbol
*sym
)
3592 gdb_assert (gdbarch
!= NULL
);
3593 gdb_assert (gdbarch
->record_special_symbol
!= NULL
);
3594 if (gdbarch_debug
>= 2)
3595 fprintf_unfiltered (gdb_stdlog
, "gdbarch_record_special_symbol called\n");
3596 gdbarch
->record_special_symbol (gdbarch
, objfile
, sym
);
3600 set_gdbarch_record_special_symbol (struct gdbarch
*gdbarch
,
3601 gdbarch_record_special_symbol_ftype record_special_symbol
)
3603 gdbarch
->record_special_symbol
= record_special_symbol
;
3607 gdbarch_get_syscall_number_p (struct gdbarch
*gdbarch
)
3609 gdb_assert (gdbarch
!= NULL
);
3610 return gdbarch
->get_syscall_number
!= NULL
;
3614 gdbarch_get_syscall_number (struct gdbarch
*gdbarch
, ptid_t ptid
)
3616 gdb_assert (gdbarch
!= NULL
);
3617 gdb_assert (gdbarch
->get_syscall_number
!= NULL
);
3618 if (gdbarch_debug
>= 2)
3619 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_syscall_number called\n");
3620 return gdbarch
->get_syscall_number (gdbarch
, ptid
);
3624 set_gdbarch_get_syscall_number (struct gdbarch
*gdbarch
,
3625 gdbarch_get_syscall_number_ftype get_syscall_number
)
3627 gdbarch
->get_syscall_number
= get_syscall_number
;
3631 gdbarch_has_global_solist (struct gdbarch
*gdbarch
)
3633 gdb_assert (gdbarch
!= NULL
);
3634 /* Skip verify of has_global_solist, invalid_p == 0 */
3635 if (gdbarch_debug
>= 2)
3636 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_solist called\n");
3637 return gdbarch
->has_global_solist
;
3641 set_gdbarch_has_global_solist (struct gdbarch
*gdbarch
,
3642 int has_global_solist
)
3644 gdbarch
->has_global_solist
= has_global_solist
;
3648 gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
)
3650 gdb_assert (gdbarch
!= NULL
);
3651 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
3652 if (gdbarch_debug
>= 2)
3653 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_breakpoints called\n");
3654 return gdbarch
->has_global_breakpoints
;
3658 set_gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
,
3659 int has_global_breakpoints
)
3661 gdbarch
->has_global_breakpoints
= has_global_breakpoints
;
3665 gdbarch_has_shared_address_space (struct gdbarch
*gdbarch
)
3667 gdb_assert (gdbarch
!= NULL
);
3668 gdb_assert (gdbarch
->has_shared_address_space
!= NULL
);
3669 if (gdbarch_debug
>= 2)
3670 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_shared_address_space called\n");
3671 return gdbarch
->has_shared_address_space (gdbarch
);
3675 set_gdbarch_has_shared_address_space (struct gdbarch
*gdbarch
,
3676 gdbarch_has_shared_address_space_ftype has_shared_address_space
)
3678 gdbarch
->has_shared_address_space
= has_shared_address_space
;
3682 gdbarch_fast_tracepoint_valid_at (struct gdbarch
*gdbarch
, CORE_ADDR addr
, int *isize
, char **msg
)
3684 gdb_assert (gdbarch
!= NULL
);
3685 gdb_assert (gdbarch
->fast_tracepoint_valid_at
!= NULL
);
3686 if (gdbarch_debug
>= 2)
3687 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fast_tracepoint_valid_at called\n");
3688 return gdbarch
->fast_tracepoint_valid_at (gdbarch
, addr
, isize
, msg
);
3692 set_gdbarch_fast_tracepoint_valid_at (struct gdbarch
*gdbarch
,
3693 gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at
)
3695 gdbarch
->fast_tracepoint_valid_at
= fast_tracepoint_valid_at
;
3699 gdbarch_auto_charset (struct gdbarch
*gdbarch
)
3701 gdb_assert (gdbarch
!= NULL
);
3702 gdb_assert (gdbarch
->auto_charset
!= NULL
);
3703 if (gdbarch_debug
>= 2)
3704 fprintf_unfiltered (gdb_stdlog
, "gdbarch_auto_charset called\n");
3705 return gdbarch
->auto_charset ();
3709 set_gdbarch_auto_charset (struct gdbarch
*gdbarch
,
3710 gdbarch_auto_charset_ftype auto_charset
)
3712 gdbarch
->auto_charset
= auto_charset
;
3716 gdbarch_auto_wide_charset (struct gdbarch
*gdbarch
)
3718 gdb_assert (gdbarch
!= NULL
);
3719 gdb_assert (gdbarch
->auto_wide_charset
!= NULL
);
3720 if (gdbarch_debug
>= 2)
3721 fprintf_unfiltered (gdb_stdlog
, "gdbarch_auto_wide_charset called\n");
3722 return gdbarch
->auto_wide_charset ();
3726 set_gdbarch_auto_wide_charset (struct gdbarch
*gdbarch
,
3727 gdbarch_auto_wide_charset_ftype auto_wide_charset
)
3729 gdbarch
->auto_wide_charset
= auto_wide_charset
;
3733 gdbarch_solib_symbols_extension (struct gdbarch
*gdbarch
)
3735 gdb_assert (gdbarch
!= NULL
);
3736 if (gdbarch_debug
>= 2)
3737 fprintf_unfiltered (gdb_stdlog
, "gdbarch_solib_symbols_extension called\n");
3738 return gdbarch
->solib_symbols_extension
;
3742 set_gdbarch_solib_symbols_extension (struct gdbarch
*gdbarch
,
3743 const char * solib_symbols_extension
)
3745 gdbarch
->solib_symbols_extension
= solib_symbols_extension
;
3749 gdbarch_has_dos_based_file_system (struct gdbarch
*gdbarch
)
3751 gdb_assert (gdbarch
!= NULL
);
3752 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
3753 if (gdbarch_debug
>= 2)
3754 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_dos_based_file_system called\n");
3755 return gdbarch
->has_dos_based_file_system
;
3759 set_gdbarch_has_dos_based_file_system (struct gdbarch
*gdbarch
,
3760 int has_dos_based_file_system
)
3762 gdbarch
->has_dos_based_file_system
= has_dos_based_file_system
;
3766 /* Keep a registry of per-architecture data-pointers required by GDB
3773 gdbarch_data_pre_init_ftype
*pre_init
;
3774 gdbarch_data_post_init_ftype
*post_init
;
3777 struct gdbarch_data_registration
3779 struct gdbarch_data
*data
;
3780 struct gdbarch_data_registration
*next
;
3783 struct gdbarch_data_registry
3786 struct gdbarch_data_registration
*registrations
;
3789 struct gdbarch_data_registry gdbarch_data_registry
=
3794 static struct gdbarch_data
*
3795 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
3796 gdbarch_data_post_init_ftype
*post_init
)
3798 struct gdbarch_data_registration
**curr
;
3800 /* Append the new registration. */
3801 for (curr
= &gdbarch_data_registry
.registrations
;
3803 curr
= &(*curr
)->next
);
3804 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
3805 (*curr
)->next
= NULL
;
3806 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
3807 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
3808 (*curr
)->data
->pre_init
= pre_init
;
3809 (*curr
)->data
->post_init
= post_init
;
3810 (*curr
)->data
->init_p
= 1;
3811 return (*curr
)->data
;
3814 struct gdbarch_data
*
3815 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
3817 return gdbarch_data_register (pre_init
, NULL
);
3820 struct gdbarch_data
*
3821 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
3823 return gdbarch_data_register (NULL
, post_init
);
3826 /* Create/delete the gdbarch data vector. */
3829 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
3831 gdb_assert (gdbarch
->data
== NULL
);
3832 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
3833 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
3836 /* Initialize the current value of the specified per-architecture
3840 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
3841 struct gdbarch_data
*data
,
3844 gdb_assert (data
->index
< gdbarch
->nr_data
);
3845 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
3846 gdb_assert (data
->pre_init
== NULL
);
3847 gdbarch
->data
[data
->index
] = pointer
;
3850 /* Return the current value of the specified per-architecture
3854 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
3856 gdb_assert (data
->index
< gdbarch
->nr_data
);
3857 if (gdbarch
->data
[data
->index
] == NULL
)
3859 /* The data-pointer isn't initialized, call init() to get a
3861 if (data
->pre_init
!= NULL
)
3862 /* Mid architecture creation: pass just the obstack, and not
3863 the entire architecture, as that way it isn't possible for
3864 pre-init code to refer to undefined architecture
3866 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
3867 else if (gdbarch
->initialized_p
3868 && data
->post_init
!= NULL
)
3869 /* Post architecture creation: pass the entire architecture
3870 (as all fields are valid), but be careful to also detect
3871 recursive references. */
3873 gdb_assert (data
->init_p
);
3875 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
3879 /* The architecture initialization hasn't completed - punt -
3880 hope that the caller knows what they are doing. Once
3881 deprecated_set_gdbarch_data has been initialized, this can be
3882 changed to an internal error. */
3884 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
3886 return gdbarch
->data
[data
->index
];
3890 /* Keep a registry of the architectures known by GDB. */
3892 struct gdbarch_registration
3894 enum bfd_architecture bfd_architecture
;
3895 gdbarch_init_ftype
*init
;
3896 gdbarch_dump_tdep_ftype
*dump_tdep
;
3897 struct gdbarch_list
*arches
;
3898 struct gdbarch_registration
*next
;
3901 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
3904 append_name (const char ***buf
, int *nr
, const char *name
)
3906 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
3912 gdbarch_printable_names (void)
3914 /* Accumulate a list of names based on the registed list of
3917 const char **arches
= NULL
;
3918 struct gdbarch_registration
*rego
;
3920 for (rego
= gdbarch_registry
;
3924 const struct bfd_arch_info
*ap
;
3925 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3927 internal_error (__FILE__
, __LINE__
,
3928 _("gdbarch_architecture_names: multi-arch unknown"));
3931 append_name (&arches
, &nr_arches
, ap
->printable_name
);
3936 append_name (&arches
, &nr_arches
, NULL
);
3942 gdbarch_register (enum bfd_architecture bfd_architecture
,
3943 gdbarch_init_ftype
*init
,
3944 gdbarch_dump_tdep_ftype
*dump_tdep
)
3946 struct gdbarch_registration
**curr
;
3947 const struct bfd_arch_info
*bfd_arch_info
;
3949 /* Check that BFD recognizes this architecture */
3950 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
3951 if (bfd_arch_info
== NULL
)
3953 internal_error (__FILE__
, __LINE__
,
3954 _("gdbarch: Attempt to register unknown architecture (%d)"),
3957 /* Check that we haven't seen this architecture before */
3958 for (curr
= &gdbarch_registry
;
3960 curr
= &(*curr
)->next
)
3962 if (bfd_architecture
== (*curr
)->bfd_architecture
)
3963 internal_error (__FILE__
, __LINE__
,
3964 _("gdbarch: Duplicate registraration of architecture (%s)"),
3965 bfd_arch_info
->printable_name
);
3969 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, %s)\n",
3970 bfd_arch_info
->printable_name
,
3971 host_address_to_string (init
));
3973 (*curr
) = XMALLOC (struct gdbarch_registration
);
3974 (*curr
)->bfd_architecture
= bfd_architecture
;
3975 (*curr
)->init
= init
;
3976 (*curr
)->dump_tdep
= dump_tdep
;
3977 (*curr
)->arches
= NULL
;
3978 (*curr
)->next
= NULL
;
3982 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
3983 gdbarch_init_ftype
*init
)
3985 gdbarch_register (bfd_architecture
, init
, NULL
);
3989 /* Look for an architecture using gdbarch_info. */
3991 struct gdbarch_list
*
3992 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
3993 const struct gdbarch_info
*info
)
3995 for (; arches
!= NULL
; arches
= arches
->next
)
3997 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
3999 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
4001 if (info
->osabi
!= arches
->gdbarch
->osabi
)
4003 if (info
->target_desc
!= arches
->gdbarch
->target_desc
)
4011 /* Find an architecture that matches the specified INFO. Create a new
4012 architecture if needed. Return that new architecture. */
4015 gdbarch_find_by_info (struct gdbarch_info info
)
4017 struct gdbarch
*new_gdbarch
;
4018 struct gdbarch_registration
*rego
;
4020 /* Fill in missing parts of the INFO struct using a number of
4021 sources: "set ..."; INFOabfd supplied; and the global
4023 gdbarch_info_fill (&info
);
4025 /* Must have found some sort of architecture. */
4026 gdb_assert (info
.bfd_arch_info
!= NULL
);
4030 fprintf_unfiltered (gdb_stdlog
,
4031 "gdbarch_find_by_info: info.bfd_arch_info %s\n",
4032 (info
.bfd_arch_info
!= NULL
4033 ? info
.bfd_arch_info
->printable_name
4035 fprintf_unfiltered (gdb_stdlog
,
4036 "gdbarch_find_by_info: info.byte_order %d (%s)\n",
4038 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
4039 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
4041 fprintf_unfiltered (gdb_stdlog
,
4042 "gdbarch_find_by_info: info.osabi %d (%s)\n",
4043 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
4044 fprintf_unfiltered (gdb_stdlog
,
4045 "gdbarch_find_by_info: info.abfd %s\n",
4046 host_address_to_string (info
.abfd
));
4047 fprintf_unfiltered (gdb_stdlog
,
4048 "gdbarch_find_by_info: info.tdep_info %s\n",
4049 host_address_to_string (info
.tdep_info
));
4052 /* Find the tdep code that knows about this architecture. */
4053 for (rego
= gdbarch_registry
;
4056 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
4061 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4062 "No matching architecture\n");
4066 /* Ask the tdep code for an architecture that matches "info". */
4067 new_gdbarch
= rego
->init (info
, rego
->arches
);
4069 /* Did the tdep code like it? No. Reject the change and revert to
4070 the old architecture. */
4071 if (new_gdbarch
== NULL
)
4074 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4075 "Target rejected architecture\n");
4079 /* Is this a pre-existing architecture (as determined by already
4080 being initialized)? Move it to the front of the architecture
4081 list (keeping the list sorted Most Recently Used). */
4082 if (new_gdbarch
->initialized_p
)
4084 struct gdbarch_list
**list
;
4085 struct gdbarch_list
*this;
4087 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4088 "Previous architecture %s (%s) selected\n",
4089 host_address_to_string (new_gdbarch
),
4090 new_gdbarch
->bfd_arch_info
->printable_name
);
4091 /* Find the existing arch in the list. */
4092 for (list
= ®o
->arches
;
4093 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
4094 list
= &(*list
)->next
);
4095 /* It had better be in the list of architectures. */
4096 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
4099 (*list
) = this->next
;
4100 /* Insert THIS at the front. */
4101 this->next
= rego
->arches
;
4102 rego
->arches
= this;
4107 /* It's a new architecture. */
4109 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4110 "New architecture %s (%s) selected\n",
4111 host_address_to_string (new_gdbarch
),
4112 new_gdbarch
->bfd_arch_info
->printable_name
);
4114 /* Insert the new architecture into the front of the architecture
4115 list (keep the list sorted Most Recently Used). */
4117 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
4118 this->next
= rego
->arches
;
4119 this->gdbarch
= new_gdbarch
;
4120 rego
->arches
= this;
4123 /* Check that the newly installed architecture is valid. Plug in
4124 any post init values. */
4125 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
4126 verify_gdbarch (new_gdbarch
);
4127 new_gdbarch
->initialized_p
= 1;
4130 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
4135 /* Make the specified architecture current. */
4138 deprecated_target_gdbarch_select_hack (struct gdbarch
*new_gdbarch
)
4140 gdb_assert (new_gdbarch
!= NULL
);
4141 gdb_assert (new_gdbarch
->initialized_p
);
4142 target_gdbarch
= new_gdbarch
;
4143 observer_notify_architecture_changed (new_gdbarch
);
4144 registers_changed ();
4147 extern void _initialize_gdbarch (void);
4150 _initialize_gdbarch (void)
4152 add_setshow_zinteger_cmd ("arch", class_maintenance
, &gdbarch_debug
, _("\
4153 Set architecture debugging."), _("\
4154 Show architecture debugging."), _("\
4155 When non-zero, architecture debugging is enabled."),
4158 &setdebuglist
, &showdebuglist
);