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).
138 const struct floatformat ** float_format;
140 const struct floatformat ** double_format;
142 const struct floatformat ** long_double_format;
146 gdbarch_read_pc_ftype *read_pc;
147 gdbarch_write_pc_ftype *write_pc;
148 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
149 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
150 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
157 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
158 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
159 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
160 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
161 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
162 gdbarch_register_name_ftype *register_name;
163 gdbarch_register_type_ftype *register_type;
164 gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
165 int deprecated_fp_regnum;
166 gdbarch_push_dummy_call_ftype *push_dummy_call;
167 int call_dummy_location;
168 gdbarch_push_dummy_code_ftype *push_dummy_code;
169 gdbarch_print_registers_info_ftype *print_registers_info;
170 gdbarch_print_float_info_ftype *print_float_info;
171 gdbarch_print_vector_info_ftype *print_vector_info;
172 gdbarch_register_sim_regno_ftype *register_sim_regno;
173 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
174 gdbarch_cannot_store_register_ftype *cannot_store_register;
175 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
176 int believe_pcc_promotion;
177 gdbarch_convert_register_p_ftype *convert_register_p;
178 gdbarch_register_to_value_ftype *register_to_value;
179 gdbarch_value_to_register_ftype *value_to_register;
180 gdbarch_value_from_register_ftype *value_from_register;
181 gdbarch_pointer_to_address_ftype *pointer_to_address;
182 gdbarch_address_to_pointer_ftype *address_to_pointer;
183 gdbarch_integer_to_address_ftype *integer_to_address;
184 gdbarch_return_value_ftype *return_value;
185 gdbarch_skip_prologue_ftype *skip_prologue;
186 gdbarch_inner_than_ftype *inner_than;
187 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
188 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
189 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
190 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
191 CORE_ADDR decr_pc_after_break;
192 CORE_ADDR deprecated_function_start_offset;
193 gdbarch_remote_register_number_ftype *remote_register_number;
194 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
195 CORE_ADDR frame_args_skip;
196 gdbarch_unwind_pc_ftype *unwind_pc;
197 gdbarch_unwind_sp_ftype *unwind_sp;
198 gdbarch_frame_num_args_ftype *frame_num_args;
199 gdbarch_frame_align_ftype *frame_align;
200 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
201 int frame_red_zone_size;
202 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
203 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
204 gdbarch_smash_text_address_ftype *smash_text_address;
205 gdbarch_software_single_step_ftype *software_single_step;
206 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
207 gdbarch_print_insn_ftype *print_insn;
208 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
209 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
210 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
211 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
212 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
213 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
214 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
215 const char * name_of_malloc;
216 int cannot_step_breakpoint;
217 int have_nonsteppable_watchpoint;
218 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
219 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
220 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
221 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
222 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
223 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
224 gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries;
225 int vtable_function_descriptors;
227 gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
228 gdbarch_overlay_update_ftype *overlay_update;
229 gdbarch_core_read_description_ftype *core_read_description;
230 gdbarch_static_transform_name_ftype *static_transform_name;
231 int sofun_address_maybe_missing;
235 /* The default architecture uses host values (for want of a better
238 extern const struct bfd_arch_info bfd_default_arch_struct;
240 struct gdbarch startup_gdbarch =
242 1, /* Always initialized. */
243 NULL, /* The obstack. */
244 /* basic architecture information */
245 &bfd_default_arch_struct, /* bfd_arch_info */
246 BFD_ENDIAN_BIG, /* byte_order */
247 GDB_OSABI_UNKNOWN, /* osabi */
249 /* target specific vector and its dump routine */
251 /*per-architecture data-pointers and swap regions */
253 /* Multi-arch values */
254 8 * sizeof (short), /* short_bit */
255 8 * sizeof (int), /* int_bit */
256 8 * sizeof (long), /* long_bit */
257 8 * sizeof (LONGEST), /* long_long_bit */
258 8 * sizeof (float), /* float_bit */
259 0, /* float_format */
260 8 * sizeof (double), /* double_bit */
261 0, /* double_format */
262 8 * sizeof (long double), /* long_double_bit */
263 0, /* long_double_format */
264 8 * sizeof (void*), /* ptr_bit */
265 8 * sizeof (void*), /* addr_bit */
269 legacy_virtual_frame_pointer, /* virtual_frame_pointer */
270 0, /* pseudo_register_read */
271 0, /* pseudo_register_write */
273 0, /* num_pseudo_regs */
278 0, /* stab_reg_to_regnum */
279 0, /* ecoff_reg_to_regnum */
280 0, /* dwarf_reg_to_regnum */
281 0, /* sdb_reg_to_regnum */
282 0, /* dwarf2_reg_to_regnum */
283 0, /* register_name */
284 0, /* register_type */
285 0, /* unwind_dummy_id */
286 -1, /* deprecated_fp_regnum */
287 0, /* push_dummy_call */
288 0, /* call_dummy_location */
289 0, /* push_dummy_code */
290 default_print_registers_info, /* print_registers_info */
291 0, /* print_float_info */
292 0, /* print_vector_info */
293 0, /* register_sim_regno */
294 0, /* cannot_fetch_register */
295 0, /* cannot_store_register */
296 0, /* get_longjmp_target */
297 0, /* believe_pcc_promotion */
298 generic_convert_register_p, /* convert_register_p */
299 0, /* register_to_value */
300 0, /* value_to_register */
301 0, /* value_from_register */
302 0, /* pointer_to_address */
303 0, /* address_to_pointer */
304 0, /* integer_to_address */
305 0, /* return_value */
306 0, /* skip_prologue */
308 0, /* breakpoint_from_pc */
309 0, /* adjust_breakpoint_address */
310 0, /* memory_insert_breakpoint */
311 0, /* memory_remove_breakpoint */
312 0, /* decr_pc_after_break */
313 0, /* deprecated_function_start_offset */
314 default_remote_register_number, /* remote_register_number */
315 0, /* fetch_tls_load_module_address */
316 0, /* frame_args_skip */
319 0, /* frame_num_args */
321 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
322 0, /* frame_red_zone_size */
323 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
324 0, /* addr_bits_remove */
325 0, /* smash_text_address */
326 0, /* software_single_step */
327 0, /* single_step_through_delay */
329 0, /* skip_trampoline_code */
330 generic_skip_solib_resolver, /* skip_solib_resolver */
331 0, /* in_solib_return_trampoline */
332 generic_in_function_epilogue_p, /* in_function_epilogue_p */
333 construct_inferior_arguments, /* construct_inferior_arguments */
334 0, /* elf_make_msymbol_special */
335 0, /* coff_make_msymbol_special */
336 "malloc", /* name_of_malloc */
337 0, /* cannot_step_breakpoint */
338 0, /* have_nonsteppable_watchpoint */
339 0, /* address_class_type_flags */
340 0, /* address_class_type_flags_to_name */
341 0, /* address_class_name_to_type_flags */
342 default_register_reggroup_p, /* register_reggroup_p */
343 0, /* fetch_pointer_argument */
344 0, /* regset_from_core_section */
345 0, /* core_xfer_shared_libraries */
346 0, /* vtable_function_descriptors */
347 0, /* vbit_in_delta */
348 0, /* skip_permanent_breakpoint */
349 0, /* overlay_update */
350 0, /* core_read_description */
351 0, /* static_transform_name */
352 0, /* sofun_address_maybe_missing */
353 /* startup_gdbarch() */
356 struct gdbarch *current_gdbarch = &startup_gdbarch;
358 /* Create a new ``struct gdbarch'' based on information provided by
359 ``struct gdbarch_info''. */
362 gdbarch_alloc (const struct gdbarch_info *info,
363 struct gdbarch_tdep *tdep)
365 struct gdbarch *gdbarch;
367 /* Create an obstack for allocating all the per-architecture memory,
368 then use that to allocate the architecture vector. */
369 struct obstack *obstack = XMALLOC (struct obstack);
370 obstack_init (obstack);
371 gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
372 memset (gdbarch, 0, sizeof (*gdbarch));
373 gdbarch->obstack = obstack;
375 alloc_gdbarch_data (gdbarch);
377 gdbarch->tdep = tdep;
379 gdbarch->bfd_arch_info = info->bfd_arch_info;
380 gdbarch->byte_order = info->byte_order;
381 gdbarch->osabi = info->osabi;
382 gdbarch->target_desc = info->target_desc;
384 /* Force the explicit initialization of these. */
385 gdbarch->short_bit = 2*TARGET_CHAR_BIT;
386 gdbarch->int_bit = 4*TARGET_CHAR_BIT;
387 gdbarch->long_bit = 4*TARGET_CHAR_BIT;
388 gdbarch->long_long_bit = 2*gdbarch->long_bit;
389 gdbarch->float_bit = 4*TARGET_CHAR_BIT;
390 gdbarch->double_bit = 8*TARGET_CHAR_BIT;
391 gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
392 gdbarch->ptr_bit = gdbarch->int_bit;
393 gdbarch->char_signed = -1;
394 gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
395 gdbarch->num_regs = -1;
396 gdbarch->sp_regnum = -1;
397 gdbarch->pc_regnum = -1;
398 gdbarch->ps_regnum = -1;
399 gdbarch->fp0_regnum = -1;
400 gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
401 gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
402 gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
403 gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
404 gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
405 gdbarch->deprecated_fp_regnum = -1;
406 gdbarch->call_dummy_location = AT_ENTRY_POINT;
407 gdbarch->print_registers_info = default_print_registers_info;
408 gdbarch->register_sim_regno = legacy_register_sim_regno;
409 gdbarch->cannot_fetch_register = cannot_register_not;
410 gdbarch->cannot_store_register = cannot_register_not;
411 gdbarch->convert_register_p = generic_convert_register_p;
412 gdbarch->value_from_register = default_value_from_register;
413 gdbarch->pointer_to_address = unsigned_pointer_to_address;
414 gdbarch->address_to_pointer = unsigned_address_to_pointer;
415 gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
416 gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
417 gdbarch->remote_register_number = default_remote_register_number;
418 gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
419 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
420 gdbarch->addr_bits_remove = core_addr_identity;
421 gdbarch->smash_text_address = core_addr_identity;
422 gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
423 gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
424 gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
425 gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
426 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
427 gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
428 gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
429 gdbarch->name_of_malloc = "malloc";
430 gdbarch->register_reggroup_p = default_register_reggroup_p;
431 /* gdbarch_alloc() */
437 /* Allocate extra space using the per-architecture obstack. */
440 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
442 void *data = obstack_alloc (arch->obstack, size);
443 memset (data, 0, size);
448 /* Free a gdbarch struct. This should never happen in normal
449 operation --- once you've created a gdbarch, you keep it around.
450 However, if an architecture's init function encounters an error
451 building the structure, it may need to clean up a partially
452 constructed gdbarch. */
455 gdbarch_free (struct gdbarch *arch)
457 struct obstack *obstack;
458 gdb_assert (arch != NULL);
459 gdb_assert (!arch->initialized_p);
460 obstack = arch->obstack;
461 obstack_free (obstack, 0); /* Includes the ARCH. */
466 /* Ensure that all values in a GDBARCH are reasonable. */
469 verify_gdbarch (struct gdbarch *gdbarch)
472 struct cleanup *cleanups;
475 log = mem_fileopen ();
476 cleanups = make_cleanup_ui_file_delete (log);
478 if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
479 fprintf_unfiltered (log, "\n\tbyte-order");
480 if (gdbarch->bfd_arch_info == NULL)
481 fprintf_unfiltered (log, "\n\tbfd_arch_info");
482 /* Check those that need to be defined for the given multi-arch level. */
483 /* Skip verify of short_bit, invalid_p == 0 */
484 /* Skip verify of int_bit, invalid_p == 0 */
485 /* Skip verify of long_bit, invalid_p == 0 */
486 /* Skip verify of long_long_bit, invalid_p == 0 */
487 /* Skip verify of float_bit, invalid_p == 0 */
488 if (gdbarch->float_format == 0)
489 gdbarch->float_format = floatformats_ieee_single;
490 /* Skip verify of double_bit, invalid_p == 0 */
491 if (gdbarch->double_format == 0)
492 gdbarch->double_format = floatformats_ieee_double;
493 /* Skip verify of long_double_bit, invalid_p == 0 */
494 if (gdbarch->long_double_format == 0)
495 gdbarch->long_double_format = floatformats_ieee_double;
496 /* Skip verify of ptr_bit, invalid_p == 0 */
497 if (gdbarch->addr_bit == 0)
498 gdbarch->addr_bit = gdbarch_ptr_bit (gdbarch);
499 if (gdbarch->char_signed == -1)
500 gdbarch->char_signed = 1;
501 /* Skip verify of read_pc, has predicate */
502 /* Skip verify of write_pc, has predicate */
503 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
504 /* Skip verify of pseudo_register_read, has predicate */
505 /* Skip verify of pseudo_register_write, has predicate */
506 if (gdbarch->num_regs == -1)
507 fprintf_unfiltered (log, "\n\tnum_regs");
508 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
509 /* Skip verify of sp_regnum, invalid_p == 0 */
510 /* Skip verify of pc_regnum, invalid_p == 0 */
511 /* Skip verify of ps_regnum, invalid_p == 0 */
512 /* Skip verify of fp0_regnum, invalid_p == 0 */
513 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
514 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
515 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
516 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
517 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
518 if (gdbarch->register_name == 0)
519 fprintf_unfiltered (log, "\n\tregister_name");
520 /* Skip verify of register_type, has predicate */
521 /* Skip verify of unwind_dummy_id, has predicate */
522 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
523 /* Skip verify of push_dummy_call, has predicate */
524 /* Skip verify of call_dummy_location, invalid_p == 0 */
525 /* Skip verify of push_dummy_code, has predicate */
526 /* Skip verify of print_registers_info, invalid_p == 0 */
527 /* Skip verify of print_float_info, has predicate */
528 /* Skip verify of print_vector_info, has predicate */
529 /* Skip verify of register_sim_regno, invalid_p == 0 */
530 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
531 /* Skip verify of cannot_store_register, invalid_p == 0 */
532 /* Skip verify of get_longjmp_target, has predicate */
533 /* Skip verify of convert_register_p, invalid_p == 0 */
534 /* Skip verify of value_from_register, invalid_p == 0 */
535 /* Skip verify of pointer_to_address, invalid_p == 0 */
536 /* Skip verify of address_to_pointer, invalid_p == 0 */
537 /* Skip verify of integer_to_address, has predicate */
538 /* Skip verify of return_value, has predicate */
539 if (gdbarch->skip_prologue == 0)
540 fprintf_unfiltered (log, "\n\tskip_prologue");
541 if (gdbarch->inner_than == 0)
542 fprintf_unfiltered (log, "\n\tinner_than");
543 if (gdbarch->breakpoint_from_pc == 0)
544 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
545 /* Skip verify of adjust_breakpoint_address, has predicate */
546 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
547 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
548 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
549 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
550 /* Skip verify of remote_register_number, invalid_p == 0 */
551 /* Skip verify of fetch_tls_load_module_address, has predicate */
552 /* Skip verify of frame_args_skip, invalid_p == 0 */
553 /* Skip verify of unwind_pc, has predicate */
554 /* Skip verify of unwind_sp, has predicate */
555 /* Skip verify of frame_num_args, has predicate */
556 /* Skip verify of frame_align, has predicate */
557 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
558 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
559 /* Skip verify of addr_bits_remove, invalid_p == 0 */
560 /* Skip verify of smash_text_address, invalid_p == 0 */
561 /* Skip verify of software_single_step, has predicate */
562 /* Skip verify of single_step_through_delay, has predicate */
563 if (gdbarch->print_insn == 0)
564 fprintf_unfiltered (log, "\n\tprint_insn");
565 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
566 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
567 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
568 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
569 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
570 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
571 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
572 /* Skip verify of name_of_malloc, invalid_p == 0 */
573 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
574 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
575 /* Skip verify of address_class_type_flags, has predicate */
576 /* Skip verify of address_class_type_flags_to_name, has predicate */
577 /* Skip verify of address_class_name_to_type_flags, has predicate */
578 /* Skip verify of register_reggroup_p, invalid_p == 0 */
579 /* Skip verify of fetch_pointer_argument, has predicate */
580 /* Skip verify of regset_from_core_section, has predicate */
581 /* Skip verify of core_xfer_shared_libraries, has predicate */
582 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
583 /* Skip verify of vbit_in_delta, invalid_p == 0 */
584 /* Skip verify of skip_permanent_breakpoint, has predicate */
585 /* Skip verify of overlay_update, has predicate */
586 /* Skip verify of core_read_description, has predicate */
587 /* Skip verify of static_transform_name, has predicate */
588 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
589 buf = ui_file_xstrdup (log, &dummy);
590 make_cleanup (xfree, buf);
591 if (strlen (buf) > 0)
592 internal_error (__FILE__, __LINE__,
593 _("verify_gdbarch: the following are invalid ...%s"),
595 do_cleanups (cleanups);
599 /* Print out the details of the current architecture. */
602 gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
604 const char *gdb_xm_file = "<not-defined>";
605 const char *gdb_nm_file = "<not-defined>";
606 const char *gdb_tm_file = "<not-defined>";
607 #if defined (GDB_XM_FILE)
608 gdb_xm_file = GDB_XM_FILE;
610 fprintf_unfiltered (file,
611 "gdbarch_dump: GDB_XM_FILE = %s\n",
613 #if defined (GDB_NM_FILE)
614 gdb_nm_file = GDB_NM_FILE;
616 fprintf_unfiltered (file,
617 "gdbarch_dump: GDB_NM_FILE = %s\n",
619 #if defined (GDB_TM_FILE)
620 gdb_tm_file = GDB_TM_FILE;
622 fprintf_unfiltered (file,
623 "gdbarch_dump: GDB_TM_FILE = %s\n",
625 fprintf_unfiltered (file,
626 "gdbarch_dump: addr_bit = %s\n",
627 paddr_d (gdbarch->addr_bit));
628 fprintf_unfiltered (file,
629 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
630 (long) gdbarch->addr_bits_remove);
631 fprintf_unfiltered (file,
632 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
633 gdbarch_address_class_name_to_type_flags_p (gdbarch));
634 fprintf_unfiltered (file,
635 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
636 (long) gdbarch->address_class_name_to_type_flags);
637 fprintf_unfiltered (file,
638 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
639 gdbarch_address_class_type_flags_p (gdbarch));
640 fprintf_unfiltered (file,
641 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
642 (long) gdbarch->address_class_type_flags);
643 fprintf_unfiltered (file,
644 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
645 gdbarch_address_class_type_flags_to_name_p (gdbarch));
646 fprintf_unfiltered (file,
647 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
648 (long) gdbarch->address_class_type_flags_to_name);
649 fprintf_unfiltered (file,
650 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
651 (long) gdbarch->address_to_pointer);
652 fprintf_unfiltered (file,
653 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
654 gdbarch_adjust_breakpoint_address_p (gdbarch));
655 fprintf_unfiltered (file,
656 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
657 (long) gdbarch->adjust_breakpoint_address);
658 fprintf_unfiltered (file,
659 "gdbarch_dump: believe_pcc_promotion = %s\n",
660 paddr_d (gdbarch->believe_pcc_promotion));
661 fprintf_unfiltered (file,
662 "gdbarch_dump: bfd_arch_info = %s\n",
663 gdbarch_bfd_arch_info (gdbarch)->printable_name);
664 fprintf_unfiltered (file,
665 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
666 (long) gdbarch->breakpoint_from_pc);
667 fprintf_unfiltered (file,
668 "gdbarch_dump: byte_order = %s\n",
669 paddr_d (gdbarch->byte_order));
670 fprintf_unfiltered (file,
671 "gdbarch_dump: call_dummy_location = %s\n",
672 paddr_d (gdbarch->call_dummy_location));
673 fprintf_unfiltered (file,
674 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
675 (long) gdbarch->cannot_fetch_register);
676 fprintf_unfiltered (file,
677 "gdbarch_dump: cannot_step_breakpoint = %s\n",
678 paddr_d (gdbarch->cannot_step_breakpoint));
679 fprintf_unfiltered (file,
680 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
681 (long) gdbarch->cannot_store_register);
682 fprintf_unfiltered (file,
683 "gdbarch_dump: char_signed = %s\n",
684 paddr_d (gdbarch->char_signed));
685 fprintf_unfiltered (file,
686 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
687 (long) gdbarch->coff_make_msymbol_special);
688 fprintf_unfiltered (file,
689 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
690 (long) gdbarch->construct_inferior_arguments);
691 fprintf_unfiltered (file,
692 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
693 (long) gdbarch->convert_from_func_ptr_addr);
694 fprintf_unfiltered (file,
695 "gdbarch_dump: convert_register_p = <0x%lx>\n",
696 (long) gdbarch->convert_register_p);
697 fprintf_unfiltered (file,
698 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
699 gdbarch_core_read_description_p (gdbarch));
700 fprintf_unfiltered (file,
701 "gdbarch_dump: core_read_description = <0x%lx>\n",
702 (long) gdbarch->core_read_description);
703 fprintf_unfiltered (file,
704 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
705 gdbarch_core_xfer_shared_libraries_p (gdbarch));
706 fprintf_unfiltered (file,
707 "gdbarch_dump: core_xfer_shared_libraries = <0x%lx>\n",
708 (long) gdbarch->core_xfer_shared_libraries);
709 fprintf_unfiltered (file,
710 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
711 paddr_nz (gdbarch->decr_pc_after_break));
712 fprintf_unfiltered (file,
713 "gdbarch_dump: deprecated_fp_regnum = %s\n",
714 paddr_d (gdbarch->deprecated_fp_regnum));
715 fprintf_unfiltered (file,
716 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
717 paddr_nz (gdbarch->deprecated_function_start_offset));
718 fprintf_unfiltered (file,
719 "gdbarch_dump: double_bit = %s\n",
720 paddr_d (gdbarch->double_bit));
721 fprintf_unfiltered (file,
722 "gdbarch_dump: double_format = %s\n",
723 pformat (gdbarch->double_format));
724 fprintf_unfiltered (file,
725 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
726 (long) gdbarch->dwarf2_reg_to_regnum);
727 fprintf_unfiltered (file,
728 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
729 (long) gdbarch->dwarf_reg_to_regnum);
730 fprintf_unfiltered (file,
731 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
732 (long) gdbarch->ecoff_reg_to_regnum);
733 fprintf_unfiltered (file,
734 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
735 (long) gdbarch->elf_make_msymbol_special);
736 fprintf_unfiltered (file,
737 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
738 gdbarch_fetch_pointer_argument_p (gdbarch));
739 fprintf_unfiltered (file,
740 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
741 (long) gdbarch->fetch_pointer_argument);
742 fprintf_unfiltered (file,
743 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
744 gdbarch_fetch_tls_load_module_address_p (gdbarch));
745 fprintf_unfiltered (file,
746 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
747 (long) gdbarch->fetch_tls_load_module_address);
748 fprintf_unfiltered (file,
749 "gdbarch_dump: float_bit = %s\n",
750 paddr_d (gdbarch->float_bit));
751 fprintf_unfiltered (file,
752 "gdbarch_dump: float_format = %s\n",
753 pformat (gdbarch->float_format));
754 fprintf_unfiltered (file,
755 "gdbarch_dump: fp0_regnum = %s\n",
756 paddr_d (gdbarch->fp0_regnum));
757 fprintf_unfiltered (file,
758 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
759 gdbarch_frame_align_p (gdbarch));
760 fprintf_unfiltered (file,
761 "gdbarch_dump: frame_align = <0x%lx>\n",
762 (long) gdbarch->frame_align);
763 fprintf_unfiltered (file,
764 "gdbarch_dump: frame_args_skip = 0x%s\n",
765 paddr_nz (gdbarch->frame_args_skip));
766 fprintf_unfiltered (file,
767 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
768 gdbarch_frame_num_args_p (gdbarch));
769 fprintf_unfiltered (file,
770 "gdbarch_dump: frame_num_args = <0x%lx>\n",
771 (long) gdbarch->frame_num_args);
772 fprintf_unfiltered (file,
773 "gdbarch_dump: frame_red_zone_size = %s\n",
774 paddr_d (gdbarch->frame_red_zone_size));
775 fprintf_unfiltered (file,
776 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
777 gdbarch_get_longjmp_target_p (gdbarch));
778 fprintf_unfiltered (file,
779 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
780 (long) gdbarch->get_longjmp_target);
781 fprintf_unfiltered (file,
782 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
783 paddr_d (gdbarch->have_nonsteppable_watchpoint));
784 fprintf_unfiltered (file,
785 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
786 (long) gdbarch->in_function_epilogue_p);
787 fprintf_unfiltered (file,
788 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
789 (long) gdbarch->in_solib_return_trampoline);
790 fprintf_unfiltered (file,
791 "gdbarch_dump: inner_than = <0x%lx>\n",
792 (long) gdbarch->inner_than);
793 fprintf_unfiltered (file,
794 "gdbarch_dump: int_bit = %s\n",
795 paddr_d (gdbarch->int_bit));
796 fprintf_unfiltered (file,
797 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
798 gdbarch_integer_to_address_p (gdbarch));
799 fprintf_unfiltered (file,
800 "gdbarch_dump: integer_to_address = <0x%lx>\n",
801 (long) gdbarch->integer_to_address);
802 fprintf_unfiltered (file,
803 "gdbarch_dump: long_bit = %s\n",
804 paddr_d (gdbarch->long_bit));
805 fprintf_unfiltered (file,
806 "gdbarch_dump: long_double_bit = %s\n",
807 paddr_d (gdbarch->long_double_bit));
808 fprintf_unfiltered (file,
809 "gdbarch_dump: long_double_format = %s\n",
810 pformat (gdbarch->long_double_format));
811 fprintf_unfiltered (file,
812 "gdbarch_dump: long_long_bit = %s\n",
813 paddr_d (gdbarch->long_long_bit));
814 fprintf_unfiltered (file,
815 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
816 (long) gdbarch->memory_insert_breakpoint);
817 fprintf_unfiltered (file,
818 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
819 (long) gdbarch->memory_remove_breakpoint);
820 fprintf_unfiltered (file,
821 "gdbarch_dump: name_of_malloc = %s\n",
822 gdbarch->name_of_malloc);
823 fprintf_unfiltered (file,
824 "gdbarch_dump: num_pseudo_regs = %s\n",
825 paddr_d (gdbarch->num_pseudo_regs));
826 fprintf_unfiltered (file,
827 "gdbarch_dump: num_regs = %s\n",
828 paddr_d (gdbarch->num_regs));
829 fprintf_unfiltered (file,
830 "gdbarch_dump: osabi = %s\n",
831 paddr_d (gdbarch->osabi));
832 fprintf_unfiltered (file,
833 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
834 gdbarch_overlay_update_p (gdbarch));
835 fprintf_unfiltered (file,
836 "gdbarch_dump: overlay_update = <0x%lx>\n",
837 (long) gdbarch->overlay_update);
838 fprintf_unfiltered (file,
839 "gdbarch_dump: pc_regnum = %s\n",
840 paddr_d (gdbarch->pc_regnum));
841 fprintf_unfiltered (file,
842 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
843 (long) gdbarch->pointer_to_address);
844 fprintf_unfiltered (file,
845 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
846 gdbarch_print_float_info_p (gdbarch));
847 fprintf_unfiltered (file,
848 "gdbarch_dump: print_float_info = <0x%lx>\n",
849 (long) gdbarch->print_float_info);
850 fprintf_unfiltered (file,
851 "gdbarch_dump: print_insn = <0x%lx>\n",
852 (long) gdbarch->print_insn);
853 fprintf_unfiltered (file,
854 "gdbarch_dump: print_registers_info = <0x%lx>\n",
855 (long) gdbarch->print_registers_info);
856 fprintf_unfiltered (file,
857 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
858 gdbarch_print_vector_info_p (gdbarch));
859 fprintf_unfiltered (file,
860 "gdbarch_dump: print_vector_info = <0x%lx>\n",
861 (long) gdbarch->print_vector_info);
862 fprintf_unfiltered (file,
863 "gdbarch_dump: ps_regnum = %s\n",
864 paddr_d (gdbarch->ps_regnum));
865 fprintf_unfiltered (file,
866 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
867 gdbarch_pseudo_register_read_p (gdbarch));
868 fprintf_unfiltered (file,
869 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
870 (long) gdbarch->pseudo_register_read);
871 fprintf_unfiltered (file,
872 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
873 gdbarch_pseudo_register_write_p (gdbarch));
874 fprintf_unfiltered (file,
875 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
876 (long) gdbarch->pseudo_register_write);
877 fprintf_unfiltered (file,
878 "gdbarch_dump: ptr_bit = %s\n",
879 paddr_d (gdbarch->ptr_bit));
880 fprintf_unfiltered (file,
881 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
882 gdbarch_push_dummy_call_p (gdbarch));
883 fprintf_unfiltered (file,
884 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
885 (long) gdbarch->push_dummy_call);
886 fprintf_unfiltered (file,
887 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
888 gdbarch_push_dummy_code_p (gdbarch));
889 fprintf_unfiltered (file,
890 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
891 (long) gdbarch->push_dummy_code);
892 fprintf_unfiltered (file,
893 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
894 gdbarch_read_pc_p (gdbarch));
895 fprintf_unfiltered (file,
896 "gdbarch_dump: read_pc = <0x%lx>\n",
897 (long) gdbarch->read_pc);
898 fprintf_unfiltered (file,
899 "gdbarch_dump: register_name = <0x%lx>\n",
900 (long) gdbarch->register_name);
901 fprintf_unfiltered (file,
902 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
903 (long) gdbarch->register_reggroup_p);
904 fprintf_unfiltered (file,
905 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
906 (long) gdbarch->register_sim_regno);
907 fprintf_unfiltered (file,
908 "gdbarch_dump: register_to_value = <0x%lx>\n",
909 (long) gdbarch->register_to_value);
910 fprintf_unfiltered (file,
911 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
912 gdbarch_register_type_p (gdbarch));
913 fprintf_unfiltered (file,
914 "gdbarch_dump: register_type = <0x%lx>\n",
915 (long) gdbarch->register_type);
916 fprintf_unfiltered (file,
917 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
918 gdbarch_regset_from_core_section_p (gdbarch));
919 fprintf_unfiltered (file,
920 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
921 (long) gdbarch->regset_from_core_section);
922 fprintf_unfiltered (file,
923 "gdbarch_dump: remote_register_number = <0x%lx>\n",
924 (long) gdbarch->remote_register_number);
925 fprintf_unfiltered (file,
926 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
927 gdbarch_return_value_p (gdbarch));
928 fprintf_unfiltered (file,
929 "gdbarch_dump: return_value = <0x%lx>\n",
930 (long) gdbarch->return_value);
931 fprintf_unfiltered (file,
932 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
933 (long) gdbarch->sdb_reg_to_regnum);
934 fprintf_unfiltered (file,
935 "gdbarch_dump: short_bit = %s\n",
936 paddr_d (gdbarch->short_bit));
937 fprintf_unfiltered (file,
938 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
939 gdbarch_single_step_through_delay_p (gdbarch));
940 fprintf_unfiltered (file,
941 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
942 (long) gdbarch->single_step_through_delay);
943 fprintf_unfiltered (file,
944 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
945 gdbarch_skip_permanent_breakpoint_p (gdbarch));
946 fprintf_unfiltered (file,
947 "gdbarch_dump: skip_permanent_breakpoint = <0x%lx>\n",
948 (long) gdbarch->skip_permanent_breakpoint);
949 fprintf_unfiltered (file,
950 "gdbarch_dump: skip_prologue = <0x%lx>\n",
951 (long) gdbarch->skip_prologue);
952 fprintf_unfiltered (file,
953 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
954 (long) gdbarch->skip_solib_resolver);
955 fprintf_unfiltered (file,
956 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
957 (long) gdbarch->skip_trampoline_code);
958 fprintf_unfiltered (file,
959 "gdbarch_dump: smash_text_address = <0x%lx>\n",
960 (long) gdbarch->smash_text_address);
961 fprintf_unfiltered (file,
962 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
963 gdbarch_software_single_step_p (gdbarch));
964 fprintf_unfiltered (file,
965 "gdbarch_dump: software_single_step = <0x%lx>\n",
966 (long) gdbarch->software_single_step);
967 fprintf_unfiltered (file,
968 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
969 paddr_d (gdbarch->sofun_address_maybe_missing));
970 fprintf_unfiltered (file,
971 "gdbarch_dump: sp_regnum = %s\n",
972 paddr_d (gdbarch->sp_regnum));
973 fprintf_unfiltered (file,
974 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
975 (long) gdbarch->stab_reg_to_regnum);
976 fprintf_unfiltered (file,
977 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
978 (long) gdbarch->stabs_argument_has_addr);
979 fprintf_unfiltered (file,
980 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
981 gdbarch_static_transform_name_p (gdbarch));
982 fprintf_unfiltered (file,
983 "gdbarch_dump: static_transform_name = <0x%lx>\n",
984 (long) gdbarch->static_transform_name);
985 fprintf_unfiltered (file,
986 "gdbarch_dump: target_desc = %s\n",
987 paddr_d ((long) gdbarch->target_desc));
988 fprintf_unfiltered (file,
989 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
990 gdbarch_unwind_dummy_id_p (gdbarch));
991 fprintf_unfiltered (file,
992 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
993 (long) gdbarch->unwind_dummy_id);
994 fprintf_unfiltered (file,
995 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
996 gdbarch_unwind_pc_p (gdbarch));
997 fprintf_unfiltered (file,
998 "gdbarch_dump: unwind_pc = <0x%lx>\n",
999 (long) gdbarch->unwind_pc);
1000 fprintf_unfiltered (file,
1001 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1002 gdbarch_unwind_sp_p (gdbarch));
1003 fprintf_unfiltered (file,
1004 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1005 (long) gdbarch->unwind_sp);
1006 fprintf_unfiltered (file,
1007 "gdbarch_dump: value_from_register = <0x%lx>\n",
1008 (long) gdbarch->value_from_register);
1009 fprintf_unfiltered (file,
1010 "gdbarch_dump: value_to_register = <0x%lx>\n",
1011 (long) gdbarch->value_to_register);
1012 fprintf_unfiltered (file,
1013 "gdbarch_dump: vbit_in_delta = %s\n",
1014 paddr_d (gdbarch->vbit_in_delta));
1015 fprintf_unfiltered (file,
1016 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1017 (long) gdbarch->virtual_frame_pointer);
1018 fprintf_unfiltered (file,
1019 "gdbarch_dump: vtable_function_descriptors = %s\n",
1020 paddr_d (gdbarch->vtable_function_descriptors));
1021 fprintf_unfiltered (file,
1022 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1023 gdbarch_write_pc_p (gdbarch));
1024 fprintf_unfiltered (file,
1025 "gdbarch_dump: write_pc = <0x%lx>\n",
1026 (long) gdbarch->write_pc);
1027 if (gdbarch->dump_tdep != NULL)
1028 gdbarch->dump_tdep (gdbarch, file);
1031 struct gdbarch_tdep *
1032 gdbarch_tdep (struct gdbarch *gdbarch)
1034 if (gdbarch_debug >= 2)
1035 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1036 return gdbarch->tdep;
1040 const struct bfd_arch_info *
1041 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1043 gdb_assert (gdbarch != NULL);
1044 if (gdbarch_debug >= 2)
1045 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1046 return gdbarch->bfd_arch_info;
1050 gdbarch_byte_order (struct gdbarch *gdbarch)
1052 gdb_assert (gdbarch != NULL);
1053 if (gdbarch_debug >= 2)
1054 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1055 return gdbarch->byte_order;
1059 gdbarch_osabi (struct gdbarch *gdbarch)
1061 gdb_assert (gdbarch != NULL);
1062 if (gdbarch_debug >= 2)
1063 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1064 return gdbarch->osabi;
1067 const struct target_desc *
1068 gdbarch_target_desc (struct gdbarch *gdbarch)
1070 gdb_assert (gdbarch != NULL);
1071 if (gdbarch_debug >= 2)
1072 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1073 return gdbarch->target_desc;
1077 gdbarch_short_bit (struct gdbarch *gdbarch)
1079 gdb_assert (gdbarch != NULL);
1080 /* Skip verify of short_bit, invalid_p == 0 */
1081 if (gdbarch_debug >= 2)
1082 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1083 return gdbarch->short_bit;
1087 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1090 gdbarch->short_bit = short_bit;
1094 gdbarch_int_bit (struct gdbarch *gdbarch)
1096 gdb_assert (gdbarch != NULL);
1097 /* Skip verify of int_bit, invalid_p == 0 */
1098 if (gdbarch_debug >= 2)
1099 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1100 return gdbarch->int_bit;
1104 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1107 gdbarch->int_bit = int_bit;
1111 gdbarch_long_bit (struct gdbarch *gdbarch)
1113 gdb_assert (gdbarch != NULL);
1114 /* Skip verify of long_bit, invalid_p == 0 */
1115 if (gdbarch_debug >= 2)
1116 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1117 return gdbarch->long_bit;
1121 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1124 gdbarch->long_bit = long_bit;
1128 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1130 gdb_assert (gdbarch != NULL);
1131 /* Skip verify of long_long_bit, invalid_p == 0 */
1132 if (gdbarch_debug >= 2)
1133 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1134 return gdbarch->long_long_bit;
1138 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1141 gdbarch->long_long_bit = long_long_bit;
1145 gdbarch_float_bit (struct gdbarch *gdbarch)
1147 gdb_assert (gdbarch != NULL);
1148 /* Skip verify of float_bit, invalid_p == 0 */
1149 if (gdbarch_debug >= 2)
1150 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1151 return gdbarch->float_bit;
1155 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1158 gdbarch->float_bit = float_bit;
1161 const struct floatformat **
1162 gdbarch_float_format (struct gdbarch *gdbarch)
1164 gdb_assert (gdbarch != NULL);
1165 if (gdbarch_debug >= 2)
1166 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1167 return gdbarch->float_format;
1171 set_gdbarch_float_format (struct gdbarch *gdbarch,
1172 const struct floatformat ** float_format)
1174 gdbarch->float_format = float_format;
1178 gdbarch_double_bit (struct gdbarch *gdbarch)
1180 gdb_assert (gdbarch != NULL);
1181 /* Skip verify of double_bit, invalid_p == 0 */
1182 if (gdbarch_debug >= 2)
1183 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1184 return gdbarch->double_bit;
1188 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1191 gdbarch->double_bit = double_bit;
1194 const struct floatformat **
1195 gdbarch_double_format (struct gdbarch *gdbarch)
1197 gdb_assert (gdbarch != NULL);
1198 if (gdbarch_debug >= 2)
1199 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1200 return gdbarch->double_format;
1204 set_gdbarch_double_format (struct gdbarch *gdbarch,
1205 const struct floatformat ** double_format)
1207 gdbarch->double_format = double_format;
1211 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1213 gdb_assert (gdbarch != NULL);
1214 /* Skip verify of long_double_bit, invalid_p == 0 */
1215 if (gdbarch_debug >= 2)
1216 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1217 return gdbarch->long_double_bit;
1221 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1222 int long_double_bit)
1224 gdbarch->long_double_bit = long_double_bit;
1227 const struct floatformat **
1228 gdbarch_long_double_format (struct gdbarch *gdbarch)
1230 gdb_assert (gdbarch != NULL);
1231 if (gdbarch_debug >= 2)
1232 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1233 return gdbarch->long_double_format;
1237 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1238 const struct floatformat ** long_double_format)
1240 gdbarch->long_double_format = long_double_format;
1244 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1246 gdb_assert (gdbarch != NULL);
1247 /* Skip verify of ptr_bit, invalid_p == 0 */
1248 if (gdbarch_debug >= 2)
1249 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1250 return gdbarch->ptr_bit;
1254 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1257 gdbarch->ptr_bit = ptr_bit;
1261 gdbarch_addr_bit (struct gdbarch *gdbarch)
1263 gdb_assert (gdbarch != NULL);
1264 /* Check variable changed from pre-default. */
1265 gdb_assert (gdbarch->addr_bit != 0);
1266 if (gdbarch_debug >= 2)
1267 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1268 return gdbarch->addr_bit;
1272 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1275 gdbarch->addr_bit = addr_bit;
1279 gdbarch_char_signed (struct gdbarch *gdbarch)
1281 gdb_assert (gdbarch != NULL);
1282 /* Check variable changed from pre-default. */
1283 gdb_assert (gdbarch->char_signed != -1);
1284 if (gdbarch_debug >= 2)
1285 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1286 return gdbarch->char_signed;
1290 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1293 gdbarch->char_signed = char_signed;
1297 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1299 gdb_assert (gdbarch != NULL);
1300 return gdbarch->read_pc != NULL;
1304 gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache)
1306 gdb_assert (gdbarch != NULL);
1307 gdb_assert (gdbarch->read_pc != NULL);
1308 if (gdbarch_debug >= 2)
1309 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1310 return gdbarch->read_pc (regcache);
1314 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1315 gdbarch_read_pc_ftype read_pc)
1317 gdbarch->read_pc = read_pc;
1321 gdbarch_write_pc_p (struct gdbarch *gdbarch)
1323 gdb_assert (gdbarch != NULL);
1324 return gdbarch->write_pc != NULL;
1328 gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val)
1330 gdb_assert (gdbarch != NULL);
1331 gdb_assert (gdbarch->write_pc != NULL);
1332 if (gdbarch_debug >= 2)
1333 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1334 gdbarch->write_pc (regcache, val);
1338 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1339 gdbarch_write_pc_ftype write_pc)
1341 gdbarch->write_pc = write_pc;
1345 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1347 gdb_assert (gdbarch != NULL);
1348 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1349 if (gdbarch_debug >= 2)
1350 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1351 gdbarch->virtual_frame_pointer (gdbarch, pc, frame_regnum, frame_offset);
1355 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1356 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1358 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1362 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1364 gdb_assert (gdbarch != NULL);
1365 return gdbarch->pseudo_register_read != NULL;
1369 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
1371 gdb_assert (gdbarch != NULL);
1372 gdb_assert (gdbarch->pseudo_register_read != NULL);
1373 if (gdbarch_debug >= 2)
1374 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1375 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1379 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1380 gdbarch_pseudo_register_read_ftype pseudo_register_read)
1382 gdbarch->pseudo_register_read = pseudo_register_read;
1386 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
1388 gdb_assert (gdbarch != NULL);
1389 return gdbarch->pseudo_register_write != NULL;
1393 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
1395 gdb_assert (gdbarch != NULL);
1396 gdb_assert (gdbarch->pseudo_register_write != NULL);
1397 if (gdbarch_debug >= 2)
1398 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1399 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
1403 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1404 gdbarch_pseudo_register_write_ftype pseudo_register_write)
1406 gdbarch->pseudo_register_write = pseudo_register_write;
1410 gdbarch_num_regs (struct gdbarch *gdbarch)
1412 gdb_assert (gdbarch != NULL);
1413 /* Check variable changed from pre-default. */
1414 gdb_assert (gdbarch->num_regs != -1);
1415 if (gdbarch_debug >= 2)
1416 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1417 return gdbarch->num_regs;
1421 set_gdbarch_num_regs (struct gdbarch *gdbarch,
1424 gdbarch->num_regs = num_regs;
1428 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
1430 gdb_assert (gdbarch != NULL);
1431 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1432 if (gdbarch_debug >= 2)
1433 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
1434 return gdbarch->num_pseudo_regs;
1438 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
1439 int num_pseudo_regs)
1441 gdbarch->num_pseudo_regs = num_pseudo_regs;
1445 gdbarch_sp_regnum (struct gdbarch *gdbarch)
1447 gdb_assert (gdbarch != NULL);
1448 /* Skip verify of sp_regnum, invalid_p == 0 */
1449 if (gdbarch_debug >= 2)
1450 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
1451 return gdbarch->sp_regnum;
1455 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
1458 gdbarch->sp_regnum = sp_regnum;
1462 gdbarch_pc_regnum (struct gdbarch *gdbarch)
1464 gdb_assert (gdbarch != NULL);
1465 /* Skip verify of pc_regnum, invalid_p == 0 */
1466 if (gdbarch_debug >= 2)
1467 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
1468 return gdbarch->pc_regnum;
1472 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
1475 gdbarch->pc_regnum = pc_regnum;
1479 gdbarch_ps_regnum (struct gdbarch *gdbarch)
1481 gdb_assert (gdbarch != NULL);
1482 /* Skip verify of ps_regnum, invalid_p == 0 */
1483 if (gdbarch_debug >= 2)
1484 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
1485 return gdbarch->ps_regnum;
1489 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
1492 gdbarch->ps_regnum = ps_regnum;
1496 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
1498 gdb_assert (gdbarch != NULL);
1499 /* Skip verify of fp0_regnum, invalid_p == 0 */
1500 if (gdbarch_debug >= 2)
1501 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
1502 return gdbarch->fp0_regnum;
1506 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
1509 gdbarch->fp0_regnum = fp0_regnum;
1513 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
1515 gdb_assert (gdbarch != NULL);
1516 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
1517 if (gdbarch_debug >= 2)
1518 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
1519 return gdbarch->stab_reg_to_regnum (stab_regnr);
1523 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
1524 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
1526 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
1530 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
1532 gdb_assert (gdbarch != NULL);
1533 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
1534 if (gdbarch_debug >= 2)
1535 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
1536 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
1540 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
1541 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
1543 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
1547 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
1549 gdb_assert (gdbarch != NULL);
1550 gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
1551 if (gdbarch_debug >= 2)
1552 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
1553 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
1557 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
1558 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
1560 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
1564 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
1566 gdb_assert (gdbarch != NULL);
1567 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
1568 if (gdbarch_debug >= 2)
1569 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
1570 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
1574 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
1575 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
1577 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
1581 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
1583 gdb_assert (gdbarch != NULL);
1584 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
1585 if (gdbarch_debug >= 2)
1586 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
1587 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
1591 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
1592 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
1594 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
1598 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
1600 gdb_assert (gdbarch != NULL);
1601 gdb_assert (gdbarch->register_name != NULL);
1602 if (gdbarch_debug >= 2)
1603 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
1604 return gdbarch->register_name (gdbarch, regnr);
1608 set_gdbarch_register_name (struct gdbarch *gdbarch,
1609 gdbarch_register_name_ftype register_name)
1611 gdbarch->register_name = register_name;
1615 gdbarch_register_type_p (struct gdbarch *gdbarch)
1617 gdb_assert (gdbarch != NULL);
1618 return gdbarch->register_type != NULL;
1622 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
1624 gdb_assert (gdbarch != NULL);
1625 gdb_assert (gdbarch->register_type != NULL);
1626 if (gdbarch_debug >= 2)
1627 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
1628 return gdbarch->register_type (gdbarch, reg_nr);
1632 set_gdbarch_register_type (struct gdbarch *gdbarch,
1633 gdbarch_register_type_ftype register_type)
1635 gdbarch->register_type = register_type;
1639 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
1641 gdb_assert (gdbarch != NULL);
1642 return gdbarch->unwind_dummy_id != NULL;
1646 gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
1648 gdb_assert (gdbarch != NULL);
1649 gdb_assert (gdbarch->unwind_dummy_id != NULL);
1650 if (gdbarch_debug >= 2)
1651 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
1652 return gdbarch->unwind_dummy_id (gdbarch, info);
1656 set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
1657 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
1659 gdbarch->unwind_dummy_id = unwind_dummy_id;
1663 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
1665 gdb_assert (gdbarch != NULL);
1666 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1667 if (gdbarch_debug >= 2)
1668 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
1669 return gdbarch->deprecated_fp_regnum;
1673 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
1674 int deprecated_fp_regnum)
1676 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
1680 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
1682 gdb_assert (gdbarch != NULL);
1683 return gdbarch->push_dummy_call != NULL;
1687 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)
1689 gdb_assert (gdbarch != NULL);
1690 gdb_assert (gdbarch->push_dummy_call != NULL);
1691 if (gdbarch_debug >= 2)
1692 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
1693 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
1697 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
1698 gdbarch_push_dummy_call_ftype push_dummy_call)
1700 gdbarch->push_dummy_call = push_dummy_call;
1704 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
1706 gdb_assert (gdbarch != NULL);
1707 /* Skip verify of call_dummy_location, invalid_p == 0 */
1708 if (gdbarch_debug >= 2)
1709 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
1710 return gdbarch->call_dummy_location;
1714 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
1715 int call_dummy_location)
1717 gdbarch->call_dummy_location = call_dummy_location;
1721 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
1723 gdb_assert (gdbarch != NULL);
1724 return gdbarch->push_dummy_code != NULL;
1728 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)
1730 gdb_assert (gdbarch != NULL);
1731 gdb_assert (gdbarch->push_dummy_code != NULL);
1732 if (gdbarch_debug >= 2)
1733 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
1734 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache);
1738 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
1739 gdbarch_push_dummy_code_ftype push_dummy_code)
1741 gdbarch->push_dummy_code = push_dummy_code;
1745 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
1747 gdb_assert (gdbarch != NULL);
1748 gdb_assert (gdbarch->print_registers_info != NULL);
1749 if (gdbarch_debug >= 2)
1750 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
1751 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
1755 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
1756 gdbarch_print_registers_info_ftype print_registers_info)
1758 gdbarch->print_registers_info = print_registers_info;
1762 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
1764 gdb_assert (gdbarch != NULL);
1765 return gdbarch->print_float_info != NULL;
1769 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1771 gdb_assert (gdbarch != NULL);
1772 gdb_assert (gdbarch->print_float_info != NULL);
1773 if (gdbarch_debug >= 2)
1774 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
1775 gdbarch->print_float_info (gdbarch, file, frame, args);
1779 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
1780 gdbarch_print_float_info_ftype print_float_info)
1782 gdbarch->print_float_info = print_float_info;
1786 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
1788 gdb_assert (gdbarch != NULL);
1789 return gdbarch->print_vector_info != NULL;
1793 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1795 gdb_assert (gdbarch != NULL);
1796 gdb_assert (gdbarch->print_vector_info != NULL);
1797 if (gdbarch_debug >= 2)
1798 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
1799 gdbarch->print_vector_info (gdbarch, file, frame, args);
1803 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
1804 gdbarch_print_vector_info_ftype print_vector_info)
1806 gdbarch->print_vector_info = print_vector_info;
1810 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
1812 gdb_assert (gdbarch != NULL);
1813 gdb_assert (gdbarch->register_sim_regno != NULL);
1814 if (gdbarch_debug >= 2)
1815 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
1816 return gdbarch->register_sim_regno (reg_nr);
1820 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
1821 gdbarch_register_sim_regno_ftype register_sim_regno)
1823 gdbarch->register_sim_regno = register_sim_regno;
1827 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
1829 gdb_assert (gdbarch != NULL);
1830 gdb_assert (gdbarch->cannot_fetch_register != NULL);
1831 if (gdbarch_debug >= 2)
1832 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
1833 return gdbarch->cannot_fetch_register (regnum);
1837 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
1838 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
1840 gdbarch->cannot_fetch_register = cannot_fetch_register;
1844 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
1846 gdb_assert (gdbarch != NULL);
1847 gdb_assert (gdbarch->cannot_store_register != NULL);
1848 if (gdbarch_debug >= 2)
1849 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
1850 return gdbarch->cannot_store_register (regnum);
1854 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
1855 gdbarch_cannot_store_register_ftype cannot_store_register)
1857 gdbarch->cannot_store_register = cannot_store_register;
1861 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
1863 gdb_assert (gdbarch != NULL);
1864 return gdbarch->get_longjmp_target != NULL;
1868 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc)
1870 gdb_assert (gdbarch != NULL);
1871 gdb_assert (gdbarch->get_longjmp_target != NULL);
1872 if (gdbarch_debug >= 2)
1873 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
1874 return gdbarch->get_longjmp_target (frame, pc);
1878 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
1879 gdbarch_get_longjmp_target_ftype get_longjmp_target)
1881 gdbarch->get_longjmp_target = get_longjmp_target;
1885 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
1887 gdb_assert (gdbarch != NULL);
1888 if (gdbarch_debug >= 2)
1889 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
1890 return gdbarch->believe_pcc_promotion;
1894 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
1895 int believe_pcc_promotion)
1897 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
1901 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
1903 gdb_assert (gdbarch != NULL);
1904 gdb_assert (gdbarch->convert_register_p != NULL);
1905 if (gdbarch_debug >= 2)
1906 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
1907 return gdbarch->convert_register_p (gdbarch, regnum, type);
1911 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
1912 gdbarch_convert_register_p_ftype convert_register_p)
1914 gdbarch->convert_register_p = convert_register_p;
1918 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf)
1920 gdb_assert (gdbarch != NULL);
1921 gdb_assert (gdbarch->register_to_value != NULL);
1922 if (gdbarch_debug >= 2)
1923 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
1924 gdbarch->register_to_value (frame, regnum, type, buf);
1928 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
1929 gdbarch_register_to_value_ftype register_to_value)
1931 gdbarch->register_to_value = register_to_value;
1935 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
1937 gdb_assert (gdbarch != NULL);
1938 gdb_assert (gdbarch->value_to_register != NULL);
1939 if (gdbarch_debug >= 2)
1940 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
1941 gdbarch->value_to_register (frame, regnum, type, buf);
1945 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
1946 gdbarch_value_to_register_ftype value_to_register)
1948 gdbarch->value_to_register = value_to_register;
1952 gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
1954 gdb_assert (gdbarch != NULL);
1955 gdb_assert (gdbarch->value_from_register != NULL);
1956 if (gdbarch_debug >= 2)
1957 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
1958 return gdbarch->value_from_register (type, regnum, frame);
1962 set_gdbarch_value_from_register (struct gdbarch *gdbarch,
1963 gdbarch_value_from_register_ftype value_from_register)
1965 gdbarch->value_from_register = value_from_register;
1969 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
1971 gdb_assert (gdbarch != NULL);
1972 gdb_assert (gdbarch->pointer_to_address != NULL);
1973 if (gdbarch_debug >= 2)
1974 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
1975 return gdbarch->pointer_to_address (type, buf);
1979 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
1980 gdbarch_pointer_to_address_ftype pointer_to_address)
1982 gdbarch->pointer_to_address = pointer_to_address;
1986 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
1988 gdb_assert (gdbarch != NULL);
1989 gdb_assert (gdbarch->address_to_pointer != NULL);
1990 if (gdbarch_debug >= 2)
1991 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
1992 gdbarch->address_to_pointer (type, buf, addr);
1996 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
1997 gdbarch_address_to_pointer_ftype address_to_pointer)
1999 gdbarch->address_to_pointer = address_to_pointer;
2003 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2005 gdb_assert (gdbarch != NULL);
2006 return gdbarch->integer_to_address != NULL;
2010 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2012 gdb_assert (gdbarch != NULL);
2013 gdb_assert (gdbarch->integer_to_address != NULL);
2014 if (gdbarch_debug >= 2)
2015 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2016 return gdbarch->integer_to_address (gdbarch, type, buf);
2020 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2021 gdbarch_integer_to_address_ftype integer_to_address)
2023 gdbarch->integer_to_address = integer_to_address;
2027 gdbarch_return_value_p (struct gdbarch *gdbarch)
2029 gdb_assert (gdbarch != NULL);
2030 return gdbarch->return_value != NULL;
2033 enum return_value_convention
2034 gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2036 gdb_assert (gdbarch != NULL);
2037 gdb_assert (gdbarch->return_value != NULL);
2038 if (gdbarch_debug >= 2)
2039 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2040 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
2044 set_gdbarch_return_value (struct gdbarch *gdbarch,
2045 gdbarch_return_value_ftype return_value)
2047 gdbarch->return_value = return_value;
2051 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2053 gdb_assert (gdbarch != NULL);
2054 gdb_assert (gdbarch->skip_prologue != NULL);
2055 if (gdbarch_debug >= 2)
2056 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2057 return gdbarch->skip_prologue (ip);
2061 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2062 gdbarch_skip_prologue_ftype skip_prologue)
2064 gdbarch->skip_prologue = skip_prologue;
2068 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2070 gdb_assert (gdbarch != NULL);
2071 gdb_assert (gdbarch->inner_than != NULL);
2072 if (gdbarch_debug >= 2)
2073 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2074 return gdbarch->inner_than (lhs, rhs);
2078 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2079 gdbarch_inner_than_ftype inner_than)
2081 gdbarch->inner_than = inner_than;
2085 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2087 gdb_assert (gdbarch != NULL);
2088 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2089 if (gdbarch_debug >= 2)
2090 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2091 return gdbarch->breakpoint_from_pc (gdbarch, pcptr, lenptr);
2095 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2096 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2098 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2102 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2104 gdb_assert (gdbarch != NULL);
2105 return gdbarch->adjust_breakpoint_address != NULL;
2109 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2111 gdb_assert (gdbarch != NULL);
2112 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2113 if (gdbarch_debug >= 2)
2114 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2115 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2119 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2120 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2122 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2126 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2128 gdb_assert (gdbarch != NULL);
2129 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2130 if (gdbarch_debug >= 2)
2131 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2132 return gdbarch->memory_insert_breakpoint (bp_tgt);
2136 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2137 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2139 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2143 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2145 gdb_assert (gdbarch != NULL);
2146 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2147 if (gdbarch_debug >= 2)
2148 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2149 return gdbarch->memory_remove_breakpoint (bp_tgt);
2153 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2154 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2156 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2160 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2162 gdb_assert (gdbarch != NULL);
2163 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2164 if (gdbarch_debug >= 2)
2165 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2166 return gdbarch->decr_pc_after_break;
2170 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2171 CORE_ADDR decr_pc_after_break)
2173 gdbarch->decr_pc_after_break = decr_pc_after_break;
2177 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2179 gdb_assert (gdbarch != NULL);
2180 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2181 if (gdbarch_debug >= 2)
2182 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2183 return gdbarch->deprecated_function_start_offset;
2187 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2188 CORE_ADDR deprecated_function_start_offset)
2190 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2194 gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
2196 gdb_assert (gdbarch != NULL);
2197 gdb_assert (gdbarch->remote_register_number != NULL);
2198 if (gdbarch_debug >= 2)
2199 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
2200 return gdbarch->remote_register_number (gdbarch, regno);
2204 set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
2205 gdbarch_remote_register_number_ftype remote_register_number)
2207 gdbarch->remote_register_number = remote_register_number;
2211 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2213 gdb_assert (gdbarch != NULL);
2214 return gdbarch->fetch_tls_load_module_address != NULL;
2218 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
2220 gdb_assert (gdbarch != NULL);
2221 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
2222 if (gdbarch_debug >= 2)
2223 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
2224 return gdbarch->fetch_tls_load_module_address (objfile);
2228 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
2229 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
2231 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
2235 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
2237 gdb_assert (gdbarch != NULL);
2238 /* Skip verify of frame_args_skip, invalid_p == 0 */
2239 if (gdbarch_debug >= 2)
2240 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2241 return gdbarch->frame_args_skip;
2245 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2246 CORE_ADDR frame_args_skip)
2248 gdbarch->frame_args_skip = frame_args_skip;
2252 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
2254 gdb_assert (gdbarch != NULL);
2255 return gdbarch->unwind_pc != NULL;
2259 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
2261 gdb_assert (gdbarch != NULL);
2262 gdb_assert (gdbarch->unwind_pc != NULL);
2263 if (gdbarch_debug >= 2)
2264 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
2265 return gdbarch->unwind_pc (gdbarch, next_frame);
2269 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
2270 gdbarch_unwind_pc_ftype unwind_pc)
2272 gdbarch->unwind_pc = unwind_pc;
2276 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
2278 gdb_assert (gdbarch != NULL);
2279 return gdbarch->unwind_sp != NULL;
2283 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
2285 gdb_assert (gdbarch != NULL);
2286 gdb_assert (gdbarch->unwind_sp != NULL);
2287 if (gdbarch_debug >= 2)
2288 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
2289 return gdbarch->unwind_sp (gdbarch, next_frame);
2293 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
2294 gdbarch_unwind_sp_ftype unwind_sp)
2296 gdbarch->unwind_sp = unwind_sp;
2300 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
2302 gdb_assert (gdbarch != NULL);
2303 return gdbarch->frame_num_args != NULL;
2307 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2309 gdb_assert (gdbarch != NULL);
2310 gdb_assert (gdbarch->frame_num_args != NULL);
2311 if (gdbarch_debug >= 2)
2312 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
2313 return gdbarch->frame_num_args (frame);
2317 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
2318 gdbarch_frame_num_args_ftype frame_num_args)
2320 gdbarch->frame_num_args = frame_num_args;
2324 gdbarch_frame_align_p (struct gdbarch *gdbarch)
2326 gdb_assert (gdbarch != NULL);
2327 return gdbarch->frame_align != NULL;
2331 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
2333 gdb_assert (gdbarch != NULL);
2334 gdb_assert (gdbarch->frame_align != NULL);
2335 if (gdbarch_debug >= 2)
2336 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
2337 return gdbarch->frame_align (gdbarch, address);
2341 set_gdbarch_frame_align (struct gdbarch *gdbarch,
2342 gdbarch_frame_align_ftype frame_align)
2344 gdbarch->frame_align = frame_align;
2348 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
2350 gdb_assert (gdbarch != NULL);
2351 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
2352 if (gdbarch_debug >= 2)
2353 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
2354 return gdbarch->stabs_argument_has_addr (gdbarch, type);
2358 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
2359 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
2361 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
2365 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
2367 gdb_assert (gdbarch != NULL);
2368 if (gdbarch_debug >= 2)
2369 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
2370 return gdbarch->frame_red_zone_size;
2374 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
2375 int frame_red_zone_size)
2377 gdbarch->frame_red_zone_size = frame_red_zone_size;
2381 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
2383 gdb_assert (gdbarch != NULL);
2384 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
2385 if (gdbarch_debug >= 2)
2386 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
2387 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
2391 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
2392 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
2394 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
2398 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
2400 gdb_assert (gdbarch != NULL);
2401 gdb_assert (gdbarch->addr_bits_remove != NULL);
2402 if (gdbarch_debug >= 2)
2403 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
2404 return gdbarch->addr_bits_remove (addr);
2408 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
2409 gdbarch_addr_bits_remove_ftype addr_bits_remove)
2411 gdbarch->addr_bits_remove = addr_bits_remove;
2415 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
2417 gdb_assert (gdbarch != NULL);
2418 gdb_assert (gdbarch->smash_text_address != NULL);
2419 if (gdbarch_debug >= 2)
2420 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
2421 return gdbarch->smash_text_address (addr);
2425 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
2426 gdbarch_smash_text_address_ftype smash_text_address)
2428 gdbarch->smash_text_address = smash_text_address;
2432 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
2434 gdb_assert (gdbarch != NULL);
2435 return gdbarch->software_single_step != NULL;
2439 gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
2441 gdb_assert (gdbarch != NULL);
2442 gdb_assert (gdbarch->software_single_step != NULL);
2443 if (gdbarch_debug >= 2)
2444 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
2445 return gdbarch->software_single_step (frame);
2449 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
2450 gdbarch_software_single_step_ftype software_single_step)
2452 gdbarch->software_single_step = software_single_step;
2456 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
2458 gdb_assert (gdbarch != NULL);
2459 return gdbarch->single_step_through_delay != NULL;
2463 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
2465 gdb_assert (gdbarch != NULL);
2466 gdb_assert (gdbarch->single_step_through_delay != NULL);
2467 if (gdbarch_debug >= 2)
2468 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
2469 return gdbarch->single_step_through_delay (gdbarch, frame);
2473 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
2474 gdbarch_single_step_through_delay_ftype single_step_through_delay)
2476 gdbarch->single_step_through_delay = single_step_through_delay;
2480 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
2482 gdb_assert (gdbarch != NULL);
2483 gdb_assert (gdbarch->print_insn != NULL);
2484 if (gdbarch_debug >= 2)
2485 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
2486 return gdbarch->print_insn (vma, info);
2490 set_gdbarch_print_insn (struct gdbarch *gdbarch,
2491 gdbarch_print_insn_ftype print_insn)
2493 gdbarch->print_insn = print_insn;
2497 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc)
2499 gdb_assert (gdbarch != NULL);
2500 gdb_assert (gdbarch->skip_trampoline_code != NULL);
2501 if (gdbarch_debug >= 2)
2502 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
2503 return gdbarch->skip_trampoline_code (frame, pc);
2507 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
2508 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
2510 gdbarch->skip_trampoline_code = skip_trampoline_code;
2514 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
2516 gdb_assert (gdbarch != NULL);
2517 gdb_assert (gdbarch->skip_solib_resolver != NULL);
2518 if (gdbarch_debug >= 2)
2519 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
2520 return gdbarch->skip_solib_resolver (gdbarch, pc);
2524 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
2525 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
2527 gdbarch->skip_solib_resolver = skip_solib_resolver;
2531 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
2533 gdb_assert (gdbarch != NULL);
2534 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
2535 if (gdbarch_debug >= 2)
2536 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
2537 return gdbarch->in_solib_return_trampoline (pc, name);
2541 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
2542 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
2544 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
2548 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
2550 gdb_assert (gdbarch != NULL);
2551 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
2552 if (gdbarch_debug >= 2)
2553 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
2554 return gdbarch->in_function_epilogue_p (gdbarch, addr);
2558 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
2559 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
2561 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
2565 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
2567 gdb_assert (gdbarch != NULL);
2568 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
2569 if (gdbarch_debug >= 2)
2570 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
2571 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
2575 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
2576 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
2578 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
2582 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
2584 gdb_assert (gdbarch != NULL);
2585 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
2586 if (gdbarch_debug >= 2)
2587 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
2588 gdbarch->elf_make_msymbol_special (sym, msym);
2592 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
2593 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
2595 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
2599 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
2601 gdb_assert (gdbarch != NULL);
2602 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
2603 if (gdbarch_debug >= 2)
2604 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
2605 gdbarch->coff_make_msymbol_special (val, msym);
2609 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
2610 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
2612 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
2616 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
2618 gdb_assert (gdbarch != NULL);
2619 /* Skip verify of name_of_malloc, invalid_p == 0 */
2620 if (gdbarch_debug >= 2)
2621 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
2622 return gdbarch->name_of_malloc;
2626 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
2627 const char * name_of_malloc)
2629 gdbarch->name_of_malloc = name_of_malloc;
2633 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
2635 gdb_assert (gdbarch != NULL);
2636 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2637 if (gdbarch_debug >= 2)
2638 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
2639 return gdbarch->cannot_step_breakpoint;
2643 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
2644 int cannot_step_breakpoint)
2646 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
2650 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
2652 gdb_assert (gdbarch != NULL);
2653 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2654 if (gdbarch_debug >= 2)
2655 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
2656 return gdbarch->have_nonsteppable_watchpoint;
2660 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
2661 int have_nonsteppable_watchpoint)
2663 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
2667 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
2669 gdb_assert (gdbarch != NULL);
2670 return gdbarch->address_class_type_flags != NULL;
2674 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
2676 gdb_assert (gdbarch != NULL);
2677 gdb_assert (gdbarch->address_class_type_flags != NULL);
2678 if (gdbarch_debug >= 2)
2679 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
2680 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
2684 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
2685 gdbarch_address_class_type_flags_ftype address_class_type_flags)
2687 gdbarch->address_class_type_flags = address_class_type_flags;
2691 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
2693 gdb_assert (gdbarch != NULL);
2694 return gdbarch->address_class_type_flags_to_name != NULL;
2698 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
2700 gdb_assert (gdbarch != NULL);
2701 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
2702 if (gdbarch_debug >= 2)
2703 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
2704 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
2708 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
2709 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
2711 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
2715 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
2717 gdb_assert (gdbarch != NULL);
2718 return gdbarch->address_class_name_to_type_flags != NULL;
2722 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
2724 gdb_assert (gdbarch != NULL);
2725 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
2726 if (gdbarch_debug >= 2)
2727 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
2728 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
2732 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
2733 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
2735 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
2739 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
2741 gdb_assert (gdbarch != NULL);
2742 gdb_assert (gdbarch->register_reggroup_p != NULL);
2743 if (gdbarch_debug >= 2)
2744 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
2745 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
2749 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
2750 gdbarch_register_reggroup_p_ftype register_reggroup_p)
2752 gdbarch->register_reggroup_p = register_reggroup_p;
2756 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
2758 gdb_assert (gdbarch != NULL);
2759 return gdbarch->fetch_pointer_argument != NULL;
2763 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
2765 gdb_assert (gdbarch != NULL);
2766 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
2767 if (gdbarch_debug >= 2)
2768 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
2769 return gdbarch->fetch_pointer_argument (frame, argi, type);
2773 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
2774 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
2776 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
2780 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
2782 gdb_assert (gdbarch != NULL);
2783 return gdbarch->regset_from_core_section != NULL;
2786 const struct regset *
2787 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
2789 gdb_assert (gdbarch != NULL);
2790 gdb_assert (gdbarch->regset_from_core_section != NULL);
2791 if (gdbarch_debug >= 2)
2792 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
2793 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
2797 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
2798 gdbarch_regset_from_core_section_ftype regset_from_core_section)
2800 gdbarch->regset_from_core_section = regset_from_core_section;
2804 gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch)
2806 gdb_assert (gdbarch != NULL);
2807 return gdbarch->core_xfer_shared_libraries != NULL;
2811 gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len)
2813 gdb_assert (gdbarch != NULL);
2814 gdb_assert (gdbarch->core_xfer_shared_libraries != NULL);
2815 if (gdbarch_debug >= 2)
2816 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_xfer_shared_libraries called\n");
2817 return gdbarch->core_xfer_shared_libraries (gdbarch, readbuf, offset, len);
2821 set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch,
2822 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries)
2824 gdbarch->core_xfer_shared_libraries = core_xfer_shared_libraries;
2828 gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
2830 gdb_assert (gdbarch != NULL);
2831 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
2832 if (gdbarch_debug >= 2)
2833 fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
2834 return gdbarch->vtable_function_descriptors;
2838 set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
2839 int vtable_function_descriptors)
2841 gdbarch->vtable_function_descriptors = vtable_function_descriptors;
2845 gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
2847 gdb_assert (gdbarch != NULL);
2848 /* Skip verify of vbit_in_delta, invalid_p == 0 */
2849 if (gdbarch_debug >= 2)
2850 fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
2851 return gdbarch->vbit_in_delta;
2855 set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
2858 gdbarch->vbit_in_delta = vbit_in_delta;
2862 gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
2864 gdb_assert (gdbarch != NULL);
2865 return gdbarch->skip_permanent_breakpoint != NULL;
2869 gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
2871 gdb_assert (gdbarch != NULL);
2872 gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
2873 if (gdbarch_debug >= 2)
2874 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
2875 gdbarch->skip_permanent_breakpoint (regcache);
2879 set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
2880 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
2882 gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
2886 gdbarch_overlay_update_p (struct gdbarch *gdbarch)
2888 gdb_assert (gdbarch != NULL);
2889 return gdbarch->overlay_update != NULL;
2893 gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
2895 gdb_assert (gdbarch != NULL);
2896 gdb_assert (gdbarch->overlay_update != NULL);
2897 if (gdbarch_debug >= 2)
2898 fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
2899 gdbarch->overlay_update (osect);
2903 set_gdbarch_overlay_update (struct gdbarch *gdbarch,
2904 gdbarch_overlay_update_ftype overlay_update)
2906 gdbarch->overlay_update = overlay_update;
2910 gdbarch_core_read_description_p (struct gdbarch *gdbarch)
2912 gdb_assert (gdbarch != NULL);
2913 return gdbarch->core_read_description != NULL;
2916 const struct target_desc *
2917 gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd)
2919 gdb_assert (gdbarch != NULL);
2920 gdb_assert (gdbarch->core_read_description != NULL);
2921 if (gdbarch_debug >= 2)
2922 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_read_description called\n");
2923 return gdbarch->core_read_description (gdbarch, target, abfd);
2927 set_gdbarch_core_read_description (struct gdbarch *gdbarch,
2928 gdbarch_core_read_description_ftype core_read_description)
2930 gdbarch->core_read_description = core_read_description;
2934 gdbarch_static_transform_name_p (struct gdbarch *gdbarch)
2936 gdb_assert (gdbarch != NULL);
2937 return gdbarch->static_transform_name != NULL;
2941 gdbarch_static_transform_name (struct gdbarch *gdbarch, char *name)
2943 gdb_assert (gdbarch != NULL);
2944 gdb_assert (gdbarch->static_transform_name != NULL);
2945 if (gdbarch_debug >= 2)
2946 fprintf_unfiltered (gdb_stdlog, "gdbarch_static_transform_name called\n");
2947 return gdbarch->static_transform_name (name);
2951 set_gdbarch_static_transform_name (struct gdbarch *gdbarch,
2952 gdbarch_static_transform_name_ftype static_transform_name)
2954 gdbarch->static_transform_name = static_transform_name;
2958 gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch)
2960 gdb_assert (gdbarch != NULL);
2961 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
2962 if (gdbarch_debug >= 2)
2963 fprintf_unfiltered (gdb_stdlog, "gdbarch_sofun_address_maybe_missing called\n");
2964 return gdbarch->sofun_address_maybe_missing;
2968 set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch,
2969 int sofun_address_maybe_missing)
2971 gdbarch->sofun_address_maybe_missing = sofun_address_maybe_missing;
2975 /* Keep a registry of per-architecture data-pointers required by GDB
2982 gdbarch_data_pre_init_ftype *pre_init;
2983 gdbarch_data_post_init_ftype *post_init;
2986 struct gdbarch_data_registration
2988 struct gdbarch_data *data;
2989 struct gdbarch_data_registration *next;
2992 struct gdbarch_data_registry
2995 struct gdbarch_data_registration *registrations;
2998 struct gdbarch_data_registry gdbarch_data_registry =
3003 static struct gdbarch_data *
3004 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3005 gdbarch_data_post_init_ftype *post_init)
3007 struct gdbarch_data_registration **curr;
3008 /* Append the new registraration. */
3009 for (curr = &gdbarch_data_registry.registrations;
3011 curr = &(*curr)->next);
3012 (*curr) = XMALLOC (struct gdbarch_data_registration);
3013 (*curr)->next = NULL;
3014 (*curr)->data = XMALLOC (struct gdbarch_data);
3015 (*curr)->data->index = gdbarch_data_registry.nr++;
3016 (*curr)->data->pre_init = pre_init;
3017 (*curr)->data->post_init = post_init;
3018 (*curr)->data->init_p = 1;
3019 return (*curr)->data;
3022 struct gdbarch_data *
3023 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3025 return gdbarch_data_register (pre_init, NULL);
3028 struct gdbarch_data *
3029 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3031 return gdbarch_data_register (NULL, post_init);
3034 /* Create/delete the gdbarch data vector. */
3037 alloc_gdbarch_data (struct gdbarch *gdbarch)
3039 gdb_assert (gdbarch->data == NULL);
3040 gdbarch->nr_data = gdbarch_data_registry.nr;
3041 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3044 /* Initialize the current value of the specified per-architecture
3048 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3049 struct gdbarch_data *data,
3052 gdb_assert (data->index < gdbarch->nr_data);
3053 gdb_assert (gdbarch->data[data->index] == NULL);
3054 gdb_assert (data->pre_init == NULL);
3055 gdbarch->data[data->index] = pointer;
3058 /* Return the current value of the specified per-architecture
3062 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3064 gdb_assert (data->index < gdbarch->nr_data);
3065 if (gdbarch->data[data->index] == NULL)
3067 /* The data-pointer isn't initialized, call init() to get a
3069 if (data->pre_init != NULL)
3070 /* Mid architecture creation: pass just the obstack, and not
3071 the entire architecture, as that way it isn't possible for
3072 pre-init code to refer to undefined architecture
3074 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3075 else if (gdbarch->initialized_p
3076 && data->post_init != NULL)
3077 /* Post architecture creation: pass the entire architecture
3078 (as all fields are valid), but be careful to also detect
3079 recursive references. */
3081 gdb_assert (data->init_p);
3083 gdbarch->data[data->index] = data->post_init (gdbarch);
3087 /* The architecture initialization hasn't completed - punt -
3088 hope that the caller knows what they are doing. Once
3089 deprecated_set_gdbarch_data has been initialized, this can be
3090 changed to an internal error. */
3092 gdb_assert (gdbarch->data[data->index] != NULL);
3094 return gdbarch->data[data->index];
3098 /* Keep a registry of the architectures known by GDB. */
3100 struct gdbarch_registration
3102 enum bfd_architecture bfd_architecture;
3103 gdbarch_init_ftype *init;
3104 gdbarch_dump_tdep_ftype *dump_tdep;
3105 struct gdbarch_list *arches;
3106 struct gdbarch_registration *next;
3109 static struct gdbarch_registration *gdbarch_registry = NULL;
3112 append_name (const char ***buf, int *nr, const char *name)
3114 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3120 gdbarch_printable_names (void)
3122 /* Accumulate a list of names based on the registed list of
3124 enum bfd_architecture a;
3126 const char **arches = NULL;
3127 struct gdbarch_registration *rego;
3128 for (rego = gdbarch_registry;
3132 const struct bfd_arch_info *ap;
3133 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3135 internal_error (__FILE__, __LINE__,
3136 _("gdbarch_architecture_names: multi-arch unknown"));
3139 append_name (&arches, &nr_arches, ap->printable_name);
3144 append_name (&arches, &nr_arches, NULL);
3150 gdbarch_register (enum bfd_architecture bfd_architecture,
3151 gdbarch_init_ftype *init,
3152 gdbarch_dump_tdep_ftype *dump_tdep)
3154 struct gdbarch_registration **curr;
3155 const struct bfd_arch_info *bfd_arch_info;
3156 /* Check that BFD recognizes this architecture */
3157 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3158 if (bfd_arch_info == NULL)
3160 internal_error (__FILE__, __LINE__,
3161 _("gdbarch: Attempt to register unknown architecture (%d)"),
3164 /* Check that we haven't seen this architecture before */
3165 for (curr = &gdbarch_registry;
3167 curr = &(*curr)->next)
3169 if (bfd_architecture == (*curr)->bfd_architecture)
3170 internal_error (__FILE__, __LINE__,
3171 _("gdbarch: Duplicate registraration of architecture (%s)"),
3172 bfd_arch_info->printable_name);
3176 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
3177 bfd_arch_info->printable_name,
3180 (*curr) = XMALLOC (struct gdbarch_registration);
3181 (*curr)->bfd_architecture = bfd_architecture;
3182 (*curr)->init = init;
3183 (*curr)->dump_tdep = dump_tdep;
3184 (*curr)->arches = NULL;
3185 (*curr)->next = NULL;
3189 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3190 gdbarch_init_ftype *init)
3192 gdbarch_register (bfd_architecture, init, NULL);
3196 /* Look for an architecture using gdbarch_info. */
3198 struct gdbarch_list *
3199 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
3200 const struct gdbarch_info *info)
3202 for (; arches != NULL; arches = arches->next)
3204 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
3206 if (info->byte_order != arches->gdbarch->byte_order)
3208 if (info->osabi != arches->gdbarch->osabi)
3210 if (info->target_desc != arches->gdbarch->target_desc)
3218 /* Find an architecture that matches the specified INFO. Create a new
3219 architecture if needed. Return that new architecture. Assumes
3220 that there is no current architecture. */
3222 static struct gdbarch *
3223 find_arch_by_info (struct gdbarch_info info)
3225 struct gdbarch *new_gdbarch;
3226 struct gdbarch_registration *rego;
3228 /* The existing architecture has been swapped out - all this code
3229 works from a clean slate. */
3230 gdb_assert (current_gdbarch == NULL);
3232 /* Fill in missing parts of the INFO struct using a number of
3233 sources: "set ..."; INFOabfd supplied; and the global
3235 gdbarch_info_fill (&info);
3237 /* Must have found some sort of architecture. */
3238 gdb_assert (info.bfd_arch_info != NULL);
3242 fprintf_unfiltered (gdb_stdlog,
3243 "find_arch_by_info: info.bfd_arch_info %s\n",
3244 (info.bfd_arch_info != NULL
3245 ? info.bfd_arch_info->printable_name
3247 fprintf_unfiltered (gdb_stdlog,
3248 "find_arch_by_info: info.byte_order %d (%s)\n",
3250 (info.byte_order == BFD_ENDIAN_BIG ? "big"
3251 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
3253 fprintf_unfiltered (gdb_stdlog,
3254 "find_arch_by_info: info.osabi %d (%s)\n",
3255 info.osabi, gdbarch_osabi_name (info.osabi));
3256 fprintf_unfiltered (gdb_stdlog,
3257 "find_arch_by_info: info.abfd 0x%lx\n",
3259 fprintf_unfiltered (gdb_stdlog,
3260 "find_arch_by_info: info.tdep_info 0x%lx\n",
3261 (long) info.tdep_info);
3264 /* Find the tdep code that knows about this architecture. */
3265 for (rego = gdbarch_registry;
3268 if (rego->bfd_architecture == info.bfd_arch_info->arch)
3273 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3274 "No matching architecture\n");
3278 /* Ask the tdep code for an architecture that matches "info". */
3279 new_gdbarch = rego->init (info, rego->arches);
3281 /* Did the tdep code like it? No. Reject the change and revert to
3282 the old architecture. */
3283 if (new_gdbarch == NULL)
3286 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3287 "Target rejected architecture\n");
3291 /* Is this a pre-existing architecture (as determined by already
3292 being initialized)? Move it to the front of the architecture
3293 list (keeping the list sorted Most Recently Used). */
3294 if (new_gdbarch->initialized_p)
3296 struct gdbarch_list **list;
3297 struct gdbarch_list *this;
3299 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3300 "Previous architecture 0x%08lx (%s) selected\n",
3302 new_gdbarch->bfd_arch_info->printable_name);
3303 /* Find the existing arch in the list. */
3304 for (list = ®o->arches;
3305 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
3306 list = &(*list)->next);
3307 /* It had better be in the list of architectures. */
3308 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
3311 (*list) = this->next;
3312 /* Insert THIS at the front. */
3313 this->next = rego->arches;
3314 rego->arches = this;
3319 /* It's a new architecture. */
3321 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3322 "New architecture 0x%08lx (%s) selected\n",
3324 new_gdbarch->bfd_arch_info->printable_name);
3326 /* Insert the new architecture into the front of the architecture
3327 list (keep the list sorted Most Recently Used). */
3329 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
3330 this->next = rego->arches;
3331 this->gdbarch = new_gdbarch;
3332 rego->arches = this;
3335 /* Check that the newly installed architecture is valid. Plug in
3336 any post init values. */
3337 new_gdbarch->dump_tdep = rego->dump_tdep;
3338 verify_gdbarch (new_gdbarch);
3339 new_gdbarch->initialized_p = 1;
3342 gdbarch_dump (new_gdbarch, gdb_stdlog);
3348 gdbarch_find_by_info (struct gdbarch_info info)
3350 struct gdbarch *new_gdbarch;
3352 /* Save the previously selected architecture, setting the global to
3353 NULL. This stops things like gdbarch->init() trying to use the
3354 previous architecture's configuration. The previous architecture
3355 may not even be of the same architecture family. The most recent
3356 architecture of the same family is found at the head of the
3357 rego->arches list. */
3358 struct gdbarch *old_gdbarch = current_gdbarch;
3359 current_gdbarch = NULL;
3361 /* Find the specified architecture. */
3362 new_gdbarch = find_arch_by_info (info);
3364 /* Restore the existing architecture. */
3365 gdb_assert (current_gdbarch == NULL);
3366 current_gdbarch = old_gdbarch;
3371 /* Make the specified architecture current. */
3374 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
3376 gdb_assert (new_gdbarch != NULL);
3377 gdb_assert (current_gdbarch != NULL);
3378 gdb_assert (new_gdbarch->initialized_p);
3379 current_gdbarch = new_gdbarch;
3380 architecture_changed_event ();
3381 reinit_frame_cache ();
3384 extern void _initialize_gdbarch (void);
3387 _initialize_gdbarch (void)
3389 struct cmd_list_element *c;
3391 add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
3392 Set architecture debugging."), _("\
3393 Show architecture debugging."), _("\
3394 When non-zero, architecture debugging is enabled."),
3397 &setdebuglist, &showdebuglist);