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, 2007
6 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 "gdb-events.h"
48 #include "reggroups.h"
50 #include "gdb_obstack.h"
52 /* Static function declarations */
54 static void alloc_gdbarch_data (struct gdbarch
*);
56 /* Non-zero if we want to trace architecture code. */
59 #define GDBARCH_DEBUG 0
61 int gdbarch_debug
= GDBARCH_DEBUG
;
63 show_gdbarch_debug (struct ui_file
*file
, int from_tty
,
64 struct cmd_list_element
*c
, const char *value
)
66 fprintf_filtered (file
, _("Architecture debugging is %s.\n"), value
);
70 pformat (const struct floatformat
**format
)
75 /* Just print out one of them - this is only for diagnostics. */
76 return format
[0]->name
;
80 /* Maintain the struct gdbarch object */
84 /* Has this architecture been fully initialized? */
87 /* An obstack bound to the lifetime of the architecture. */
88 struct obstack
*obstack
;
90 /* basic architectural information */
91 const struct bfd_arch_info
* bfd_arch_info
;
94 const struct target_desc
* target_desc
;
96 /* target specific vector. */
97 struct gdbarch_tdep
*tdep
;
98 gdbarch_dump_tdep_ftype
*dump_tdep
;
100 /* per-architecture data-pointers */
104 /* per-architecture swap-regions */
105 struct gdbarch_swap
*swap
;
107 /* Multi-arch values.
109 When extending this structure you must:
113 Declare set/get functions and define the corresponding
116 gdbarch_alloc(): If zero/NULL is not a suitable default,
117 initialize the new field.
119 verify_gdbarch(): Confirm that the target updated the field
122 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
125 ``startup_gdbarch()'': Append an initial value to the static
126 variable (base values on the host's c-type system).
128 get_gdbarch(): Implement the set/get functions (probably using
129 the macro's as shortcuts).
139 const struct floatformat
** float_format
;
141 const struct floatformat
** double_format
;
143 const struct floatformat
** long_double_format
;
147 gdbarch_read_pc_ftype
*read_pc
;
148 gdbarch_write_pc_ftype
*write_pc
;
149 gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
;
150 gdbarch_pseudo_register_read_ftype
*pseudo_register_read
;
151 gdbarch_pseudo_register_write_ftype
*pseudo_register_write
;
158 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
159 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
160 gdbarch_dwarf_reg_to_regnum_ftype
*dwarf_reg_to_regnum
;
161 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
162 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
163 gdbarch_register_name_ftype
*register_name
;
164 gdbarch_register_type_ftype
*register_type
;
165 gdbarch_dummy_id_ftype
*dummy_id
;
166 int deprecated_fp_regnum
;
167 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
168 int call_dummy_location
;
169 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
170 gdbarch_print_registers_info_ftype
*print_registers_info
;
171 gdbarch_print_float_info_ftype
*print_float_info
;
172 gdbarch_print_vector_info_ftype
*print_vector_info
;
173 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
174 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
175 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
176 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
177 int believe_pcc_promotion
;
178 gdbarch_convert_register_p_ftype
*convert_register_p
;
179 gdbarch_register_to_value_ftype
*register_to_value
;
180 gdbarch_value_to_register_ftype
*value_to_register
;
181 gdbarch_value_from_register_ftype
*value_from_register
;
182 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
183 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
184 gdbarch_integer_to_address_ftype
*integer_to_address
;
185 gdbarch_return_value_ftype
*return_value
;
186 gdbarch_skip_prologue_ftype
*skip_prologue
;
187 gdbarch_inner_than_ftype
*inner_than
;
188 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
189 gdbarch_adjust_breakpoint_address_ftype
*adjust_breakpoint_address
;
190 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
191 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
192 CORE_ADDR decr_pc_after_break
;
193 CORE_ADDR deprecated_function_start_offset
;
194 gdbarch_remote_register_number_ftype
*remote_register_number
;
195 gdbarch_fetch_tls_load_module_address_ftype
*fetch_tls_load_module_address
;
196 CORE_ADDR frame_args_skip
;
197 gdbarch_unwind_pc_ftype
*unwind_pc
;
198 gdbarch_unwind_sp_ftype
*unwind_sp
;
199 gdbarch_frame_num_args_ftype
*frame_num_args
;
200 gdbarch_frame_align_ftype
*frame_align
;
201 gdbarch_stabs_argument_has_addr_ftype
*stabs_argument_has_addr
;
202 int frame_red_zone_size
;
203 gdbarch_convert_from_func_ptr_addr_ftype
*convert_from_func_ptr_addr
;
204 gdbarch_addr_bits_remove_ftype
*addr_bits_remove
;
205 gdbarch_smash_text_address_ftype
*smash_text_address
;
206 gdbarch_software_single_step_ftype
*software_single_step
;
207 gdbarch_single_step_through_delay_ftype
*single_step_through_delay
;
208 gdbarch_print_insn_ftype
*print_insn
;
209 gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
;
210 gdbarch_skip_solib_resolver_ftype
*skip_solib_resolver
;
211 gdbarch_in_solib_return_trampoline_ftype
*in_solib_return_trampoline
;
212 gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
;
213 gdbarch_construct_inferior_arguments_ftype
*construct_inferior_arguments
;
214 gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
;
215 gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
;
216 const char * name_of_malloc
;
217 int cannot_step_breakpoint
;
218 int have_nonsteppable_watchpoint
;
219 gdbarch_address_class_type_flags_ftype
*address_class_type_flags
;
220 gdbarch_address_class_type_flags_to_name_ftype
*address_class_type_flags_to_name
;
221 gdbarch_address_class_name_to_type_flags_ftype
*address_class_name_to_type_flags
;
222 gdbarch_register_reggroup_p_ftype
*register_reggroup_p
;
223 gdbarch_fetch_pointer_argument_ftype
*fetch_pointer_argument
;
224 gdbarch_regset_from_core_section_ftype
*regset_from_core_section
;
225 gdbarch_core_xfer_shared_libraries_ftype
*core_xfer_shared_libraries
;
226 int vtable_function_descriptors
;
228 gdbarch_skip_permanent_breakpoint_ftype
*skip_permanent_breakpoint
;
229 ULONGEST max_insn_length
;
230 gdbarch_displaced_step_copy_insn_ftype
*displaced_step_copy_insn
;
231 gdbarch_displaced_step_fixup_ftype
*displaced_step_fixup
;
232 gdbarch_displaced_step_free_closure_ftype
*displaced_step_free_closure
;
233 gdbarch_displaced_step_location_ftype
*displaced_step_location
;
234 gdbarch_overlay_update_ftype
*overlay_update
;
235 gdbarch_core_read_description_ftype
*core_read_description
;
236 gdbarch_static_transform_name_ftype
*static_transform_name
;
237 int sofun_address_maybe_missing
;
238 gdbarch_target_signal_from_host_ftype
*target_signal_from_host
;
239 gdbarch_target_signal_to_host_ftype
*target_signal_to_host
;
240 gdbarch_record_special_symbol_ftype
*record_special_symbol
;
244 /* The default architecture uses host values (for want of a better
247 extern const struct bfd_arch_info bfd_default_arch_struct
;
249 struct gdbarch startup_gdbarch
=
251 1, /* Always initialized. */
252 NULL
, /* The obstack. */
253 /* basic architecture information */
254 &bfd_default_arch_struct
, /* bfd_arch_info */
255 BFD_ENDIAN_BIG
, /* byte_order */
256 GDB_OSABI_UNKNOWN
, /* osabi */
258 /* target specific vector and its dump routine */
260 /*per-architecture data-pointers and swap regions */
262 /* Multi-arch values */
263 1, /* bits_big_endian */
264 8 * sizeof (short), /* short_bit */
265 8 * sizeof (int), /* int_bit */
266 8 * sizeof (long), /* long_bit */
267 8 * sizeof (LONGEST
), /* long_long_bit */
268 8 * sizeof (float), /* float_bit */
269 0, /* float_format */
270 8 * sizeof (double), /* double_bit */
271 0, /* double_format */
272 8 * sizeof (long double), /* long_double_bit */
273 0, /* long_double_format */
274 8 * sizeof (void*), /* ptr_bit */
275 8 * sizeof (void*), /* addr_bit */
279 legacy_virtual_frame_pointer
, /* virtual_frame_pointer */
280 0, /* pseudo_register_read */
281 0, /* pseudo_register_write */
283 0, /* num_pseudo_regs */
288 no_op_reg_to_regnum
, /* stab_reg_to_regnum */
289 no_op_reg_to_regnum
, /* ecoff_reg_to_regnum */
290 no_op_reg_to_regnum
, /* dwarf_reg_to_regnum */
291 no_op_reg_to_regnum
, /* sdb_reg_to_regnum */
292 no_op_reg_to_regnum
, /* dwarf2_reg_to_regnum */
293 0, /* register_name */
294 0, /* register_type */
296 -1, /* deprecated_fp_regnum */
297 0, /* push_dummy_call */
298 0, /* call_dummy_location */
299 0, /* push_dummy_code */
300 default_print_registers_info
, /* print_registers_info */
301 0, /* print_float_info */
302 0, /* print_vector_info */
303 legacy_register_sim_regno
, /* register_sim_regno */
304 cannot_register_not
, /* cannot_fetch_register */
305 cannot_register_not
, /* cannot_store_register */
306 0, /* get_longjmp_target */
307 0, /* believe_pcc_promotion */
308 generic_convert_register_p
, /* convert_register_p */
309 0, /* register_to_value */
310 0, /* value_to_register */
311 0, /* value_from_register */
312 0, /* pointer_to_address */
313 0, /* address_to_pointer */
314 0, /* integer_to_address */
315 0, /* return_value */
316 0, /* skip_prologue */
318 0, /* breakpoint_from_pc */
319 0, /* adjust_breakpoint_address */
320 default_memory_insert_breakpoint
, /* memory_insert_breakpoint */
321 default_memory_remove_breakpoint
, /* memory_remove_breakpoint */
322 0, /* decr_pc_after_break */
323 0, /* deprecated_function_start_offset */
324 default_remote_register_number
, /* remote_register_number */
325 0, /* fetch_tls_load_module_address */
326 0, /* frame_args_skip */
329 0, /* frame_num_args */
331 default_stabs_argument_has_addr
, /* stabs_argument_has_addr */
332 0, /* frame_red_zone_size */
333 convert_from_func_ptr_addr_identity
, /* convert_from_func_ptr_addr */
334 0, /* addr_bits_remove */
335 0, /* smash_text_address */
336 0, /* software_single_step */
337 0, /* single_step_through_delay */
339 0, /* skip_trampoline_code */
340 generic_skip_solib_resolver
, /* skip_solib_resolver */
341 0, /* in_solib_return_trampoline */
342 generic_in_function_epilogue_p
, /* in_function_epilogue_p */
343 construct_inferior_arguments
, /* construct_inferior_arguments */
344 0, /* elf_make_msymbol_special */
345 0, /* coff_make_msymbol_special */
346 "malloc", /* name_of_malloc */
347 0, /* cannot_step_breakpoint */
348 0, /* have_nonsteppable_watchpoint */
349 0, /* address_class_type_flags */
350 0, /* address_class_type_flags_to_name */
351 0, /* address_class_name_to_type_flags */
352 default_register_reggroup_p
, /* register_reggroup_p */
353 0, /* fetch_pointer_argument */
354 0, /* regset_from_core_section */
355 0, /* core_xfer_shared_libraries */
356 0, /* vtable_function_descriptors */
357 0, /* vbit_in_delta */
358 0, /* skip_permanent_breakpoint */
359 0, /* max_insn_length */
360 0, /* displaced_step_copy_insn */
361 0, /* displaced_step_fixup */
362 NULL
, /* displaced_step_free_closure */
363 NULL
, /* displaced_step_location */
364 0, /* overlay_update */
365 0, /* core_read_description */
366 0, /* static_transform_name */
367 0, /* sofun_address_maybe_missing */
368 default_target_signal_from_host
, /* target_signal_from_host */
369 default_target_signal_to_host
, /* target_signal_to_host */
370 0, /* record_special_symbol */
371 /* startup_gdbarch() */
374 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
376 /* Create a new ``struct gdbarch'' based on information provided by
377 ``struct gdbarch_info''. */
380 gdbarch_alloc (const struct gdbarch_info
*info
,
381 struct gdbarch_tdep
*tdep
)
383 struct gdbarch
*gdbarch
;
385 /* Create an obstack for allocating all the per-architecture memory,
386 then use that to allocate the architecture vector. */
387 struct obstack
*obstack
= XMALLOC (struct obstack
);
388 obstack_init (obstack
);
389 gdbarch
= obstack_alloc (obstack
, sizeof (*gdbarch
));
390 memset (gdbarch
, 0, sizeof (*gdbarch
));
391 gdbarch
->obstack
= obstack
;
393 alloc_gdbarch_data (gdbarch
);
395 gdbarch
->tdep
= tdep
;
397 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
398 gdbarch
->byte_order
= info
->byte_order
;
399 gdbarch
->osabi
= info
->osabi
;
400 gdbarch
->target_desc
= info
->target_desc
;
402 /* Force the explicit initialization of these. */
403 gdbarch
->bits_big_endian
= (gdbarch
->byte_order
== BFD_ENDIAN_BIG
);
404 gdbarch
->short_bit
= 2*TARGET_CHAR_BIT
;
405 gdbarch
->int_bit
= 4*TARGET_CHAR_BIT
;
406 gdbarch
->long_bit
= 4*TARGET_CHAR_BIT
;
407 gdbarch
->long_long_bit
= 2*gdbarch
->long_bit
;
408 gdbarch
->float_bit
= 4*TARGET_CHAR_BIT
;
409 gdbarch
->double_bit
= 8*TARGET_CHAR_BIT
;
410 gdbarch
->long_double_bit
= 8*TARGET_CHAR_BIT
;
411 gdbarch
->ptr_bit
= gdbarch
->int_bit
;
412 gdbarch
->char_signed
= -1;
413 gdbarch
->virtual_frame_pointer
= legacy_virtual_frame_pointer
;
414 gdbarch
->num_regs
= -1;
415 gdbarch
->sp_regnum
= -1;
416 gdbarch
->pc_regnum
= -1;
417 gdbarch
->ps_regnum
= -1;
418 gdbarch
->fp0_regnum
= -1;
419 gdbarch
->stab_reg_to_regnum
= no_op_reg_to_regnum
;
420 gdbarch
->ecoff_reg_to_regnum
= no_op_reg_to_regnum
;
421 gdbarch
->dwarf_reg_to_regnum
= no_op_reg_to_regnum
;
422 gdbarch
->sdb_reg_to_regnum
= no_op_reg_to_regnum
;
423 gdbarch
->dwarf2_reg_to_regnum
= no_op_reg_to_regnum
;
424 gdbarch
->deprecated_fp_regnum
= -1;
425 gdbarch
->call_dummy_location
= AT_ENTRY_POINT
;
426 gdbarch
->print_registers_info
= default_print_registers_info
;
427 gdbarch
->register_sim_regno
= legacy_register_sim_regno
;
428 gdbarch
->cannot_fetch_register
= cannot_register_not
;
429 gdbarch
->cannot_store_register
= cannot_register_not
;
430 gdbarch
->convert_register_p
= generic_convert_register_p
;
431 gdbarch
->value_from_register
= default_value_from_register
;
432 gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
433 gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
434 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
435 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
436 gdbarch
->remote_register_number
= default_remote_register_number
;
437 gdbarch
->stabs_argument_has_addr
= default_stabs_argument_has_addr
;
438 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr_identity
;
439 gdbarch
->addr_bits_remove
= core_addr_identity
;
440 gdbarch
->smash_text_address
= core_addr_identity
;
441 gdbarch
->skip_trampoline_code
= generic_skip_trampoline_code
;
442 gdbarch
->skip_solib_resolver
= generic_skip_solib_resolver
;
443 gdbarch
->in_solib_return_trampoline
= generic_in_solib_return_trampoline
;
444 gdbarch
->in_function_epilogue_p
= generic_in_function_epilogue_p
;
445 gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
446 gdbarch
->elf_make_msymbol_special
= default_elf_make_msymbol_special
;
447 gdbarch
->coff_make_msymbol_special
= default_coff_make_msymbol_special
;
448 gdbarch
->name_of_malloc
= "malloc";
449 gdbarch
->register_reggroup_p
= default_register_reggroup_p
;
450 gdbarch
->displaced_step_fixup
= NULL
;
451 gdbarch
->displaced_step_free_closure
= NULL
;
452 gdbarch
->displaced_step_location
= NULL
;
453 gdbarch
->target_signal_from_host
= default_target_signal_from_host
;
454 gdbarch
->target_signal_to_host
= default_target_signal_to_host
;
455 /* gdbarch_alloc() */
461 /* Allocate extra space using the per-architecture obstack. */
464 gdbarch_obstack_zalloc (struct gdbarch
*arch
, long size
)
466 void *data
= obstack_alloc (arch
->obstack
, size
);
467 memset (data
, 0, size
);
472 /* Free a gdbarch struct. This should never happen in normal
473 operation --- once you've created a gdbarch, you keep it around.
474 However, if an architecture's init function encounters an error
475 building the structure, it may need to clean up a partially
476 constructed gdbarch. */
479 gdbarch_free (struct gdbarch
*arch
)
481 struct obstack
*obstack
;
482 gdb_assert (arch
!= NULL
);
483 gdb_assert (!arch
->initialized_p
);
484 obstack
= arch
->obstack
;
485 obstack_free (obstack
, 0); /* Includes the ARCH. */
490 /* Ensure that all values in a GDBARCH are reasonable. */
493 verify_gdbarch (struct gdbarch
*gdbarch
)
496 struct cleanup
*cleanups
;
499 log
= mem_fileopen ();
500 cleanups
= make_cleanup_ui_file_delete (log
);
502 if (gdbarch
->byte_order
== BFD_ENDIAN_UNKNOWN
)
503 fprintf_unfiltered (log
, "\n\tbyte-order");
504 if (gdbarch
->bfd_arch_info
== NULL
)
505 fprintf_unfiltered (log
, "\n\tbfd_arch_info");
506 /* Check those that need to be defined for the given multi-arch level. */
507 /* Skip verify of bits_big_endian, invalid_p == 0 */
508 /* Skip verify of short_bit, invalid_p == 0 */
509 /* Skip verify of int_bit, invalid_p == 0 */
510 /* Skip verify of long_bit, invalid_p == 0 */
511 /* Skip verify of long_long_bit, invalid_p == 0 */
512 /* Skip verify of float_bit, invalid_p == 0 */
513 if (gdbarch
->float_format
== 0)
514 gdbarch
->float_format
= floatformats_ieee_single
;
515 /* Skip verify of double_bit, invalid_p == 0 */
516 if (gdbarch
->double_format
== 0)
517 gdbarch
->double_format
= floatformats_ieee_double
;
518 /* Skip verify of long_double_bit, invalid_p == 0 */
519 if (gdbarch
->long_double_format
== 0)
520 gdbarch
->long_double_format
= floatformats_ieee_double
;
521 /* Skip verify of ptr_bit, invalid_p == 0 */
522 if (gdbarch
->addr_bit
== 0)
523 gdbarch
->addr_bit
= gdbarch_ptr_bit (gdbarch
);
524 if (gdbarch
->char_signed
== -1)
525 gdbarch
->char_signed
= 1;
526 /* Skip verify of read_pc, has predicate */
527 /* Skip verify of write_pc, has predicate */
528 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
529 /* Skip verify of pseudo_register_read, has predicate */
530 /* Skip verify of pseudo_register_write, has predicate */
531 if (gdbarch
->num_regs
== -1)
532 fprintf_unfiltered (log
, "\n\tnum_regs");
533 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
534 /* Skip verify of sp_regnum, invalid_p == 0 */
535 /* Skip verify of pc_regnum, invalid_p == 0 */
536 /* Skip verify of ps_regnum, invalid_p == 0 */
537 /* Skip verify of fp0_regnum, invalid_p == 0 */
538 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
539 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
540 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
541 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
542 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
543 if (gdbarch
->register_name
== 0)
544 fprintf_unfiltered (log
, "\n\tregister_name");
545 /* Skip verify of register_type, has predicate */
546 /* Skip verify of dummy_id, has predicate */
547 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
548 /* Skip verify of push_dummy_call, has predicate */
549 /* Skip verify of call_dummy_location, invalid_p == 0 */
550 /* Skip verify of push_dummy_code, has predicate */
551 /* Skip verify of print_registers_info, invalid_p == 0 */
552 /* Skip verify of print_float_info, has predicate */
553 /* Skip verify of print_vector_info, has predicate */
554 /* Skip verify of register_sim_regno, invalid_p == 0 */
555 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
556 /* Skip verify of cannot_store_register, invalid_p == 0 */
557 /* Skip verify of get_longjmp_target, has predicate */
558 /* Skip verify of convert_register_p, invalid_p == 0 */
559 /* Skip verify of value_from_register, invalid_p == 0 */
560 /* Skip verify of pointer_to_address, invalid_p == 0 */
561 /* Skip verify of address_to_pointer, invalid_p == 0 */
562 /* Skip verify of integer_to_address, has predicate */
563 /* Skip verify of return_value, has predicate */
564 if (gdbarch
->skip_prologue
== 0)
565 fprintf_unfiltered (log
, "\n\tskip_prologue");
566 if (gdbarch
->inner_than
== 0)
567 fprintf_unfiltered (log
, "\n\tinner_than");
568 if (gdbarch
->breakpoint_from_pc
== 0)
569 fprintf_unfiltered (log
, "\n\tbreakpoint_from_pc");
570 /* Skip verify of adjust_breakpoint_address, has predicate */
571 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
572 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
573 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
574 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
575 /* Skip verify of remote_register_number, invalid_p == 0 */
576 /* Skip verify of fetch_tls_load_module_address, has predicate */
577 /* Skip verify of frame_args_skip, invalid_p == 0 */
578 /* Skip verify of unwind_pc, has predicate */
579 /* Skip verify of unwind_sp, has predicate */
580 /* Skip verify of frame_num_args, has predicate */
581 /* Skip verify of frame_align, has predicate */
582 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
583 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
584 /* Skip verify of addr_bits_remove, invalid_p == 0 */
585 /* Skip verify of smash_text_address, invalid_p == 0 */
586 /* Skip verify of software_single_step, has predicate */
587 /* Skip verify of single_step_through_delay, has predicate */
588 if (gdbarch
->print_insn
== 0)
589 fprintf_unfiltered (log
, "\n\tprint_insn");
590 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
591 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
592 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
593 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
594 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
595 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
596 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
597 /* Skip verify of name_of_malloc, invalid_p == 0 */
598 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
599 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
600 /* Skip verify of address_class_type_flags, has predicate */
601 /* Skip verify of address_class_type_flags_to_name, has predicate */
602 /* Skip verify of address_class_name_to_type_flags, has predicate */
603 /* Skip verify of register_reggroup_p, invalid_p == 0 */
604 /* Skip verify of fetch_pointer_argument, has predicate */
605 /* Skip verify of regset_from_core_section, has predicate */
606 /* Skip verify of core_xfer_shared_libraries, has predicate */
607 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
608 /* Skip verify of vbit_in_delta, invalid_p == 0 */
609 /* Skip verify of skip_permanent_breakpoint, has predicate */
610 /* Skip verify of max_insn_length, has predicate */
611 /* Skip verify of displaced_step_copy_insn, has predicate */
612 /* Skip verify of displaced_step_fixup, has predicate */
613 if ((! gdbarch
->displaced_step_free_closure
) != (! gdbarch
->displaced_step_copy_insn
))
614 fprintf_unfiltered (log
, "\n\tdisplaced_step_free_closure");
615 if ((! gdbarch
->displaced_step_location
) != (! gdbarch
->displaced_step_copy_insn
))
616 fprintf_unfiltered (log
, "\n\tdisplaced_step_location");
617 /* Skip verify of overlay_update, has predicate */
618 /* Skip verify of core_read_description, has predicate */
619 /* Skip verify of static_transform_name, has predicate */
620 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
621 /* Skip verify of target_signal_from_host, invalid_p == 0 */
622 /* Skip verify of target_signal_to_host, invalid_p == 0 */
623 /* Skip verify of record_special_symbol, has predicate */
624 buf
= ui_file_xstrdup (log
, &dummy
);
625 make_cleanup (xfree
, buf
);
626 if (strlen (buf
) > 0)
627 internal_error (__FILE__
, __LINE__
,
628 _("verify_gdbarch: the following are invalid ...%s"),
630 do_cleanups (cleanups
);
634 /* Print out the details of the current architecture. */
637 gdbarch_dump (struct gdbarch
*gdbarch
, struct ui_file
*file
)
639 const char *gdb_nm_file
= "<not-defined>";
640 #if defined (GDB_NM_FILE)
641 gdb_nm_file
= GDB_NM_FILE
;
643 fprintf_unfiltered (file
,
644 "gdbarch_dump: GDB_NM_FILE = %s\n",
646 fprintf_unfiltered (file
,
647 "gdbarch_dump: addr_bit = %s\n",
648 paddr_d (gdbarch
->addr_bit
));
649 fprintf_unfiltered (file
,
650 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
651 (long) gdbarch
->addr_bits_remove
);
652 fprintf_unfiltered (file
,
653 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
654 gdbarch_address_class_name_to_type_flags_p (gdbarch
));
655 fprintf_unfiltered (file
,
656 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
657 (long) gdbarch
->address_class_name_to_type_flags
);
658 fprintf_unfiltered (file
,
659 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
660 gdbarch_address_class_type_flags_p (gdbarch
));
661 fprintf_unfiltered (file
,
662 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
663 (long) gdbarch
->address_class_type_flags
);
664 fprintf_unfiltered (file
,
665 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
666 gdbarch_address_class_type_flags_to_name_p (gdbarch
));
667 fprintf_unfiltered (file
,
668 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
669 (long) gdbarch
->address_class_type_flags_to_name
);
670 fprintf_unfiltered (file
,
671 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
672 (long) gdbarch
->address_to_pointer
);
673 fprintf_unfiltered (file
,
674 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
675 gdbarch_adjust_breakpoint_address_p (gdbarch
));
676 fprintf_unfiltered (file
,
677 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
678 (long) gdbarch
->adjust_breakpoint_address
);
679 fprintf_unfiltered (file
,
680 "gdbarch_dump: believe_pcc_promotion = %s\n",
681 paddr_d (gdbarch
->believe_pcc_promotion
));
682 fprintf_unfiltered (file
,
683 "gdbarch_dump: bfd_arch_info = %s\n",
684 gdbarch_bfd_arch_info (gdbarch
)->printable_name
);
685 fprintf_unfiltered (file
,
686 "gdbarch_dump: bits_big_endian = %s\n",
687 paddr_d (gdbarch
->bits_big_endian
));
688 fprintf_unfiltered (file
,
689 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
690 (long) gdbarch
->breakpoint_from_pc
);
691 fprintf_unfiltered (file
,
692 "gdbarch_dump: byte_order = %s\n",
693 paddr_d (gdbarch
->byte_order
));
694 fprintf_unfiltered (file
,
695 "gdbarch_dump: call_dummy_location = %s\n",
696 paddr_d (gdbarch
->call_dummy_location
));
697 fprintf_unfiltered (file
,
698 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
699 (long) gdbarch
->cannot_fetch_register
);
700 fprintf_unfiltered (file
,
701 "gdbarch_dump: cannot_step_breakpoint = %s\n",
702 paddr_d (gdbarch
->cannot_step_breakpoint
));
703 fprintf_unfiltered (file
,
704 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
705 (long) gdbarch
->cannot_store_register
);
706 fprintf_unfiltered (file
,
707 "gdbarch_dump: char_signed = %s\n",
708 paddr_d (gdbarch
->char_signed
));
709 fprintf_unfiltered (file
,
710 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
711 (long) gdbarch
->coff_make_msymbol_special
);
712 fprintf_unfiltered (file
,
713 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
714 (long) gdbarch
->construct_inferior_arguments
);
715 fprintf_unfiltered (file
,
716 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
717 (long) gdbarch
->convert_from_func_ptr_addr
);
718 fprintf_unfiltered (file
,
719 "gdbarch_dump: convert_register_p = <0x%lx>\n",
720 (long) gdbarch
->convert_register_p
);
721 fprintf_unfiltered (file
,
722 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
723 gdbarch_core_read_description_p (gdbarch
));
724 fprintf_unfiltered (file
,
725 "gdbarch_dump: core_read_description = <0x%lx>\n",
726 (long) gdbarch
->core_read_description
);
727 fprintf_unfiltered (file
,
728 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
729 gdbarch_core_xfer_shared_libraries_p (gdbarch
));
730 fprintf_unfiltered (file
,
731 "gdbarch_dump: core_xfer_shared_libraries = <0x%lx>\n",
732 (long) gdbarch
->core_xfer_shared_libraries
);
733 fprintf_unfiltered (file
,
734 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
735 paddr_nz (gdbarch
->decr_pc_after_break
));
736 fprintf_unfiltered (file
,
737 "gdbarch_dump: deprecated_fp_regnum = %s\n",
738 paddr_d (gdbarch
->deprecated_fp_regnum
));
739 fprintf_unfiltered (file
,
740 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
741 paddr_nz (gdbarch
->deprecated_function_start_offset
));
742 fprintf_unfiltered (file
,
743 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
744 gdbarch_displaced_step_copy_insn_p (gdbarch
));
745 fprintf_unfiltered (file
,
746 "gdbarch_dump: displaced_step_copy_insn = <0x%lx>\n",
747 (long) gdbarch
->displaced_step_copy_insn
);
748 fprintf_unfiltered (file
,
749 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
750 gdbarch_displaced_step_fixup_p (gdbarch
));
751 fprintf_unfiltered (file
,
752 "gdbarch_dump: displaced_step_fixup = <0x%lx>\n",
753 (long) gdbarch
->displaced_step_fixup
);
754 fprintf_unfiltered (file
,
755 "gdbarch_dump: displaced_step_free_closure = <0x%lx>\n",
756 (long) gdbarch
->displaced_step_free_closure
);
757 fprintf_unfiltered (file
,
758 "gdbarch_dump: displaced_step_location = <0x%lx>\n",
759 (long) gdbarch
->displaced_step_location
);
760 fprintf_unfiltered (file
,
761 "gdbarch_dump: double_bit = %s\n",
762 paddr_d (gdbarch
->double_bit
));
763 fprintf_unfiltered (file
,
764 "gdbarch_dump: double_format = %s\n",
765 pformat (gdbarch
->double_format
));
766 fprintf_unfiltered (file
,
767 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
768 gdbarch_dummy_id_p (gdbarch
));
769 fprintf_unfiltered (file
,
770 "gdbarch_dump: dummy_id = <0x%lx>\n",
771 (long) gdbarch
->dummy_id
);
772 fprintf_unfiltered (file
,
773 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
774 (long) gdbarch
->dwarf2_reg_to_regnum
);
775 fprintf_unfiltered (file
,
776 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
777 (long) gdbarch
->dwarf_reg_to_regnum
);
778 fprintf_unfiltered (file
,
779 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
780 (long) gdbarch
->ecoff_reg_to_regnum
);
781 fprintf_unfiltered (file
,
782 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
783 (long) gdbarch
->elf_make_msymbol_special
);
784 fprintf_unfiltered (file
,
785 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
786 gdbarch_fetch_pointer_argument_p (gdbarch
));
787 fprintf_unfiltered (file
,
788 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
789 (long) gdbarch
->fetch_pointer_argument
);
790 fprintf_unfiltered (file
,
791 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
792 gdbarch_fetch_tls_load_module_address_p (gdbarch
));
793 fprintf_unfiltered (file
,
794 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
795 (long) gdbarch
->fetch_tls_load_module_address
);
796 fprintf_unfiltered (file
,
797 "gdbarch_dump: float_bit = %s\n",
798 paddr_d (gdbarch
->float_bit
));
799 fprintf_unfiltered (file
,
800 "gdbarch_dump: float_format = %s\n",
801 pformat (gdbarch
->float_format
));
802 fprintf_unfiltered (file
,
803 "gdbarch_dump: fp0_regnum = %s\n",
804 paddr_d (gdbarch
->fp0_regnum
));
805 fprintf_unfiltered (file
,
806 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
807 gdbarch_frame_align_p (gdbarch
));
808 fprintf_unfiltered (file
,
809 "gdbarch_dump: frame_align = <0x%lx>\n",
810 (long) gdbarch
->frame_align
);
811 fprintf_unfiltered (file
,
812 "gdbarch_dump: frame_args_skip = 0x%s\n",
813 paddr_nz (gdbarch
->frame_args_skip
));
814 fprintf_unfiltered (file
,
815 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
816 gdbarch_frame_num_args_p (gdbarch
));
817 fprintf_unfiltered (file
,
818 "gdbarch_dump: frame_num_args = <0x%lx>\n",
819 (long) gdbarch
->frame_num_args
);
820 fprintf_unfiltered (file
,
821 "gdbarch_dump: frame_red_zone_size = %s\n",
822 paddr_d (gdbarch
->frame_red_zone_size
));
823 fprintf_unfiltered (file
,
824 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
825 gdbarch_get_longjmp_target_p (gdbarch
));
826 fprintf_unfiltered (file
,
827 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
828 (long) gdbarch
->get_longjmp_target
);
829 fprintf_unfiltered (file
,
830 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
831 paddr_d (gdbarch
->have_nonsteppable_watchpoint
));
832 fprintf_unfiltered (file
,
833 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
834 (long) gdbarch
->in_function_epilogue_p
);
835 fprintf_unfiltered (file
,
836 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
837 (long) gdbarch
->in_solib_return_trampoline
);
838 fprintf_unfiltered (file
,
839 "gdbarch_dump: inner_than = <0x%lx>\n",
840 (long) gdbarch
->inner_than
);
841 fprintf_unfiltered (file
,
842 "gdbarch_dump: int_bit = %s\n",
843 paddr_d (gdbarch
->int_bit
));
844 fprintf_unfiltered (file
,
845 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
846 gdbarch_integer_to_address_p (gdbarch
));
847 fprintf_unfiltered (file
,
848 "gdbarch_dump: integer_to_address = <0x%lx>\n",
849 (long) gdbarch
->integer_to_address
);
850 fprintf_unfiltered (file
,
851 "gdbarch_dump: long_bit = %s\n",
852 paddr_d (gdbarch
->long_bit
));
853 fprintf_unfiltered (file
,
854 "gdbarch_dump: long_double_bit = %s\n",
855 paddr_d (gdbarch
->long_double_bit
));
856 fprintf_unfiltered (file
,
857 "gdbarch_dump: long_double_format = %s\n",
858 pformat (gdbarch
->long_double_format
));
859 fprintf_unfiltered (file
,
860 "gdbarch_dump: long_long_bit = %s\n",
861 paddr_d (gdbarch
->long_long_bit
));
862 fprintf_unfiltered (file
,
863 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
864 gdbarch_max_insn_length_p (gdbarch
));
865 fprintf_unfiltered (file
,
866 "gdbarch_dump: max_insn_length = %s\n",
867 paddr_d (gdbarch
->max_insn_length
));
868 fprintf_unfiltered (file
,
869 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
870 (long) gdbarch
->memory_insert_breakpoint
);
871 fprintf_unfiltered (file
,
872 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
873 (long) gdbarch
->memory_remove_breakpoint
);
874 fprintf_unfiltered (file
,
875 "gdbarch_dump: name_of_malloc = %s\n",
876 gdbarch
->name_of_malloc
);
877 fprintf_unfiltered (file
,
878 "gdbarch_dump: num_pseudo_regs = %s\n",
879 paddr_d (gdbarch
->num_pseudo_regs
));
880 fprintf_unfiltered (file
,
881 "gdbarch_dump: num_regs = %s\n",
882 paddr_d (gdbarch
->num_regs
));
883 fprintf_unfiltered (file
,
884 "gdbarch_dump: osabi = %s\n",
885 paddr_d (gdbarch
->osabi
));
886 fprintf_unfiltered (file
,
887 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
888 gdbarch_overlay_update_p (gdbarch
));
889 fprintf_unfiltered (file
,
890 "gdbarch_dump: overlay_update = <0x%lx>\n",
891 (long) gdbarch
->overlay_update
);
892 fprintf_unfiltered (file
,
893 "gdbarch_dump: pc_regnum = %s\n",
894 paddr_d (gdbarch
->pc_regnum
));
895 fprintf_unfiltered (file
,
896 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
897 (long) gdbarch
->pointer_to_address
);
898 fprintf_unfiltered (file
,
899 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
900 gdbarch_print_float_info_p (gdbarch
));
901 fprintf_unfiltered (file
,
902 "gdbarch_dump: print_float_info = <0x%lx>\n",
903 (long) gdbarch
->print_float_info
);
904 fprintf_unfiltered (file
,
905 "gdbarch_dump: print_insn = <0x%lx>\n",
906 (long) gdbarch
->print_insn
);
907 fprintf_unfiltered (file
,
908 "gdbarch_dump: print_registers_info = <0x%lx>\n",
909 (long) gdbarch
->print_registers_info
);
910 fprintf_unfiltered (file
,
911 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
912 gdbarch_print_vector_info_p (gdbarch
));
913 fprintf_unfiltered (file
,
914 "gdbarch_dump: print_vector_info = <0x%lx>\n",
915 (long) gdbarch
->print_vector_info
);
916 fprintf_unfiltered (file
,
917 "gdbarch_dump: ps_regnum = %s\n",
918 paddr_d (gdbarch
->ps_regnum
));
919 fprintf_unfiltered (file
,
920 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
921 gdbarch_pseudo_register_read_p (gdbarch
));
922 fprintf_unfiltered (file
,
923 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
924 (long) gdbarch
->pseudo_register_read
);
925 fprintf_unfiltered (file
,
926 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
927 gdbarch_pseudo_register_write_p (gdbarch
));
928 fprintf_unfiltered (file
,
929 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
930 (long) gdbarch
->pseudo_register_write
);
931 fprintf_unfiltered (file
,
932 "gdbarch_dump: ptr_bit = %s\n",
933 paddr_d (gdbarch
->ptr_bit
));
934 fprintf_unfiltered (file
,
935 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
936 gdbarch_push_dummy_call_p (gdbarch
));
937 fprintf_unfiltered (file
,
938 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
939 (long) gdbarch
->push_dummy_call
);
940 fprintf_unfiltered (file
,
941 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
942 gdbarch_push_dummy_code_p (gdbarch
));
943 fprintf_unfiltered (file
,
944 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
945 (long) gdbarch
->push_dummy_code
);
946 fprintf_unfiltered (file
,
947 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
948 gdbarch_read_pc_p (gdbarch
));
949 fprintf_unfiltered (file
,
950 "gdbarch_dump: read_pc = <0x%lx>\n",
951 (long) gdbarch
->read_pc
);
952 fprintf_unfiltered (file
,
953 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
954 gdbarch_record_special_symbol_p (gdbarch
));
955 fprintf_unfiltered (file
,
956 "gdbarch_dump: record_special_symbol = <0x%lx>\n",
957 (long) gdbarch
->record_special_symbol
);
958 fprintf_unfiltered (file
,
959 "gdbarch_dump: register_name = <0x%lx>\n",
960 (long) gdbarch
->register_name
);
961 fprintf_unfiltered (file
,
962 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
963 (long) gdbarch
->register_reggroup_p
);
964 fprintf_unfiltered (file
,
965 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
966 (long) gdbarch
->register_sim_regno
);
967 fprintf_unfiltered (file
,
968 "gdbarch_dump: register_to_value = <0x%lx>\n",
969 (long) gdbarch
->register_to_value
);
970 fprintf_unfiltered (file
,
971 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
972 gdbarch_register_type_p (gdbarch
));
973 fprintf_unfiltered (file
,
974 "gdbarch_dump: register_type = <0x%lx>\n",
975 (long) gdbarch
->register_type
);
976 fprintf_unfiltered (file
,
977 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
978 gdbarch_regset_from_core_section_p (gdbarch
));
979 fprintf_unfiltered (file
,
980 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
981 (long) gdbarch
->regset_from_core_section
);
982 fprintf_unfiltered (file
,
983 "gdbarch_dump: remote_register_number = <0x%lx>\n",
984 (long) gdbarch
->remote_register_number
);
985 fprintf_unfiltered (file
,
986 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
987 gdbarch_return_value_p (gdbarch
));
988 fprintf_unfiltered (file
,
989 "gdbarch_dump: return_value = <0x%lx>\n",
990 (long) gdbarch
->return_value
);
991 fprintf_unfiltered (file
,
992 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
993 (long) gdbarch
->sdb_reg_to_regnum
);
994 fprintf_unfiltered (file
,
995 "gdbarch_dump: short_bit = %s\n",
996 paddr_d (gdbarch
->short_bit
));
997 fprintf_unfiltered (file
,
998 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
999 gdbarch_single_step_through_delay_p (gdbarch
));
1000 fprintf_unfiltered (file
,
1001 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
1002 (long) gdbarch
->single_step_through_delay
);
1003 fprintf_unfiltered (file
,
1004 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1005 gdbarch_skip_permanent_breakpoint_p (gdbarch
));
1006 fprintf_unfiltered (file
,
1007 "gdbarch_dump: skip_permanent_breakpoint = <0x%lx>\n",
1008 (long) gdbarch
->skip_permanent_breakpoint
);
1009 fprintf_unfiltered (file
,
1010 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1011 (long) gdbarch
->skip_prologue
);
1012 fprintf_unfiltered (file
,
1013 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1014 (long) gdbarch
->skip_solib_resolver
);
1015 fprintf_unfiltered (file
,
1016 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1017 (long) gdbarch
->skip_trampoline_code
);
1018 fprintf_unfiltered (file
,
1019 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1020 (long) gdbarch
->smash_text_address
);
1021 fprintf_unfiltered (file
,
1022 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1023 gdbarch_software_single_step_p (gdbarch
));
1024 fprintf_unfiltered (file
,
1025 "gdbarch_dump: software_single_step = <0x%lx>\n",
1026 (long) gdbarch
->software_single_step
);
1027 fprintf_unfiltered (file
,
1028 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1029 paddr_d (gdbarch
->sofun_address_maybe_missing
));
1030 fprintf_unfiltered (file
,
1031 "gdbarch_dump: sp_regnum = %s\n",
1032 paddr_d (gdbarch
->sp_regnum
));
1033 fprintf_unfiltered (file
,
1034 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1035 (long) gdbarch
->stab_reg_to_regnum
);
1036 fprintf_unfiltered (file
,
1037 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1038 (long) gdbarch
->stabs_argument_has_addr
);
1039 fprintf_unfiltered (file
,
1040 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1041 gdbarch_static_transform_name_p (gdbarch
));
1042 fprintf_unfiltered (file
,
1043 "gdbarch_dump: static_transform_name = <0x%lx>\n",
1044 (long) gdbarch
->static_transform_name
);
1045 fprintf_unfiltered (file
,
1046 "gdbarch_dump: target_desc = %s\n",
1047 paddr_d ((long) gdbarch
->target_desc
));
1048 fprintf_unfiltered (file
,
1049 "gdbarch_dump: target_signal_from_host = <0x%lx>\n",
1050 (long) gdbarch
->target_signal_from_host
);
1051 fprintf_unfiltered (file
,
1052 "gdbarch_dump: target_signal_to_host = <0x%lx>\n",
1053 (long) gdbarch
->target_signal_to_host
);
1054 fprintf_unfiltered (file
,
1055 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1056 gdbarch_unwind_pc_p (gdbarch
));
1057 fprintf_unfiltered (file
,
1058 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1059 (long) gdbarch
->unwind_pc
);
1060 fprintf_unfiltered (file
,
1061 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1062 gdbarch_unwind_sp_p (gdbarch
));
1063 fprintf_unfiltered (file
,
1064 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1065 (long) gdbarch
->unwind_sp
);
1066 fprintf_unfiltered (file
,
1067 "gdbarch_dump: value_from_register = <0x%lx>\n",
1068 (long) gdbarch
->value_from_register
);
1069 fprintf_unfiltered (file
,
1070 "gdbarch_dump: value_to_register = <0x%lx>\n",
1071 (long) gdbarch
->value_to_register
);
1072 fprintf_unfiltered (file
,
1073 "gdbarch_dump: vbit_in_delta = %s\n",
1074 paddr_d (gdbarch
->vbit_in_delta
));
1075 fprintf_unfiltered (file
,
1076 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1077 (long) gdbarch
->virtual_frame_pointer
);
1078 fprintf_unfiltered (file
,
1079 "gdbarch_dump: vtable_function_descriptors = %s\n",
1080 paddr_d (gdbarch
->vtable_function_descriptors
));
1081 fprintf_unfiltered (file
,
1082 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1083 gdbarch_write_pc_p (gdbarch
));
1084 fprintf_unfiltered (file
,
1085 "gdbarch_dump: write_pc = <0x%lx>\n",
1086 (long) gdbarch
->write_pc
);
1087 if (gdbarch
->dump_tdep
!= NULL
)
1088 gdbarch
->dump_tdep (gdbarch
, file
);
1091 struct gdbarch_tdep
*
1092 gdbarch_tdep (struct gdbarch
*gdbarch
)
1094 if (gdbarch_debug
>= 2)
1095 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1096 return gdbarch
->tdep
;
1100 const struct bfd_arch_info
*
1101 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1103 gdb_assert (gdbarch
!= NULL
);
1104 if (gdbarch_debug
>= 2)
1105 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1106 return gdbarch
->bfd_arch_info
;
1110 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1112 gdb_assert (gdbarch
!= NULL
);
1113 if (gdbarch_debug
>= 2)
1114 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1115 return gdbarch
->byte_order
;
1119 gdbarch_osabi (struct gdbarch
*gdbarch
)
1121 gdb_assert (gdbarch
!= NULL
);
1122 if (gdbarch_debug
>= 2)
1123 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1124 return gdbarch
->osabi
;
1127 const struct target_desc
*
1128 gdbarch_target_desc (struct gdbarch
*gdbarch
)
1130 gdb_assert (gdbarch
!= NULL
);
1131 if (gdbarch_debug
>= 2)
1132 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_desc called\n");
1133 return gdbarch
->target_desc
;
1137 gdbarch_bits_big_endian (struct gdbarch
*gdbarch
)
1139 gdb_assert (gdbarch
!= NULL
);
1140 /* Skip verify of bits_big_endian, invalid_p == 0 */
1141 if (gdbarch_debug
>= 2)
1142 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bits_big_endian called\n");
1143 return gdbarch
->bits_big_endian
;
1147 set_gdbarch_bits_big_endian (struct gdbarch
*gdbarch
,
1148 int bits_big_endian
)
1150 gdbarch
->bits_big_endian
= bits_big_endian
;
1154 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1156 gdb_assert (gdbarch
!= NULL
);
1157 /* Skip verify of short_bit, invalid_p == 0 */
1158 if (gdbarch_debug
>= 2)
1159 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1160 return gdbarch
->short_bit
;
1164 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1167 gdbarch
->short_bit
= short_bit
;
1171 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1173 gdb_assert (gdbarch
!= NULL
);
1174 /* Skip verify of int_bit, invalid_p == 0 */
1175 if (gdbarch_debug
>= 2)
1176 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1177 return gdbarch
->int_bit
;
1181 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1184 gdbarch
->int_bit
= int_bit
;
1188 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1190 gdb_assert (gdbarch
!= NULL
);
1191 /* Skip verify of long_bit, invalid_p == 0 */
1192 if (gdbarch_debug
>= 2)
1193 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1194 return gdbarch
->long_bit
;
1198 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1201 gdbarch
->long_bit
= long_bit
;
1205 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1207 gdb_assert (gdbarch
!= NULL
);
1208 /* Skip verify of long_long_bit, invalid_p == 0 */
1209 if (gdbarch_debug
>= 2)
1210 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1211 return gdbarch
->long_long_bit
;
1215 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1218 gdbarch
->long_long_bit
= long_long_bit
;
1222 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1224 gdb_assert (gdbarch
!= NULL
);
1225 /* Skip verify of float_bit, invalid_p == 0 */
1226 if (gdbarch_debug
>= 2)
1227 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1228 return gdbarch
->float_bit
;
1232 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1235 gdbarch
->float_bit
= float_bit
;
1238 const struct floatformat
**
1239 gdbarch_float_format (struct gdbarch
*gdbarch
)
1241 gdb_assert (gdbarch
!= NULL
);
1242 if (gdbarch_debug
>= 2)
1243 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
1244 return gdbarch
->float_format
;
1248 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
1249 const struct floatformat
** float_format
)
1251 gdbarch
->float_format
= float_format
;
1255 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1257 gdb_assert (gdbarch
!= NULL
);
1258 /* Skip verify of double_bit, invalid_p == 0 */
1259 if (gdbarch_debug
>= 2)
1260 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1261 return gdbarch
->double_bit
;
1265 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1268 gdbarch
->double_bit
= double_bit
;
1271 const struct floatformat
**
1272 gdbarch_double_format (struct gdbarch
*gdbarch
)
1274 gdb_assert (gdbarch
!= NULL
);
1275 if (gdbarch_debug
>= 2)
1276 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
1277 return gdbarch
->double_format
;
1281 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
1282 const struct floatformat
** double_format
)
1284 gdbarch
->double_format
= double_format
;
1288 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1290 gdb_assert (gdbarch
!= NULL
);
1291 /* Skip verify of long_double_bit, invalid_p == 0 */
1292 if (gdbarch_debug
>= 2)
1293 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1294 return gdbarch
->long_double_bit
;
1298 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1299 int long_double_bit
)
1301 gdbarch
->long_double_bit
= long_double_bit
;
1304 const struct floatformat
**
1305 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
1307 gdb_assert (gdbarch
!= NULL
);
1308 if (gdbarch_debug
>= 2)
1309 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
1310 return gdbarch
->long_double_format
;
1314 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
1315 const struct floatformat
** long_double_format
)
1317 gdbarch
->long_double_format
= long_double_format
;
1321 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1323 gdb_assert (gdbarch
!= NULL
);
1324 /* Skip verify of ptr_bit, invalid_p == 0 */
1325 if (gdbarch_debug
>= 2)
1326 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1327 return gdbarch
->ptr_bit
;
1331 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1334 gdbarch
->ptr_bit
= ptr_bit
;
1338 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1340 gdb_assert (gdbarch
!= NULL
);
1341 /* Check variable changed from pre-default. */
1342 gdb_assert (gdbarch
->addr_bit
!= 0);
1343 if (gdbarch_debug
>= 2)
1344 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1345 return gdbarch
->addr_bit
;
1349 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1352 gdbarch
->addr_bit
= addr_bit
;
1356 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1358 gdb_assert (gdbarch
!= NULL
);
1359 /* Check variable changed from pre-default. */
1360 gdb_assert (gdbarch
->char_signed
!= -1);
1361 if (gdbarch_debug
>= 2)
1362 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1363 return gdbarch
->char_signed
;
1367 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1370 gdbarch
->char_signed
= char_signed
;
1374 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1376 gdb_assert (gdbarch
!= NULL
);
1377 return gdbarch
->read_pc
!= NULL
;
1381 gdbarch_read_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
1383 gdb_assert (gdbarch
!= NULL
);
1384 gdb_assert (gdbarch
->read_pc
!= NULL
);
1385 if (gdbarch_debug
>= 2)
1386 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1387 return gdbarch
->read_pc (regcache
);
1391 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1392 gdbarch_read_pc_ftype read_pc
)
1394 gdbarch
->read_pc
= read_pc
;
1398 gdbarch_write_pc_p (struct gdbarch
*gdbarch
)
1400 gdb_assert (gdbarch
!= NULL
);
1401 return gdbarch
->write_pc
!= NULL
;
1405 gdbarch_write_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR val
)
1407 gdb_assert (gdbarch
!= NULL
);
1408 gdb_assert (gdbarch
->write_pc
!= NULL
);
1409 if (gdbarch_debug
>= 2)
1410 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1411 gdbarch
->write_pc (regcache
, val
);
1415 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1416 gdbarch_write_pc_ftype write_pc
)
1418 gdbarch
->write_pc
= write_pc
;
1422 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1424 gdb_assert (gdbarch
!= NULL
);
1425 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1426 if (gdbarch_debug
>= 2)
1427 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1428 gdbarch
->virtual_frame_pointer (gdbarch
, pc
, frame_regnum
, frame_offset
);
1432 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1433 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1435 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1439 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1441 gdb_assert (gdbarch
!= NULL
);
1442 return gdbarch
->pseudo_register_read
!= NULL
;
1446 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, gdb_byte
*buf
)
1448 gdb_assert (gdbarch
!= NULL
);
1449 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
1450 if (gdbarch_debug
>= 2)
1451 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
1452 gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
1456 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
1457 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
1459 gdbarch
->pseudo_register_read
= pseudo_register_read
;
1463 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
1465 gdb_assert (gdbarch
!= NULL
);
1466 return gdbarch
->pseudo_register_write
!= NULL
;
1470 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const gdb_byte
*buf
)
1472 gdb_assert (gdbarch
!= NULL
);
1473 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
1474 if (gdbarch_debug
>= 2)
1475 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
1476 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
1480 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
1481 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
1483 gdbarch
->pseudo_register_write
= pseudo_register_write
;
1487 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1489 gdb_assert (gdbarch
!= NULL
);
1490 /* Check variable changed from pre-default. */
1491 gdb_assert (gdbarch
->num_regs
!= -1);
1492 if (gdbarch_debug
>= 2)
1493 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1494 return gdbarch
->num_regs
;
1498 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1501 gdbarch
->num_regs
= num_regs
;
1505 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
1507 gdb_assert (gdbarch
!= NULL
);
1508 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1509 if (gdbarch_debug
>= 2)
1510 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
1511 return gdbarch
->num_pseudo_regs
;
1515 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
1516 int num_pseudo_regs
)
1518 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
1522 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1524 gdb_assert (gdbarch
!= NULL
);
1525 /* Skip verify of sp_regnum, invalid_p == 0 */
1526 if (gdbarch_debug
>= 2)
1527 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1528 return gdbarch
->sp_regnum
;
1532 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1535 gdbarch
->sp_regnum
= sp_regnum
;
1539 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1541 gdb_assert (gdbarch
!= NULL
);
1542 /* Skip verify of pc_regnum, invalid_p == 0 */
1543 if (gdbarch_debug
>= 2)
1544 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1545 return gdbarch
->pc_regnum
;
1549 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1552 gdbarch
->pc_regnum
= pc_regnum
;
1556 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
1558 gdb_assert (gdbarch
!= NULL
);
1559 /* Skip verify of ps_regnum, invalid_p == 0 */
1560 if (gdbarch_debug
>= 2)
1561 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
1562 return gdbarch
->ps_regnum
;
1566 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
1569 gdbarch
->ps_regnum
= ps_regnum
;
1573 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
1575 gdb_assert (gdbarch
!= NULL
);
1576 /* Skip verify of fp0_regnum, invalid_p == 0 */
1577 if (gdbarch_debug
>= 2)
1578 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
1579 return gdbarch
->fp0_regnum
;
1583 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
1586 gdbarch
->fp0_regnum
= fp0_regnum
;
1590 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
1592 gdb_assert (gdbarch
!= NULL
);
1593 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
1594 if (gdbarch_debug
>= 2)
1595 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
1596 return gdbarch
->stab_reg_to_regnum (gdbarch
, stab_regnr
);
1600 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
1601 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
1603 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
1607 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
1609 gdb_assert (gdbarch
!= NULL
);
1610 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
1611 if (gdbarch_debug
>= 2)
1612 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
1613 return gdbarch
->ecoff_reg_to_regnum (gdbarch
, ecoff_regnr
);
1617 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
1618 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
1620 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
1624 gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf_regnr
)
1626 gdb_assert (gdbarch
!= NULL
);
1627 gdb_assert (gdbarch
->dwarf_reg_to_regnum
!= NULL
);
1628 if (gdbarch_debug
>= 2)
1629 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf_reg_to_regnum called\n");
1630 return gdbarch
->dwarf_reg_to_regnum (gdbarch
, dwarf_regnr
);
1634 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
,
1635 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum
)
1637 gdbarch
->dwarf_reg_to_regnum
= dwarf_reg_to_regnum
;
1641 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
1643 gdb_assert (gdbarch
!= NULL
);
1644 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
1645 if (gdbarch_debug
>= 2)
1646 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
1647 return gdbarch
->sdb_reg_to_regnum (gdbarch
, sdb_regnr
);
1651 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
1652 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
1654 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
1658 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
1660 gdb_assert (gdbarch
!= NULL
);
1661 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
1662 if (gdbarch_debug
>= 2)
1663 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
1664 return gdbarch
->dwarf2_reg_to_regnum (gdbarch
, dwarf2_regnr
);
1668 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
1669 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
1671 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
1675 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1677 gdb_assert (gdbarch
!= NULL
);
1678 gdb_assert (gdbarch
->register_name
!= NULL
);
1679 if (gdbarch_debug
>= 2)
1680 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1681 return gdbarch
->register_name (gdbarch
, regnr
);
1685 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1686 gdbarch_register_name_ftype register_name
)
1688 gdbarch
->register_name
= register_name
;
1692 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
1694 gdb_assert (gdbarch
!= NULL
);
1695 return gdbarch
->register_type
!= NULL
;
1699 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
1701 gdb_assert (gdbarch
!= NULL
);
1702 gdb_assert (gdbarch
->register_type
!= NULL
);
1703 if (gdbarch_debug
>= 2)
1704 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
1705 return gdbarch
->register_type (gdbarch
, reg_nr
);
1709 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
1710 gdbarch_register_type_ftype register_type
)
1712 gdbarch
->register_type
= register_type
;
1716 gdbarch_dummy_id_p (struct gdbarch
*gdbarch
)
1718 gdb_assert (gdbarch
!= NULL
);
1719 return gdbarch
->dummy_id
!= NULL
;
1723 gdbarch_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*this_frame
)
1725 gdb_assert (gdbarch
!= NULL
);
1726 gdb_assert (gdbarch
->dummy_id
!= NULL
);
1727 if (gdbarch_debug
>= 2)
1728 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dummy_id called\n");
1729 return gdbarch
->dummy_id (gdbarch
, this_frame
);
1733 set_gdbarch_dummy_id (struct gdbarch
*gdbarch
,
1734 gdbarch_dummy_id_ftype dummy_id
)
1736 gdbarch
->dummy_id
= dummy_id
;
1740 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
1742 gdb_assert (gdbarch
!= NULL
);
1743 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1744 if (gdbarch_debug
>= 2)
1745 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
1746 return gdbarch
->deprecated_fp_regnum
;
1750 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
1751 int deprecated_fp_regnum
)
1753 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
1757 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
1759 gdb_assert (gdbarch
!= NULL
);
1760 return gdbarch
->push_dummy_call
!= NULL
;
1764 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
)
1766 gdb_assert (gdbarch
!= NULL
);
1767 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
1768 if (gdbarch_debug
>= 2)
1769 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
1770 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
1774 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
1775 gdbarch_push_dummy_call_ftype push_dummy_call
)
1777 gdbarch
->push_dummy_call
= push_dummy_call
;
1781 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1783 gdb_assert (gdbarch
!= NULL
);
1784 /* Skip verify of call_dummy_location, invalid_p == 0 */
1785 if (gdbarch_debug
>= 2)
1786 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1787 return gdbarch
->call_dummy_location
;
1791 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1792 int call_dummy_location
)
1794 gdbarch
->call_dummy_location
= call_dummy_location
;
1798 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
1800 gdb_assert (gdbarch
!= NULL
);
1801 return gdbarch
->push_dummy_code
!= NULL
;
1805 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
)
1807 gdb_assert (gdbarch
!= NULL
);
1808 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
1809 if (gdbarch_debug
>= 2)
1810 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
1811 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, args
, nargs
, value_type
, real_pc
, bp_addr
, regcache
);
1815 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
1816 gdbarch_push_dummy_code_ftype push_dummy_code
)
1818 gdbarch
->push_dummy_code
= push_dummy_code
;
1822 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
1824 gdb_assert (gdbarch
!= NULL
);
1825 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
1826 if (gdbarch_debug
>= 2)
1827 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
1828 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
1832 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
1833 gdbarch_print_registers_info_ftype print_registers_info
)
1835 gdbarch
->print_registers_info
= print_registers_info
;
1839 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
1841 gdb_assert (gdbarch
!= NULL
);
1842 return gdbarch
->print_float_info
!= NULL
;
1846 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
1848 gdb_assert (gdbarch
!= NULL
);
1849 gdb_assert (gdbarch
->print_float_info
!= NULL
);
1850 if (gdbarch_debug
>= 2)
1851 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
1852 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
1856 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
1857 gdbarch_print_float_info_ftype print_float_info
)
1859 gdbarch
->print_float_info
= print_float_info
;
1863 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
1865 gdb_assert (gdbarch
!= NULL
);
1866 return gdbarch
->print_vector_info
!= NULL
;
1870 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
1872 gdb_assert (gdbarch
!= NULL
);
1873 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
1874 if (gdbarch_debug
>= 2)
1875 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
1876 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
1880 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
1881 gdbarch_print_vector_info_ftype print_vector_info
)
1883 gdbarch
->print_vector_info
= print_vector_info
;
1887 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
1889 gdb_assert (gdbarch
!= NULL
);
1890 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
1891 if (gdbarch_debug
>= 2)
1892 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
1893 return gdbarch
->register_sim_regno (gdbarch
, reg_nr
);
1897 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
1898 gdbarch_register_sim_regno_ftype register_sim_regno
)
1900 gdbarch
->register_sim_regno
= register_sim_regno
;
1904 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
1906 gdb_assert (gdbarch
!= NULL
);
1907 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
1908 if (gdbarch_debug
>= 2)
1909 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
1910 return gdbarch
->cannot_fetch_register (gdbarch
, regnum
);
1914 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
1915 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
1917 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
1921 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
1923 gdb_assert (gdbarch
!= NULL
);
1924 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
1925 if (gdbarch_debug
>= 2)
1926 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
1927 return gdbarch
->cannot_store_register (gdbarch
, regnum
);
1931 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
1932 gdbarch_cannot_store_register_ftype cannot_store_register
)
1934 gdbarch
->cannot_store_register
= cannot_store_register
;
1938 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
1940 gdb_assert (gdbarch
!= NULL
);
1941 return gdbarch
->get_longjmp_target
!= NULL
;
1945 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR
*pc
)
1947 gdb_assert (gdbarch
!= NULL
);
1948 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
1949 if (gdbarch_debug
>= 2)
1950 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
1951 return gdbarch
->get_longjmp_target (frame
, pc
);
1955 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
1956 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
1958 gdbarch
->get_longjmp_target
= get_longjmp_target
;
1962 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
1964 gdb_assert (gdbarch
!= NULL
);
1965 if (gdbarch_debug
>= 2)
1966 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
1967 return gdbarch
->believe_pcc_promotion
;
1971 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
1972 int believe_pcc_promotion
)
1974 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
1978 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
1980 gdb_assert (gdbarch
!= NULL
);
1981 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
1982 if (gdbarch_debug
>= 2)
1983 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
1984 return gdbarch
->convert_register_p (gdbarch
, regnum
, type
);
1988 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
1989 gdbarch_convert_register_p_ftype convert_register_p
)
1991 gdbarch
->convert_register_p
= convert_register_p
;
1995 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, gdb_byte
*buf
)
1997 gdb_assert (gdbarch
!= NULL
);
1998 gdb_assert (gdbarch
->register_to_value
!= NULL
);
1999 if (gdbarch_debug
>= 2)
2000 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2001 gdbarch
->register_to_value (frame
, regnum
, type
, buf
);
2005 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2006 gdbarch_register_to_value_ftype register_to_value
)
2008 gdbarch
->register_to_value
= register_to_value
;
2012 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const gdb_byte
*buf
)
2014 gdb_assert (gdbarch
!= NULL
);
2015 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2016 if (gdbarch_debug
>= 2)
2017 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2018 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2022 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2023 gdbarch_value_to_register_ftype value_to_register
)
2025 gdbarch
->value_to_register
= value_to_register
;
2029 gdbarch_value_from_register (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, struct frame_info
*frame
)
2031 gdb_assert (gdbarch
!= NULL
);
2032 gdb_assert (gdbarch
->value_from_register
!= NULL
);
2033 if (gdbarch_debug
>= 2)
2034 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_from_register called\n");
2035 return gdbarch
->value_from_register (type
, regnum
, frame
);
2039 set_gdbarch_value_from_register (struct gdbarch
*gdbarch
,
2040 gdbarch_value_from_register_ftype value_from_register
)
2042 gdbarch
->value_from_register
= value_from_register
;
2046 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2048 gdb_assert (gdbarch
!= NULL
);
2049 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2050 if (gdbarch_debug
>= 2)
2051 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2052 return gdbarch
->pointer_to_address (type
, buf
);
2056 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2057 gdbarch_pointer_to_address_ftype pointer_to_address
)
2059 gdbarch
->pointer_to_address
= pointer_to_address
;
2063 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*buf
, CORE_ADDR addr
)
2065 gdb_assert (gdbarch
!= NULL
);
2066 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2067 if (gdbarch_debug
>= 2)
2068 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2069 gdbarch
->address_to_pointer (type
, buf
, addr
);
2073 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2074 gdbarch_address_to_pointer_ftype address_to_pointer
)
2076 gdbarch
->address_to_pointer
= address_to_pointer
;
2080 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2082 gdb_assert (gdbarch
!= NULL
);
2083 return gdbarch
->integer_to_address
!= NULL
;
2087 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2089 gdb_assert (gdbarch
!= NULL
);
2090 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2091 if (gdbarch_debug
>= 2)
2092 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2093 return gdbarch
->integer_to_address (gdbarch
, type
, buf
);
2097 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2098 gdbarch_integer_to_address_ftype integer_to_address
)
2100 gdbarch
->integer_to_address
= integer_to_address
;
2104 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2106 gdb_assert (gdbarch
!= NULL
);
2107 return gdbarch
->return_value
!= NULL
;
2110 enum return_value_convention
2111 gdbarch_return_value (struct gdbarch
*gdbarch
, struct type
*functype
, struct type
*valtype
, struct regcache
*regcache
, gdb_byte
*readbuf
, const gdb_byte
*writebuf
)
2113 gdb_assert (gdbarch
!= NULL
);
2114 gdb_assert (gdbarch
->return_value
!= NULL
);
2115 if (gdbarch_debug
>= 2)
2116 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2117 return gdbarch
->return_value (gdbarch
, functype
, valtype
, regcache
, readbuf
, writebuf
);
2121 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2122 gdbarch_return_value_ftype return_value
)
2124 gdbarch
->return_value
= return_value
;
2128 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2130 gdb_assert (gdbarch
!= NULL
);
2131 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2132 if (gdbarch_debug
>= 2)
2133 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2134 return gdbarch
->skip_prologue (gdbarch
, ip
);
2138 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2139 gdbarch_skip_prologue_ftype skip_prologue
)
2141 gdbarch
->skip_prologue
= skip_prologue
;
2145 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2147 gdb_assert (gdbarch
!= NULL
);
2148 gdb_assert (gdbarch
->inner_than
!= NULL
);
2149 if (gdbarch_debug
>= 2)
2150 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2151 return gdbarch
->inner_than (lhs
, rhs
);
2155 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2156 gdbarch_inner_than_ftype inner_than
)
2158 gdbarch
->inner_than
= inner_than
;
2162 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2164 gdb_assert (gdbarch
!= NULL
);
2165 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2166 if (gdbarch_debug
>= 2)
2167 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2168 return gdbarch
->breakpoint_from_pc (gdbarch
, pcptr
, lenptr
);
2172 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2173 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2175 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2179 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2181 gdb_assert (gdbarch
!= NULL
);
2182 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2186 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2188 gdb_assert (gdbarch
!= NULL
);
2189 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2190 if (gdbarch_debug
>= 2)
2191 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2192 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2196 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2197 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2199 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2203 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2205 gdb_assert (gdbarch
!= NULL
);
2206 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2207 if (gdbarch_debug
>= 2)
2208 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2209 return gdbarch
->memory_insert_breakpoint (gdbarch
, bp_tgt
);
2213 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2214 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2216 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2220 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2222 gdb_assert (gdbarch
!= NULL
);
2223 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2224 if (gdbarch_debug
>= 2)
2225 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2226 return gdbarch
->memory_remove_breakpoint (gdbarch
, bp_tgt
);
2230 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2231 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2233 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2237 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2239 gdb_assert (gdbarch
!= NULL
);
2240 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2241 if (gdbarch_debug
>= 2)
2242 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2243 return gdbarch
->decr_pc_after_break
;
2247 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2248 CORE_ADDR decr_pc_after_break
)
2250 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2254 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
2256 gdb_assert (gdbarch
!= NULL
);
2257 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2258 if (gdbarch_debug
>= 2)
2259 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
2260 return gdbarch
->deprecated_function_start_offset
;
2264 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
2265 CORE_ADDR deprecated_function_start_offset
)
2267 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
2271 gdbarch_remote_register_number (struct gdbarch
*gdbarch
, int regno
)
2273 gdb_assert (gdbarch
!= NULL
);
2274 gdb_assert (gdbarch
->remote_register_number
!= NULL
);
2275 if (gdbarch_debug
>= 2)
2276 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_register_number called\n");
2277 return gdbarch
->remote_register_number (gdbarch
, regno
);
2281 set_gdbarch_remote_register_number (struct gdbarch
*gdbarch
,
2282 gdbarch_remote_register_number_ftype remote_register_number
)
2284 gdbarch
->remote_register_number
= remote_register_number
;
2288 gdbarch_fetch_tls_load_module_address_p (struct gdbarch
*gdbarch
)
2290 gdb_assert (gdbarch
!= NULL
);
2291 return gdbarch
->fetch_tls_load_module_address
!= NULL
;
2295 gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
, struct objfile
*objfile
)
2297 gdb_assert (gdbarch
!= NULL
);
2298 gdb_assert (gdbarch
->fetch_tls_load_module_address
!= NULL
);
2299 if (gdbarch_debug
>= 2)
2300 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_tls_load_module_address called\n");
2301 return gdbarch
->fetch_tls_load_module_address (objfile
);
2305 set_gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
,
2306 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address
)
2308 gdbarch
->fetch_tls_load_module_address
= fetch_tls_load_module_address
;
2312 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2314 gdb_assert (gdbarch
!= NULL
);
2315 /* Skip verify of frame_args_skip, invalid_p == 0 */
2316 if (gdbarch_debug
>= 2)
2317 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2318 return gdbarch
->frame_args_skip
;
2322 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2323 CORE_ADDR frame_args_skip
)
2325 gdbarch
->frame_args_skip
= frame_args_skip
;
2329 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
2331 gdb_assert (gdbarch
!= NULL
);
2332 return gdbarch
->unwind_pc
!= NULL
;
2336 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2338 gdb_assert (gdbarch
!= NULL
);
2339 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
2340 if (gdbarch_debug
>= 2)
2341 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
2342 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
2346 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
2347 gdbarch_unwind_pc_ftype unwind_pc
)
2349 gdbarch
->unwind_pc
= unwind_pc
;
2353 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
2355 gdb_assert (gdbarch
!= NULL
);
2356 return gdbarch
->unwind_sp
!= NULL
;
2360 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2362 gdb_assert (gdbarch
!= NULL
);
2363 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
2364 if (gdbarch_debug
>= 2)
2365 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
2366 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
2370 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
2371 gdbarch_unwind_sp_ftype unwind_sp
)
2373 gdbarch
->unwind_sp
= unwind_sp
;
2377 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
2379 gdb_assert (gdbarch
!= NULL
);
2380 return gdbarch
->frame_num_args
!= NULL
;
2384 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2386 gdb_assert (gdbarch
!= NULL
);
2387 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
2388 if (gdbarch_debug
>= 2)
2389 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2390 return gdbarch
->frame_num_args (frame
);
2394 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2395 gdbarch_frame_num_args_ftype frame_num_args
)
2397 gdbarch
->frame_num_args
= frame_num_args
;
2401 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
2403 gdb_assert (gdbarch
!= NULL
);
2404 return gdbarch
->frame_align
!= NULL
;
2408 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
2410 gdb_assert (gdbarch
!= NULL
);
2411 gdb_assert (gdbarch
->frame_align
!= NULL
);
2412 if (gdbarch_debug
>= 2)
2413 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
2414 return gdbarch
->frame_align (gdbarch
, address
);
2418 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
2419 gdbarch_frame_align_ftype frame_align
)
2421 gdbarch
->frame_align
= frame_align
;
2425 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
2427 gdb_assert (gdbarch
!= NULL
);
2428 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
2429 if (gdbarch_debug
>= 2)
2430 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
2431 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
2435 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
2436 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
2438 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
2442 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
2444 gdb_assert (gdbarch
!= NULL
);
2445 if (gdbarch_debug
>= 2)
2446 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
2447 return gdbarch
->frame_red_zone_size
;
2451 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
2452 int frame_red_zone_size
)
2454 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
2458 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
2460 gdb_assert (gdbarch
!= NULL
);
2461 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
2462 if (gdbarch_debug
>= 2)
2463 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
2464 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
2468 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
2469 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
2471 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
2475 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2477 gdb_assert (gdbarch
!= NULL
);
2478 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
2479 if (gdbarch_debug
>= 2)
2480 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
2481 return gdbarch
->addr_bits_remove (addr
);
2485 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
2486 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
2488 gdbarch
->addr_bits_remove
= addr_bits_remove
;
2492 gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2494 gdb_assert (gdbarch
!= NULL
);
2495 gdb_assert (gdbarch
->smash_text_address
!= NULL
);
2496 if (gdbarch_debug
>= 2)
2497 fprintf_unfiltered (gdb_stdlog
, "gdbarch_smash_text_address called\n");
2498 return gdbarch
->smash_text_address (addr
);
2502 set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
,
2503 gdbarch_smash_text_address_ftype smash_text_address
)
2505 gdbarch
->smash_text_address
= smash_text_address
;
2509 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
2511 gdb_assert (gdbarch
!= NULL
);
2512 return gdbarch
->software_single_step
!= NULL
;
2516 gdbarch_software_single_step (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2518 gdb_assert (gdbarch
!= NULL
);
2519 gdb_assert (gdbarch
->software_single_step
!= NULL
);
2520 if (gdbarch_debug
>= 2)
2521 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
2522 return gdbarch
->software_single_step (frame
);
2526 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
2527 gdbarch_software_single_step_ftype software_single_step
)
2529 gdbarch
->software_single_step
= software_single_step
;
2533 gdbarch_single_step_through_delay_p (struct gdbarch
*gdbarch
)
2535 gdb_assert (gdbarch
!= NULL
);
2536 return gdbarch
->single_step_through_delay
!= NULL
;
2540 gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2542 gdb_assert (gdbarch
!= NULL
);
2543 gdb_assert (gdbarch
->single_step_through_delay
!= NULL
);
2544 if (gdbarch_debug
>= 2)
2545 fprintf_unfiltered (gdb_stdlog
, "gdbarch_single_step_through_delay called\n");
2546 return gdbarch
->single_step_through_delay (gdbarch
, frame
);
2550 set_gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
,
2551 gdbarch_single_step_through_delay_ftype single_step_through_delay
)
2553 gdbarch
->single_step_through_delay
= single_step_through_delay
;
2557 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
2559 gdb_assert (gdbarch
!= NULL
);
2560 gdb_assert (gdbarch
->print_insn
!= NULL
);
2561 if (gdbarch_debug
>= 2)
2562 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
2563 return gdbarch
->print_insn (vma
, info
);
2567 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
2568 gdbarch_print_insn_ftype print_insn
)
2570 gdbarch
->print_insn
= print_insn
;
2574 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR pc
)
2576 gdb_assert (gdbarch
!= NULL
);
2577 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
2578 if (gdbarch_debug
>= 2)
2579 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
2580 return gdbarch
->skip_trampoline_code (frame
, pc
);
2584 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
2585 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
2587 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
2591 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
2593 gdb_assert (gdbarch
!= NULL
);
2594 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
2595 if (gdbarch_debug
>= 2)
2596 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
2597 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
2601 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
2602 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
2604 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
2608 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
)
2610 gdb_assert (gdbarch
!= NULL
);
2611 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
2612 if (gdbarch_debug
>= 2)
2613 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
2614 return gdbarch
->in_solib_return_trampoline (pc
, name
);
2618 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
2619 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
2621 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
2625 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2627 gdb_assert (gdbarch
!= NULL
);
2628 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
2629 if (gdbarch_debug
>= 2)
2630 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
2631 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
2635 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
2636 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
2638 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
2642 gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
, int argc
, char **argv
)
2644 gdb_assert (gdbarch
!= NULL
);
2645 gdb_assert (gdbarch
->construct_inferior_arguments
!= NULL
);
2646 if (gdbarch_debug
>= 2)
2647 fprintf_unfiltered (gdb_stdlog
, "gdbarch_construct_inferior_arguments called\n");
2648 return gdbarch
->construct_inferior_arguments (gdbarch
, argc
, argv
);
2652 set_gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
,
2653 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments
)
2655 gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
2659 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
2661 gdb_assert (gdbarch
!= NULL
);
2662 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
2663 if (gdbarch_debug
>= 2)
2664 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
2665 gdbarch
->elf_make_msymbol_special (sym
, msym
);
2669 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
2670 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
2672 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
2676 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
2678 gdb_assert (gdbarch
!= NULL
);
2679 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
2680 if (gdbarch_debug
>= 2)
2681 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
2682 gdbarch
->coff_make_msymbol_special (val
, msym
);
2686 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
2687 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
2689 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
2693 gdbarch_name_of_malloc (struct gdbarch
*gdbarch
)
2695 gdb_assert (gdbarch
!= NULL
);
2696 /* Skip verify of name_of_malloc, invalid_p == 0 */
2697 if (gdbarch_debug
>= 2)
2698 fprintf_unfiltered (gdb_stdlog
, "gdbarch_name_of_malloc called\n");
2699 return gdbarch
->name_of_malloc
;
2703 set_gdbarch_name_of_malloc (struct gdbarch
*gdbarch
,
2704 const char * name_of_malloc
)
2706 gdbarch
->name_of_malloc
= name_of_malloc
;
2710 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
2712 gdb_assert (gdbarch
!= NULL
);
2713 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2714 if (gdbarch_debug
>= 2)
2715 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
2716 return gdbarch
->cannot_step_breakpoint
;
2720 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
2721 int cannot_step_breakpoint
)
2723 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
2727 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
2729 gdb_assert (gdbarch
!= NULL
);
2730 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2731 if (gdbarch_debug
>= 2)
2732 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
2733 return gdbarch
->have_nonsteppable_watchpoint
;
2737 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
2738 int have_nonsteppable_watchpoint
)
2740 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
2744 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
2746 gdb_assert (gdbarch
!= NULL
);
2747 return gdbarch
->address_class_type_flags
!= NULL
;
2751 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
2753 gdb_assert (gdbarch
!= NULL
);
2754 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
2755 if (gdbarch_debug
>= 2)
2756 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
2757 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
2761 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
2762 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
2764 gdbarch
->address_class_type_flags
= address_class_type_flags
;
2768 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
2770 gdb_assert (gdbarch
!= NULL
);
2771 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
2775 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
2777 gdb_assert (gdbarch
!= NULL
);
2778 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
2779 if (gdbarch_debug
>= 2)
2780 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
2781 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
2785 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
2786 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
2788 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
2792 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
2794 gdb_assert (gdbarch
!= NULL
);
2795 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
2799 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
2801 gdb_assert (gdbarch
!= NULL
);
2802 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
2803 if (gdbarch_debug
>= 2)
2804 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
2805 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
2809 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
2810 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
2812 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
2816 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
2818 gdb_assert (gdbarch
!= NULL
);
2819 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
2820 if (gdbarch_debug
>= 2)
2821 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
2822 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
2826 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
2827 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
2829 gdbarch
->register_reggroup_p
= register_reggroup_p
;
2833 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
2835 gdb_assert (gdbarch
!= NULL
);
2836 return gdbarch
->fetch_pointer_argument
!= NULL
;
2840 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
2842 gdb_assert (gdbarch
!= NULL
);
2843 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
2844 if (gdbarch_debug
>= 2)
2845 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
2846 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
2850 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
2851 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
2853 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
2857 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
2859 gdb_assert (gdbarch
!= NULL
);
2860 return gdbarch
->regset_from_core_section
!= NULL
;
2863 const struct regset
*
2864 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
2866 gdb_assert (gdbarch
!= NULL
);
2867 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
2868 if (gdbarch_debug
>= 2)
2869 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
2870 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
2874 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
2875 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
2877 gdbarch
->regset_from_core_section
= regset_from_core_section
;
2881 gdbarch_core_xfer_shared_libraries_p (struct gdbarch
*gdbarch
)
2883 gdb_assert (gdbarch
!= NULL
);
2884 return gdbarch
->core_xfer_shared_libraries
!= NULL
;
2888 gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
, gdb_byte
*readbuf
, ULONGEST offset
, LONGEST len
)
2890 gdb_assert (gdbarch
!= NULL
);
2891 gdb_assert (gdbarch
->core_xfer_shared_libraries
!= NULL
);
2892 if (gdbarch_debug
>= 2)
2893 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_xfer_shared_libraries called\n");
2894 return gdbarch
->core_xfer_shared_libraries (gdbarch
, readbuf
, offset
, len
);
2898 set_gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
,
2899 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries
)
2901 gdbarch
->core_xfer_shared_libraries
= core_xfer_shared_libraries
;
2905 gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
)
2907 gdb_assert (gdbarch
!= NULL
);
2908 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
2909 if (gdbarch_debug
>= 2)
2910 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vtable_function_descriptors called\n");
2911 return gdbarch
->vtable_function_descriptors
;
2915 set_gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
,
2916 int vtable_function_descriptors
)
2918 gdbarch
->vtable_function_descriptors
= vtable_function_descriptors
;
2922 gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
)
2924 gdb_assert (gdbarch
!= NULL
);
2925 /* Skip verify of vbit_in_delta, invalid_p == 0 */
2926 if (gdbarch_debug
>= 2)
2927 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vbit_in_delta called\n");
2928 return gdbarch
->vbit_in_delta
;
2932 set_gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
,
2935 gdbarch
->vbit_in_delta
= vbit_in_delta
;
2939 gdbarch_skip_permanent_breakpoint_p (struct gdbarch
*gdbarch
)
2941 gdb_assert (gdbarch
!= NULL
);
2942 return gdbarch
->skip_permanent_breakpoint
!= NULL
;
2946 gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
2948 gdb_assert (gdbarch
!= NULL
);
2949 gdb_assert (gdbarch
->skip_permanent_breakpoint
!= NULL
);
2950 if (gdbarch_debug
>= 2)
2951 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_permanent_breakpoint called\n");
2952 gdbarch
->skip_permanent_breakpoint (regcache
);
2956 set_gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
,
2957 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint
)
2959 gdbarch
->skip_permanent_breakpoint
= skip_permanent_breakpoint
;
2963 gdbarch_max_insn_length_p (struct gdbarch
*gdbarch
)
2965 gdb_assert (gdbarch
!= NULL
);
2966 return gdbarch
->max_insn_length
!= 0;
2970 gdbarch_max_insn_length (struct gdbarch
*gdbarch
)
2972 gdb_assert (gdbarch
!= NULL
);
2973 /* Check variable changed from pre-default. */
2974 gdb_assert (gdbarch
->max_insn_length
!= 0);
2975 if (gdbarch_debug
>= 2)
2976 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_insn_length called\n");
2977 return gdbarch
->max_insn_length
;
2981 set_gdbarch_max_insn_length (struct gdbarch
*gdbarch
,
2982 ULONGEST max_insn_length
)
2984 gdbarch
->max_insn_length
= max_insn_length
;
2988 gdbarch_displaced_step_copy_insn_p (struct gdbarch
*gdbarch
)
2990 gdb_assert (gdbarch
!= NULL
);
2991 return gdbarch
->displaced_step_copy_insn
!= NULL
;
2994 struct displaced_step_closure
*
2995 gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
2997 gdb_assert (gdbarch
!= NULL
);
2998 gdb_assert (gdbarch
->displaced_step_copy_insn
!= NULL
);
2999 if (gdbarch_debug
>= 2)
3000 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_copy_insn called\n");
3001 return gdbarch
->displaced_step_copy_insn (gdbarch
, from
, to
, regs
);
3005 set_gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
,
3006 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn
)
3008 gdbarch
->displaced_step_copy_insn
= displaced_step_copy_insn
;
3012 gdbarch_displaced_step_fixup_p (struct gdbarch
*gdbarch
)
3014 gdb_assert (gdbarch
!= NULL
);
3015 return gdbarch
->displaced_step_fixup
!= NULL
;
3019 gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3021 gdb_assert (gdbarch
!= NULL
);
3022 gdb_assert (gdbarch
->displaced_step_fixup
!= NULL
);
3023 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3024 if (gdbarch_debug
>= 2)
3025 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_fixup called\n");
3026 gdbarch
->displaced_step_fixup (gdbarch
, closure
, from
, to
, regs
);
3030 set_gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
,
3031 gdbarch_displaced_step_fixup_ftype displaced_step_fixup
)
3033 gdbarch
->displaced_step_fixup
= displaced_step_fixup
;
3037 gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3039 gdb_assert (gdbarch
!= NULL
);
3040 gdb_assert (gdbarch
->displaced_step_free_closure
!= NULL
);
3041 if (gdbarch_debug
>= 2)
3042 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_free_closure called\n");
3043 gdbarch
->displaced_step_free_closure (gdbarch
, closure
);
3047 set_gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
,
3048 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure
)
3050 gdbarch
->displaced_step_free_closure
= displaced_step_free_closure
;
3054 gdbarch_displaced_step_location (struct gdbarch
*gdbarch
)
3056 gdb_assert (gdbarch
!= NULL
);
3057 gdb_assert (gdbarch
->displaced_step_location
!= NULL
);
3058 if (gdbarch_debug
>= 2)
3059 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_location called\n");
3060 return gdbarch
->displaced_step_location (gdbarch
);
3064 set_gdbarch_displaced_step_location (struct gdbarch
*gdbarch
,
3065 gdbarch_displaced_step_location_ftype displaced_step_location
)
3067 gdbarch
->displaced_step_location
= displaced_step_location
;
3071 gdbarch_overlay_update_p (struct gdbarch
*gdbarch
)
3073 gdb_assert (gdbarch
!= NULL
);
3074 return gdbarch
->overlay_update
!= NULL
;
3078 gdbarch_overlay_update (struct gdbarch
*gdbarch
, struct obj_section
*osect
)
3080 gdb_assert (gdbarch
!= NULL
);
3081 gdb_assert (gdbarch
->overlay_update
!= NULL
);
3082 if (gdbarch_debug
>= 2)
3083 fprintf_unfiltered (gdb_stdlog
, "gdbarch_overlay_update called\n");
3084 gdbarch
->overlay_update (osect
);
3088 set_gdbarch_overlay_update (struct gdbarch
*gdbarch
,
3089 gdbarch_overlay_update_ftype overlay_update
)
3091 gdbarch
->overlay_update
= overlay_update
;
3095 gdbarch_core_read_description_p (struct gdbarch
*gdbarch
)
3097 gdb_assert (gdbarch
!= NULL
);
3098 return gdbarch
->core_read_description
!= NULL
;
3101 const struct target_desc
*
3102 gdbarch_core_read_description (struct gdbarch
*gdbarch
, struct target_ops
*target
, bfd
*abfd
)
3104 gdb_assert (gdbarch
!= NULL
);
3105 gdb_assert (gdbarch
->core_read_description
!= NULL
);
3106 if (gdbarch_debug
>= 2)
3107 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_read_description called\n");
3108 return gdbarch
->core_read_description (gdbarch
, target
, abfd
);
3112 set_gdbarch_core_read_description (struct gdbarch
*gdbarch
,
3113 gdbarch_core_read_description_ftype core_read_description
)
3115 gdbarch
->core_read_description
= core_read_description
;
3119 gdbarch_static_transform_name_p (struct gdbarch
*gdbarch
)
3121 gdb_assert (gdbarch
!= NULL
);
3122 return gdbarch
->static_transform_name
!= NULL
;
3126 gdbarch_static_transform_name (struct gdbarch
*gdbarch
, char *name
)
3128 gdb_assert (gdbarch
!= NULL
);
3129 gdb_assert (gdbarch
->static_transform_name
!= NULL
);
3130 if (gdbarch_debug
>= 2)
3131 fprintf_unfiltered (gdb_stdlog
, "gdbarch_static_transform_name called\n");
3132 return gdbarch
->static_transform_name (name
);
3136 set_gdbarch_static_transform_name (struct gdbarch
*gdbarch
,
3137 gdbarch_static_transform_name_ftype static_transform_name
)
3139 gdbarch
->static_transform_name
= static_transform_name
;
3143 gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
)
3145 gdb_assert (gdbarch
!= NULL
);
3146 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3147 if (gdbarch_debug
>= 2)
3148 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sofun_address_maybe_missing called\n");
3149 return gdbarch
->sofun_address_maybe_missing
;
3153 set_gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
,
3154 int sofun_address_maybe_missing
)
3156 gdbarch
->sofun_address_maybe_missing
= sofun_address_maybe_missing
;
3160 gdbarch_target_signal_from_host (struct gdbarch
*gdbarch
, int signo
)
3162 gdb_assert (gdbarch
!= NULL
);
3163 gdb_assert (gdbarch
->target_signal_from_host
!= NULL
);
3164 if (gdbarch_debug
>= 2)
3165 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_signal_from_host called\n");
3166 return gdbarch
->target_signal_from_host (gdbarch
, signo
);
3170 set_gdbarch_target_signal_from_host (struct gdbarch
*gdbarch
,
3171 gdbarch_target_signal_from_host_ftype target_signal_from_host
)
3173 gdbarch
->target_signal_from_host
= target_signal_from_host
;
3177 gdbarch_target_signal_to_host (struct gdbarch
*gdbarch
, enum target_signal ts
)
3179 gdb_assert (gdbarch
!= NULL
);
3180 gdb_assert (gdbarch
->target_signal_to_host
!= NULL
);
3181 if (gdbarch_debug
>= 2)
3182 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_signal_to_host called\n");
3183 return gdbarch
->target_signal_to_host (gdbarch
, ts
);
3187 set_gdbarch_target_signal_to_host (struct gdbarch
*gdbarch
,
3188 gdbarch_target_signal_to_host_ftype target_signal_to_host
)
3190 gdbarch
->target_signal_to_host
= target_signal_to_host
;
3194 gdbarch_record_special_symbol_p (struct gdbarch
*gdbarch
)
3196 gdb_assert (gdbarch
!= NULL
);
3197 return gdbarch
->record_special_symbol
!= NULL
;
3201 gdbarch_record_special_symbol (struct gdbarch
*gdbarch
, struct objfile
*objfile
, asymbol
*sym
)
3203 gdb_assert (gdbarch
!= NULL
);
3204 gdb_assert (gdbarch
->record_special_symbol
!= NULL
);
3205 if (gdbarch_debug
>= 2)
3206 fprintf_unfiltered (gdb_stdlog
, "gdbarch_record_special_symbol called\n");
3207 gdbarch
->record_special_symbol (gdbarch
, objfile
, sym
);
3211 set_gdbarch_record_special_symbol (struct gdbarch
*gdbarch
,
3212 gdbarch_record_special_symbol_ftype record_special_symbol
)
3214 gdbarch
->record_special_symbol
= record_special_symbol
;
3218 /* Keep a registry of per-architecture data-pointers required by GDB
3225 gdbarch_data_pre_init_ftype
*pre_init
;
3226 gdbarch_data_post_init_ftype
*post_init
;
3229 struct gdbarch_data_registration
3231 struct gdbarch_data
*data
;
3232 struct gdbarch_data_registration
*next
;
3235 struct gdbarch_data_registry
3238 struct gdbarch_data_registration
*registrations
;
3241 struct gdbarch_data_registry gdbarch_data_registry
=
3246 static struct gdbarch_data
*
3247 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
3248 gdbarch_data_post_init_ftype
*post_init
)
3250 struct gdbarch_data_registration
**curr
;
3251 /* Append the new registraration. */
3252 for (curr
= &gdbarch_data_registry
.registrations
;
3254 curr
= &(*curr
)->next
);
3255 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
3256 (*curr
)->next
= NULL
;
3257 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
3258 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
3259 (*curr
)->data
->pre_init
= pre_init
;
3260 (*curr
)->data
->post_init
= post_init
;
3261 (*curr
)->data
->init_p
= 1;
3262 return (*curr
)->data
;
3265 struct gdbarch_data
*
3266 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
3268 return gdbarch_data_register (pre_init
, NULL
);
3271 struct gdbarch_data
*
3272 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
3274 return gdbarch_data_register (NULL
, post_init
);
3277 /* Create/delete the gdbarch data vector. */
3280 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
3282 gdb_assert (gdbarch
->data
== NULL
);
3283 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
3284 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
3287 /* Initialize the current value of the specified per-architecture
3291 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
3292 struct gdbarch_data
*data
,
3295 gdb_assert (data
->index
< gdbarch
->nr_data
);
3296 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
3297 gdb_assert (data
->pre_init
== NULL
);
3298 gdbarch
->data
[data
->index
] = pointer
;
3301 /* Return the current value of the specified per-architecture
3305 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
3307 gdb_assert (data
->index
< gdbarch
->nr_data
);
3308 if (gdbarch
->data
[data
->index
] == NULL
)
3310 /* The data-pointer isn't initialized, call init() to get a
3312 if (data
->pre_init
!= NULL
)
3313 /* Mid architecture creation: pass just the obstack, and not
3314 the entire architecture, as that way it isn't possible for
3315 pre-init code to refer to undefined architecture
3317 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
3318 else if (gdbarch
->initialized_p
3319 && data
->post_init
!= NULL
)
3320 /* Post architecture creation: pass the entire architecture
3321 (as all fields are valid), but be careful to also detect
3322 recursive references. */
3324 gdb_assert (data
->init_p
);
3326 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
3330 /* The architecture initialization hasn't completed - punt -
3331 hope that the caller knows what they are doing. Once
3332 deprecated_set_gdbarch_data has been initialized, this can be
3333 changed to an internal error. */
3335 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
3337 return gdbarch
->data
[data
->index
];
3341 /* Keep a registry of the architectures known by GDB. */
3343 struct gdbarch_registration
3345 enum bfd_architecture bfd_architecture
;
3346 gdbarch_init_ftype
*init
;
3347 gdbarch_dump_tdep_ftype
*dump_tdep
;
3348 struct gdbarch_list
*arches
;
3349 struct gdbarch_registration
*next
;
3352 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
3355 append_name (const char ***buf
, int *nr
, const char *name
)
3357 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
3363 gdbarch_printable_names (void)
3365 /* Accumulate a list of names based on the registed list of
3367 enum bfd_architecture a
;
3369 const char **arches
= NULL
;
3370 struct gdbarch_registration
*rego
;
3371 for (rego
= gdbarch_registry
;
3375 const struct bfd_arch_info
*ap
;
3376 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3378 internal_error (__FILE__
, __LINE__
,
3379 _("gdbarch_architecture_names: multi-arch unknown"));
3382 append_name (&arches
, &nr_arches
, ap
->printable_name
);
3387 append_name (&arches
, &nr_arches
, NULL
);
3393 gdbarch_register (enum bfd_architecture bfd_architecture
,
3394 gdbarch_init_ftype
*init
,
3395 gdbarch_dump_tdep_ftype
*dump_tdep
)
3397 struct gdbarch_registration
**curr
;
3398 const struct bfd_arch_info
*bfd_arch_info
;
3399 /* Check that BFD recognizes this architecture */
3400 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
3401 if (bfd_arch_info
== NULL
)
3403 internal_error (__FILE__
, __LINE__
,
3404 _("gdbarch: Attempt to register unknown architecture (%d)"),
3407 /* Check that we haven't seen this architecture before */
3408 for (curr
= &gdbarch_registry
;
3410 curr
= &(*curr
)->next
)
3412 if (bfd_architecture
== (*curr
)->bfd_architecture
)
3413 internal_error (__FILE__
, __LINE__
,
3414 _("gdbarch: Duplicate registraration of architecture (%s)"),
3415 bfd_arch_info
->printable_name
);
3419 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
3420 bfd_arch_info
->printable_name
,
3423 (*curr
) = XMALLOC (struct gdbarch_registration
);
3424 (*curr
)->bfd_architecture
= bfd_architecture
;
3425 (*curr
)->init
= init
;
3426 (*curr
)->dump_tdep
= dump_tdep
;
3427 (*curr
)->arches
= NULL
;
3428 (*curr
)->next
= NULL
;
3432 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
3433 gdbarch_init_ftype
*init
)
3435 gdbarch_register (bfd_architecture
, init
, NULL
);
3439 /* Look for an architecture using gdbarch_info. */
3441 struct gdbarch_list
*
3442 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
3443 const struct gdbarch_info
*info
)
3445 for (; arches
!= NULL
; arches
= arches
->next
)
3447 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
3449 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
3451 if (info
->osabi
!= arches
->gdbarch
->osabi
)
3453 if (info
->target_desc
!= arches
->gdbarch
->target_desc
)
3461 /* Find an architecture that matches the specified INFO. Create a new
3462 architecture if needed. Return that new architecture. Assumes
3463 that there is no current architecture. */
3465 static struct gdbarch
*
3466 find_arch_by_info (struct gdbarch_info info
)
3468 struct gdbarch
*new_gdbarch
;
3469 struct gdbarch_registration
*rego
;
3471 /* The existing architecture has been swapped out - all this code
3472 works from a clean slate. */
3473 gdb_assert (current_gdbarch
== NULL
);
3475 /* Fill in missing parts of the INFO struct using a number of
3476 sources: "set ..."; INFOabfd supplied; and the global
3478 gdbarch_info_fill (&info
);
3480 /* Must have found some sort of architecture. */
3481 gdb_assert (info
.bfd_arch_info
!= NULL
);
3485 fprintf_unfiltered (gdb_stdlog
,
3486 "find_arch_by_info: info.bfd_arch_info %s\n",
3487 (info
.bfd_arch_info
!= NULL
3488 ? info
.bfd_arch_info
->printable_name
3490 fprintf_unfiltered (gdb_stdlog
,
3491 "find_arch_by_info: info.byte_order %d (%s)\n",
3493 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
3494 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
3496 fprintf_unfiltered (gdb_stdlog
,
3497 "find_arch_by_info: info.osabi %d (%s)\n",
3498 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
3499 fprintf_unfiltered (gdb_stdlog
,
3500 "find_arch_by_info: info.abfd 0x%lx\n",
3502 fprintf_unfiltered (gdb_stdlog
,
3503 "find_arch_by_info: info.tdep_info 0x%lx\n",
3504 (long) info
.tdep_info
);
3507 /* Find the tdep code that knows about this architecture. */
3508 for (rego
= gdbarch_registry
;
3511 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
3516 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3517 "No matching architecture\n");
3521 /* Ask the tdep code for an architecture that matches "info". */
3522 new_gdbarch
= rego
->init (info
, rego
->arches
);
3524 /* Did the tdep code like it? No. Reject the change and revert to
3525 the old architecture. */
3526 if (new_gdbarch
== NULL
)
3529 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3530 "Target rejected architecture\n");
3534 /* Is this a pre-existing architecture (as determined by already
3535 being initialized)? Move it to the front of the architecture
3536 list (keeping the list sorted Most Recently Used). */
3537 if (new_gdbarch
->initialized_p
)
3539 struct gdbarch_list
**list
;
3540 struct gdbarch_list
*this;
3542 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3543 "Previous architecture 0x%08lx (%s) selected\n",
3545 new_gdbarch
->bfd_arch_info
->printable_name
);
3546 /* Find the existing arch in the list. */
3547 for (list
= ®o
->arches
;
3548 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
3549 list
= &(*list
)->next
);
3550 /* It had better be in the list of architectures. */
3551 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
3554 (*list
) = this->next
;
3555 /* Insert THIS at the front. */
3556 this->next
= rego
->arches
;
3557 rego
->arches
= this;
3562 /* It's a new architecture. */
3564 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3565 "New architecture 0x%08lx (%s) selected\n",
3567 new_gdbarch
->bfd_arch_info
->printable_name
);
3569 /* Insert the new architecture into the front of the architecture
3570 list (keep the list sorted Most Recently Used). */
3572 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
3573 this->next
= rego
->arches
;
3574 this->gdbarch
= new_gdbarch
;
3575 rego
->arches
= this;
3578 /* Check that the newly installed architecture is valid. Plug in
3579 any post init values. */
3580 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
3581 verify_gdbarch (new_gdbarch
);
3582 new_gdbarch
->initialized_p
= 1;
3585 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
3591 gdbarch_find_by_info (struct gdbarch_info info
)
3593 struct gdbarch
*new_gdbarch
;
3595 /* Save the previously selected architecture, setting the global to
3596 NULL. This stops things like gdbarch->init() trying to use the
3597 previous architecture's configuration. The previous architecture
3598 may not even be of the same architecture family. The most recent
3599 architecture of the same family is found at the head of the
3600 rego->arches list. */
3601 struct gdbarch
*old_gdbarch
= current_gdbarch
;
3602 current_gdbarch
= NULL
;
3604 /* Find the specified architecture. */
3605 new_gdbarch
= find_arch_by_info (info
);
3607 /* Restore the existing architecture. */
3608 gdb_assert (current_gdbarch
== NULL
);
3609 current_gdbarch
= old_gdbarch
;
3614 /* Make the specified architecture current. */
3617 deprecated_current_gdbarch_select_hack (struct gdbarch
*new_gdbarch
)
3619 gdb_assert (new_gdbarch
!= NULL
);
3620 gdb_assert (current_gdbarch
!= NULL
);
3621 gdb_assert (new_gdbarch
->initialized_p
);
3622 current_gdbarch
= new_gdbarch
;
3623 architecture_changed_event ();
3624 reinit_frame_cache ();
3627 extern void _initialize_gdbarch (void);
3630 _initialize_gdbarch (void)
3632 struct cmd_list_element
*c
;
3634 add_setshow_zinteger_cmd ("arch", class_maintenance
, &gdbarch_debug
, _("\
3635 Set architecture debugging."), _("\
3636 Show architecture debugging."), _("\
3637 When non-zero, architecture debugging is enabled."),
3640 &setdebuglist
, &showdebuglist
);