1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
5 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 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 2 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, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 Boston, MA 02110-1301, USA. */
25 /* This file was created with the aid of ``gdbarch.sh''.
27 The Bourne shell script ``gdbarch.sh'' creates the files
28 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
29 against the existing ``gdbarch.[hc]''. Any differences found
32 If editing this file, please also run gdbarch.sh and merge any
33 changes into that script. Conversely, when making sweeping changes
34 to this file, modifying gdbarch.sh and using its output may prove
39 #include "arch-utils.h"
45 #include "floatformat.h"
47 #include "gdb_assert.h"
48 #include "gdb_string.h"
49 #include "gdb-events.h"
50 #include "reggroups.h"
52 #include "gdb_obstack.h"
54 /* Static function declarations */
56 static void alloc_gdbarch_data (struct gdbarch *);
58 /* Non-zero if we want to trace architecture code. */
61 #define GDBARCH_DEBUG 0
63 int gdbarch_debug = GDBARCH_DEBUG;
65 show_gdbarch_debug (struct ui_file *file, int from_tty,
66 struct cmd_list_element *c, const char *value)
68 fprintf_filtered (file, _("Architecture debugging is %s.\n"), value);
72 pformat (const struct floatformat **format)
77 /* Just print out one of them - this is only for diagnostics. */
78 return format[0]->name;
82 /* Maintain the struct gdbarch object */
86 /* Has this architecture been fully initialized? */
89 /* An obstack bound to the lifetime of the architecture. */
90 struct obstack *obstack;
92 /* basic architectural information */
93 const struct bfd_arch_info * bfd_arch_info;
96 const struct target_desc * target_desc;
98 /* target specific vector. */
99 struct gdbarch_tdep *tdep;
100 gdbarch_dump_tdep_ftype *dump_tdep;
102 /* per-architecture data-pointers */
106 /* per-architecture swap-regions */
107 struct gdbarch_swap *swap;
109 /* Multi-arch values.
111 When extending this structure you must:
115 Declare set/get functions and define the corresponding
118 gdbarch_alloc(): If zero/NULL is not a suitable default,
119 initialize the new field.
121 verify_gdbarch(): Confirm that the target updated the field
124 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
127 ``startup_gdbarch()'': Append an initial value to the static
128 variable (base values on the host's c-type system).
130 get_gdbarch(): Implement the set/get functions (probably using
131 the macro's as shortcuts).
140 const struct floatformat ** float_format;
142 const struct floatformat ** double_format;
144 const struct floatformat ** long_double_format;
148 gdbarch_read_pc_ftype *read_pc;
149 gdbarch_write_pc_ftype *write_pc;
150 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
151 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
152 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
159 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
160 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
161 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
162 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
163 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
164 gdbarch_register_name_ftype *register_name;
165 gdbarch_register_type_ftype *register_type;
166 gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
167 int deprecated_fp_regnum;
168 gdbarch_push_dummy_call_ftype *push_dummy_call;
169 int deprecated_register_size;
170 int call_dummy_location;
171 gdbarch_push_dummy_code_ftype *push_dummy_code;
172 gdbarch_print_registers_info_ftype *print_registers_info;
173 gdbarch_print_float_info_ftype *print_float_info;
174 gdbarch_print_vector_info_ftype *print_vector_info;
175 gdbarch_register_sim_regno_ftype *register_sim_regno;
176 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
177 gdbarch_cannot_store_register_ftype *cannot_store_register;
178 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
179 int believe_pcc_promotion;
180 gdbarch_convert_register_p_ftype *convert_register_p;
181 gdbarch_register_to_value_ftype *register_to_value;
182 gdbarch_value_to_register_ftype *value_to_register;
183 gdbarch_value_from_register_ftype *value_from_register;
184 gdbarch_pointer_to_address_ftype *pointer_to_address;
185 gdbarch_address_to_pointer_ftype *address_to_pointer;
186 gdbarch_integer_to_address_ftype *integer_to_address;
187 gdbarch_return_value_ftype *return_value;
188 gdbarch_extract_return_value_ftype *extract_return_value;
189 gdbarch_store_return_value_ftype *store_return_value;
190 gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
191 gdbarch_skip_prologue_ftype *skip_prologue;
192 gdbarch_inner_than_ftype *inner_than;
193 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
194 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
195 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
196 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
197 CORE_ADDR decr_pc_after_break;
198 CORE_ADDR deprecated_function_start_offset;
199 gdbarch_remote_register_number_ftype *remote_register_number;
200 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
201 CORE_ADDR frame_args_skip;
202 gdbarch_unwind_pc_ftype *unwind_pc;
203 gdbarch_unwind_sp_ftype *unwind_sp;
204 gdbarch_frame_num_args_ftype *frame_num_args;
205 gdbarch_frame_align_ftype *frame_align;
206 gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr;
207 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
208 int frame_red_zone_size;
209 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
210 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
211 gdbarch_smash_text_address_ftype *smash_text_address;
212 gdbarch_software_single_step_ftype *software_single_step;
213 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
214 gdbarch_print_insn_ftype *print_insn;
215 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
216 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
217 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
218 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
219 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
220 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
221 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
222 const char * name_of_malloc;
223 int cannot_step_breakpoint;
224 int have_nonsteppable_watchpoint;
225 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
226 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
227 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
228 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
229 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
230 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
231 int vtable_function_descriptors;
233 gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
234 gdbarch_overlay_update_ftype *overlay_update;
238 /* The default architecture uses host values (for want of a better
241 extern const struct bfd_arch_info bfd_default_arch_struct;
243 struct gdbarch startup_gdbarch =
245 1, /* Always initialized. */
246 NULL, /* The obstack. */
247 /* basic architecture information */
248 &bfd_default_arch_struct, /* bfd_arch_info */
249 BFD_ENDIAN_BIG, /* byte_order */
250 GDB_OSABI_UNKNOWN, /* osabi */
252 /* target specific vector and its dump routine */
254 /*per-architecture data-pointers and swap regions */
256 /* Multi-arch values */
257 8 * sizeof (short), /* short_bit */
258 8 * sizeof (int), /* int_bit */
259 8 * sizeof (long), /* long_bit */
260 8 * sizeof (LONGEST), /* long_long_bit */
261 8 * sizeof (float), /* float_bit */
262 0, /* float_format */
263 8 * sizeof (double), /* double_bit */
264 0, /* double_format */
265 8 * sizeof (long double), /* long_double_bit */
266 0, /* long_double_format */
267 8 * sizeof (void*), /* ptr_bit */
268 8 * sizeof (void*), /* addr_bit */
272 0, /* virtual_frame_pointer */
273 0, /* pseudo_register_read */
274 0, /* pseudo_register_write */
276 0, /* num_pseudo_regs */
281 0, /* stab_reg_to_regnum */
282 0, /* ecoff_reg_to_regnum */
283 0, /* dwarf_reg_to_regnum */
284 0, /* sdb_reg_to_regnum */
285 0, /* dwarf2_reg_to_regnum */
286 0, /* register_name */
287 0, /* register_type */
288 0, /* unwind_dummy_id */
289 -1, /* deprecated_fp_regnum */
290 0, /* push_dummy_call */
291 0, /* deprecated_register_size */
292 0, /* call_dummy_location */
293 0, /* push_dummy_code */
294 default_print_registers_info, /* print_registers_info */
295 0, /* print_float_info */
296 0, /* print_vector_info */
297 0, /* register_sim_regno */
298 0, /* cannot_fetch_register */
299 0, /* cannot_store_register */
300 0, /* get_longjmp_target */
301 0, /* believe_pcc_promotion */
302 0, /* convert_register_p */
303 0, /* register_to_value */
304 0, /* value_to_register */
305 0, /* value_from_register */
306 0, /* pointer_to_address */
307 0, /* address_to_pointer */
308 0, /* integer_to_address */
309 0, /* return_value */
310 0, /* extract_return_value */
311 0, /* store_return_value */
312 0, /* deprecated_use_struct_convention */
313 0, /* skip_prologue */
315 0, /* breakpoint_from_pc */
316 0, /* adjust_breakpoint_address */
317 0, /* memory_insert_breakpoint */
318 0, /* memory_remove_breakpoint */
319 0, /* decr_pc_after_break */
320 0, /* deprecated_function_start_offset */
321 default_remote_register_number, /* remote_register_number */
322 0, /* fetch_tls_load_module_address */
323 0, /* frame_args_skip */
326 0, /* frame_num_args */
328 0, /* deprecated_reg_struct_has_addr */
329 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
330 0, /* frame_red_zone_size */
331 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
332 0, /* addr_bits_remove */
333 0, /* smash_text_address */
334 0, /* software_single_step */
335 0, /* single_step_through_delay */
337 0, /* skip_trampoline_code */
338 generic_skip_solib_resolver, /* skip_solib_resolver */
339 0, /* in_solib_return_trampoline */
340 generic_in_function_epilogue_p, /* in_function_epilogue_p */
341 construct_inferior_arguments, /* construct_inferior_arguments */
342 0, /* elf_make_msymbol_special */
343 0, /* coff_make_msymbol_special */
344 "malloc", /* name_of_malloc */
345 0, /* cannot_step_breakpoint */
346 0, /* have_nonsteppable_watchpoint */
347 0, /* address_class_type_flags */
348 0, /* address_class_type_flags_to_name */
349 0, /* address_class_name_to_type_flags */
350 default_register_reggroup_p, /* register_reggroup_p */
351 0, /* fetch_pointer_argument */
352 0, /* regset_from_core_section */
353 0, /* vtable_function_descriptors */
354 0, /* vbit_in_delta */
355 0, /* skip_permanent_breakpoint */
356 0, /* overlay_update */
357 /* startup_gdbarch() */
360 struct gdbarch *current_gdbarch = &startup_gdbarch;
362 /* Create a new ``struct gdbarch'' based on information provided by
363 ``struct gdbarch_info''. */
366 gdbarch_alloc (const struct gdbarch_info *info,
367 struct gdbarch_tdep *tdep)
369 /* NOTE: The new architecture variable is named ``current_gdbarch''
370 so that macros such as TARGET_ARCHITECTURE, when expanded, refer to
371 the current local architecture and not the previous global
372 architecture. This ensures that the new architectures initial
373 values are not influenced by the previous architecture. Once
374 everything is parameterised with gdbarch, this will go away. */
375 struct gdbarch *current_gdbarch;
377 /* Create an obstack for allocating all the per-architecture memory,
378 then use that to allocate the architecture vector. */
379 struct obstack *obstack = XMALLOC (struct obstack);
380 obstack_init (obstack);
381 current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch));
382 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
383 current_gdbarch->obstack = obstack;
385 alloc_gdbarch_data (current_gdbarch);
387 current_gdbarch->tdep = tdep;
389 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
390 current_gdbarch->byte_order = info->byte_order;
391 current_gdbarch->osabi = info->osabi;
392 current_gdbarch->target_desc = info->target_desc;
394 /* Force the explicit initialization of these. */
395 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
396 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
397 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
398 current_gdbarch->long_long_bit = 2*current_gdbarch->long_bit;
399 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
400 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
401 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
402 current_gdbarch->ptr_bit = current_gdbarch->int_bit;
403 current_gdbarch->char_signed = -1;
404 current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
405 current_gdbarch->num_regs = -1;
406 current_gdbarch->sp_regnum = -1;
407 current_gdbarch->pc_regnum = -1;
408 current_gdbarch->ps_regnum = -1;
409 current_gdbarch->fp0_regnum = -1;
410 current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
411 current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
412 current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
413 current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
414 current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
415 current_gdbarch->deprecated_fp_regnum = -1;
416 current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
417 current_gdbarch->print_registers_info = default_print_registers_info;
418 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
419 current_gdbarch->cannot_fetch_register = cannot_register_not;
420 current_gdbarch->cannot_store_register = cannot_register_not;
421 current_gdbarch->convert_register_p = generic_convert_register_p;
422 current_gdbarch->value_from_register = default_value_from_register;
423 current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
424 current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
425 current_gdbarch->return_value = legacy_return_value;
426 current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
427 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
428 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
429 current_gdbarch->remote_register_number = default_remote_register_number;
430 current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
431 current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
432 current_gdbarch->addr_bits_remove = core_addr_identity;
433 current_gdbarch->smash_text_address = core_addr_identity;
434 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
435 current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
436 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
437 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
438 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
439 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
440 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
441 current_gdbarch->name_of_malloc = "malloc";
442 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
443 /* gdbarch_alloc() */
445 return current_gdbarch;
449 /* Allocate extra space using the per-architecture obstack. */
452 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
454 void *data = obstack_alloc (arch->obstack, size);
455 memset (data, 0, size);
460 /* Free a gdbarch struct. This should never happen in normal
461 operation --- once you've created a gdbarch, you keep it around.
462 However, if an architecture's init function encounters an error
463 building the structure, it may need to clean up a partially
464 constructed gdbarch. */
467 gdbarch_free (struct gdbarch *arch)
469 struct obstack *obstack;
470 gdb_assert (arch != NULL);
471 gdb_assert (!arch->initialized_p);
472 obstack = arch->obstack;
473 obstack_free (obstack, 0); /* Includes the ARCH. */
478 /* Ensure that all values in a GDBARCH are reasonable. */
480 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
481 just happens to match the global variable ``current_gdbarch''. That
482 way macros refering to that variable get the local and not the global
483 version - ulgh. Once everything is parameterised with gdbarch, this
487 verify_gdbarch (struct gdbarch *current_gdbarch)
490 struct cleanup *cleanups;
493 log = mem_fileopen ();
494 cleanups = make_cleanup_ui_file_delete (log);
496 if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
497 fprintf_unfiltered (log, "\n\tbyte-order");
498 if (current_gdbarch->bfd_arch_info == NULL)
499 fprintf_unfiltered (log, "\n\tbfd_arch_info");
500 /* Check those that need to be defined for the given multi-arch level. */
501 /* Skip verify of short_bit, invalid_p == 0 */
502 /* Skip verify of int_bit, invalid_p == 0 */
503 /* Skip verify of long_bit, invalid_p == 0 */
504 /* Skip verify of long_long_bit, invalid_p == 0 */
505 /* Skip verify of float_bit, invalid_p == 0 */
506 if (current_gdbarch->float_format == 0)
507 current_gdbarch->float_format = floatformats_ieee_single;
508 /* Skip verify of double_bit, invalid_p == 0 */
509 if (current_gdbarch->double_format == 0)
510 current_gdbarch->double_format = floatformats_ieee_double;
511 /* Skip verify of long_double_bit, invalid_p == 0 */
512 if (current_gdbarch->long_double_format == 0)
513 current_gdbarch->long_double_format = floatformats_ieee_double;
514 /* Skip verify of ptr_bit, invalid_p == 0 */
515 if (current_gdbarch->addr_bit == 0)
516 current_gdbarch->addr_bit = gdbarch_ptr_bit (current_gdbarch);
517 if (current_gdbarch->char_signed == -1)
518 current_gdbarch->char_signed = 1;
519 /* Skip verify of read_pc, has predicate */
520 /* Skip verify of write_pc, has predicate */
521 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
522 /* Skip verify of pseudo_register_read, has predicate */
523 /* Skip verify of pseudo_register_write, has predicate */
524 if (current_gdbarch->num_regs == -1)
525 fprintf_unfiltered (log, "\n\tnum_regs");
526 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
527 /* Skip verify of sp_regnum, invalid_p == 0 */
528 /* Skip verify of pc_regnum, invalid_p == 0 */
529 /* Skip verify of ps_regnum, invalid_p == 0 */
530 /* Skip verify of fp0_regnum, invalid_p == 0 */
531 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
532 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
533 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
534 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
535 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
536 /* Skip verify of register_type, has predicate */
537 /* Skip verify of unwind_dummy_id, has predicate */
538 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
539 /* Skip verify of push_dummy_call, has predicate */
540 /* Skip verify of call_dummy_location, invalid_p == 0 */
541 /* Skip verify of push_dummy_code, has predicate */
542 /* Skip verify of print_registers_info, invalid_p == 0 */
543 /* Skip verify of print_float_info, has predicate */
544 /* Skip verify of print_vector_info, has predicate */
545 /* Skip verify of register_sim_regno, invalid_p == 0 */
546 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
547 /* Skip verify of cannot_store_register, invalid_p == 0 */
548 /* Skip verify of get_longjmp_target, has predicate */
549 /* Skip verify of convert_register_p, invalid_p == 0 */
550 /* Skip verify of value_from_register, invalid_p == 0 */
551 /* Skip verify of pointer_to_address, invalid_p == 0 */
552 /* Skip verify of address_to_pointer, invalid_p == 0 */
553 /* Skip verify of integer_to_address, has predicate */
554 /* Skip verify of return_value, has predicate */
555 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
556 if (current_gdbarch->skip_prologue == 0)
557 fprintf_unfiltered (log, "\n\tskip_prologue");
558 if (current_gdbarch->inner_than == 0)
559 fprintf_unfiltered (log, "\n\tinner_than");
560 if (current_gdbarch->breakpoint_from_pc == 0)
561 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
562 /* Skip verify of adjust_breakpoint_address, has predicate */
563 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
564 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
565 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
566 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
567 /* Skip verify of remote_register_number, invalid_p == 0 */
568 /* Skip verify of fetch_tls_load_module_address, has predicate */
569 /* Skip verify of frame_args_skip, invalid_p == 0 */
570 /* Skip verify of unwind_pc, has predicate */
571 /* Skip verify of unwind_sp, has predicate */
572 /* Skip verify of frame_num_args, has predicate */
573 /* Skip verify of frame_align, has predicate */
574 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
575 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
576 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
577 /* Skip verify of addr_bits_remove, invalid_p == 0 */
578 /* Skip verify of smash_text_address, invalid_p == 0 */
579 /* Skip verify of software_single_step, has predicate */
580 /* Skip verify of single_step_through_delay, has predicate */
581 if (current_gdbarch->print_insn == 0)
582 fprintf_unfiltered (log, "\n\tprint_insn");
583 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
584 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
585 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
586 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
587 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
588 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
589 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
590 /* Skip verify of name_of_malloc, invalid_p == 0 */
591 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
592 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
593 /* Skip verify of address_class_type_flags, has predicate */
594 /* Skip verify of address_class_type_flags_to_name, has predicate */
595 /* Skip verify of address_class_name_to_type_flags, has predicate */
596 /* Skip verify of register_reggroup_p, invalid_p == 0 */
597 /* Skip verify of fetch_pointer_argument, has predicate */
598 /* Skip verify of regset_from_core_section, has predicate */
599 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
600 /* Skip verify of vbit_in_delta, invalid_p == 0 */
601 /* Skip verify of skip_permanent_breakpoint, has predicate */
602 /* Skip verify of overlay_update, has predicate */
603 buf = ui_file_xstrdup (log, &dummy);
604 make_cleanup (xfree, buf);
605 if (strlen (buf) > 0)
606 internal_error (__FILE__, __LINE__,
607 _("verify_gdbarch: the following are invalid ...%s"),
609 do_cleanups (cleanups);
613 /* Print out the details of the current architecture. */
615 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
616 just happens to match the global variable ``current_gdbarch''. That
617 way macros refering to that variable get the local and not the global
618 version - ulgh. Once everything is parameterised with gdbarch, this
622 gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
624 const char *gdb_xm_file = "<not-defined>";
625 const char *gdb_nm_file = "<not-defined>";
626 const char *gdb_tm_file = "<not-defined>";
627 #if defined (GDB_XM_FILE)
628 gdb_xm_file = GDB_XM_FILE;
630 fprintf_unfiltered (file,
631 "gdbarch_dump: GDB_XM_FILE = %s\n",
633 #if defined (GDB_NM_FILE)
634 gdb_nm_file = GDB_NM_FILE;
636 fprintf_unfiltered (file,
637 "gdbarch_dump: GDB_NM_FILE = %s\n",
639 #if defined (GDB_TM_FILE)
640 gdb_tm_file = GDB_TM_FILE;
642 fprintf_unfiltered (file,
643 "gdbarch_dump: GDB_TM_FILE = %s\n",
645 fprintf_unfiltered (file,
646 "gdbarch_dump: addr_bit = %s\n",
647 paddr_d (current_gdbarch->addr_bit));
648 fprintf_unfiltered (file,
649 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
650 (long) current_gdbarch->addr_bits_remove);
651 fprintf_unfiltered (file,
652 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
653 gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
654 fprintf_unfiltered (file,
655 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
656 (long) current_gdbarch->address_class_name_to_type_flags);
657 fprintf_unfiltered (file,
658 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
659 gdbarch_address_class_type_flags_p (current_gdbarch));
660 fprintf_unfiltered (file,
661 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
662 (long) current_gdbarch->address_class_type_flags);
663 fprintf_unfiltered (file,
664 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
665 gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
666 fprintf_unfiltered (file,
667 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
668 (long) current_gdbarch->address_class_type_flags_to_name);
669 fprintf_unfiltered (file,
670 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
671 (long) current_gdbarch->address_to_pointer);
672 fprintf_unfiltered (file,
673 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
674 gdbarch_adjust_breakpoint_address_p (current_gdbarch));
675 fprintf_unfiltered (file,
676 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
677 (long) current_gdbarch->adjust_breakpoint_address);
678 #ifdef BELIEVE_PCC_PROMOTION
679 fprintf_unfiltered (file,
680 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
681 XSTRING (BELIEVE_PCC_PROMOTION));
683 fprintf_unfiltered (file,
684 "gdbarch_dump: believe_pcc_promotion = %s\n",
685 paddr_d (current_gdbarch->believe_pcc_promotion));
686 fprintf_unfiltered (file,
687 "gdbarch_dump: bfd_arch_info = %s\n",
688 gdbarch_bfd_arch_info (current_gdbarch)->printable_name);
689 fprintf_unfiltered (file,
690 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
691 (long) current_gdbarch->breakpoint_from_pc);
692 fprintf_unfiltered (file,
693 "gdbarch_dump: byte_order = %s\n",
694 paddr_d (current_gdbarch->byte_order));
695 fprintf_unfiltered (file,
696 "gdbarch_dump: call_dummy_location = %s\n",
697 paddr_d (current_gdbarch->call_dummy_location));
698 fprintf_unfiltered (file,
699 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
700 (long) current_gdbarch->cannot_fetch_register);
701 fprintf_unfiltered (file,
702 "gdbarch_dump: cannot_step_breakpoint = %s\n",
703 paddr_d (current_gdbarch->cannot_step_breakpoint));
704 fprintf_unfiltered (file,
705 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
706 (long) current_gdbarch->cannot_store_register);
707 fprintf_unfiltered (file,
708 "gdbarch_dump: char_signed = %s\n",
709 paddr_d (current_gdbarch->char_signed));
710 fprintf_unfiltered (file,
711 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
712 (long) current_gdbarch->coff_make_msymbol_special);
713 fprintf_unfiltered (file,
714 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
715 (long) current_gdbarch->construct_inferior_arguments);
716 fprintf_unfiltered (file,
717 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
718 (long) current_gdbarch->convert_from_func_ptr_addr);
719 fprintf_unfiltered (file,
720 "gdbarch_dump: convert_register_p = <0x%lx>\n",
721 (long) current_gdbarch->convert_register_p);
722 fprintf_unfiltered (file,
723 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
724 paddr_nz (current_gdbarch->decr_pc_after_break));
725 #ifdef DEPRECATED_FP_REGNUM
726 fprintf_unfiltered (file,
727 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
728 XSTRING (DEPRECATED_FP_REGNUM));
730 fprintf_unfiltered (file,
731 "gdbarch_dump: deprecated_fp_regnum = %s\n",
732 paddr_d (current_gdbarch->deprecated_fp_regnum));
733 fprintf_unfiltered (file,
734 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
735 paddr_nz (current_gdbarch->deprecated_function_start_offset));
736 fprintf_unfiltered (file,
737 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
738 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch));
739 fprintf_unfiltered (file,
740 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
741 (long) current_gdbarch->deprecated_reg_struct_has_addr);
742 #ifdef DEPRECATED_REGISTER_SIZE
743 fprintf_unfiltered (file,
744 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
745 XSTRING (DEPRECATED_REGISTER_SIZE));
747 fprintf_unfiltered (file,
748 "gdbarch_dump: deprecated_register_size = %s\n",
749 paddr_d (current_gdbarch->deprecated_register_size));
750 fprintf_unfiltered (file,
751 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
752 (long) current_gdbarch->deprecated_use_struct_convention);
753 fprintf_unfiltered (file,
754 "gdbarch_dump: double_bit = %s\n",
755 paddr_d (current_gdbarch->double_bit));
756 fprintf_unfiltered (file,
757 "gdbarch_dump: double_format = %s\n",
758 pformat (current_gdbarch->double_format));
759 fprintf_unfiltered (file,
760 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
761 (long) current_gdbarch->dwarf2_reg_to_regnum);
762 fprintf_unfiltered (file,
763 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
764 (long) current_gdbarch->dwarf_reg_to_regnum);
765 fprintf_unfiltered (file,
766 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
767 (long) current_gdbarch->ecoff_reg_to_regnum);
768 fprintf_unfiltered (file,
769 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
770 (long) current_gdbarch->elf_make_msymbol_special);
771 #ifdef EXTRACT_RETURN_VALUE
772 fprintf_unfiltered (file,
773 "gdbarch_dump: %s # %s\n",
774 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
775 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
777 fprintf_unfiltered (file,
778 "gdbarch_dump: extract_return_value = <0x%lx>\n",
779 (long) current_gdbarch->extract_return_value);
780 fprintf_unfiltered (file,
781 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
782 gdbarch_fetch_pointer_argument_p (current_gdbarch));
783 fprintf_unfiltered (file,
784 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
785 (long) current_gdbarch->fetch_pointer_argument);
786 fprintf_unfiltered (file,
787 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
788 gdbarch_fetch_tls_load_module_address_p (current_gdbarch));
789 fprintf_unfiltered (file,
790 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
791 (long) current_gdbarch->fetch_tls_load_module_address);
792 fprintf_unfiltered (file,
793 "gdbarch_dump: float_bit = %s\n",
794 paddr_d (current_gdbarch->float_bit));
795 fprintf_unfiltered (file,
796 "gdbarch_dump: float_format = %s\n",
797 pformat (current_gdbarch->float_format));
798 fprintf_unfiltered (file,
799 "gdbarch_dump: fp0_regnum = %s\n",
800 paddr_d (current_gdbarch->fp0_regnum));
801 fprintf_unfiltered (file,
802 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
803 gdbarch_frame_align_p (current_gdbarch));
804 fprintf_unfiltered (file,
805 "gdbarch_dump: frame_align = <0x%lx>\n",
806 (long) current_gdbarch->frame_align);
807 fprintf_unfiltered (file,
808 "gdbarch_dump: frame_args_skip = 0x%s\n",
809 paddr_nz (current_gdbarch->frame_args_skip));
810 fprintf_unfiltered (file,
811 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
812 gdbarch_frame_num_args_p (current_gdbarch));
813 fprintf_unfiltered (file,
814 "gdbarch_dump: frame_num_args = <0x%lx>\n",
815 (long) current_gdbarch->frame_num_args);
816 fprintf_unfiltered (file,
817 "gdbarch_dump: frame_red_zone_size = %s\n",
818 paddr_d (current_gdbarch->frame_red_zone_size));
819 fprintf_unfiltered (file,
820 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
821 gdbarch_get_longjmp_target_p (current_gdbarch));
822 fprintf_unfiltered (file,
823 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
824 (long) current_gdbarch->get_longjmp_target);
825 fprintf_unfiltered (file,
826 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
827 paddr_d (current_gdbarch->have_nonsteppable_watchpoint));
828 fprintf_unfiltered (file,
829 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
830 (long) current_gdbarch->in_function_epilogue_p);
831 fprintf_unfiltered (file,
832 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
833 (long) current_gdbarch->in_solib_return_trampoline);
834 fprintf_unfiltered (file,
835 "gdbarch_dump: inner_than = <0x%lx>\n",
836 (long) current_gdbarch->inner_than);
837 fprintf_unfiltered (file,
838 "gdbarch_dump: int_bit = %s\n",
839 paddr_d (current_gdbarch->int_bit));
840 fprintf_unfiltered (file,
841 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
842 gdbarch_integer_to_address_p (current_gdbarch));
843 fprintf_unfiltered (file,
844 "gdbarch_dump: integer_to_address = <0x%lx>\n",
845 (long) current_gdbarch->integer_to_address);
846 fprintf_unfiltered (file,
847 "gdbarch_dump: long_bit = %s\n",
848 paddr_d (current_gdbarch->long_bit));
849 fprintf_unfiltered (file,
850 "gdbarch_dump: long_double_bit = %s\n",
851 paddr_d (current_gdbarch->long_double_bit));
852 fprintf_unfiltered (file,
853 "gdbarch_dump: long_double_format = %s\n",
854 pformat (current_gdbarch->long_double_format));
855 fprintf_unfiltered (file,
856 "gdbarch_dump: long_long_bit = %s\n",
857 paddr_d (current_gdbarch->long_long_bit));
858 fprintf_unfiltered (file,
859 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
860 (long) current_gdbarch->memory_insert_breakpoint);
861 fprintf_unfiltered (file,
862 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
863 (long) current_gdbarch->memory_remove_breakpoint);
864 fprintf_unfiltered (file,
865 "gdbarch_dump: name_of_malloc = %s\n",
866 current_gdbarch->name_of_malloc);
867 fprintf_unfiltered (file,
868 "gdbarch_dump: num_pseudo_regs = %s\n",
869 paddr_d (current_gdbarch->num_pseudo_regs));
870 fprintf_unfiltered (file,
871 "gdbarch_dump: num_regs = %s\n",
872 paddr_d (current_gdbarch->num_regs));
873 fprintf_unfiltered (file,
874 "gdbarch_dump: osabi = %s\n",
875 paddr_d (current_gdbarch->osabi));
876 fprintf_unfiltered (file,
877 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
878 gdbarch_overlay_update_p (current_gdbarch));
879 fprintf_unfiltered (file,
880 "gdbarch_dump: overlay_update = <0x%lx>\n",
881 (long) current_gdbarch->overlay_update);
882 fprintf_unfiltered (file,
883 "gdbarch_dump: pc_regnum = %s\n",
884 paddr_d (current_gdbarch->pc_regnum));
885 fprintf_unfiltered (file,
886 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
887 (long) current_gdbarch->pointer_to_address);
888 fprintf_unfiltered (file,
889 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
890 gdbarch_print_float_info_p (current_gdbarch));
891 fprintf_unfiltered (file,
892 "gdbarch_dump: print_float_info = <0x%lx>\n",
893 (long) current_gdbarch->print_float_info);
894 #ifdef TARGET_PRINT_INSN
895 fprintf_unfiltered (file,
896 "gdbarch_dump: %s # %s\n",
897 "TARGET_PRINT_INSN(vma, info)",
898 XSTRING (TARGET_PRINT_INSN (vma, info)));
900 fprintf_unfiltered (file,
901 "gdbarch_dump: print_insn = <0x%lx>\n",
902 (long) current_gdbarch->print_insn);
903 fprintf_unfiltered (file,
904 "gdbarch_dump: print_registers_info = <0x%lx>\n",
905 (long) current_gdbarch->print_registers_info);
906 fprintf_unfiltered (file,
907 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
908 gdbarch_print_vector_info_p (current_gdbarch));
909 fprintf_unfiltered (file,
910 "gdbarch_dump: print_vector_info = <0x%lx>\n",
911 (long) current_gdbarch->print_vector_info);
912 fprintf_unfiltered (file,
913 "gdbarch_dump: ps_regnum = %s\n",
914 paddr_d (current_gdbarch->ps_regnum));
915 fprintf_unfiltered (file,
916 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
917 gdbarch_pseudo_register_read_p (current_gdbarch));
918 fprintf_unfiltered (file,
919 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
920 (long) current_gdbarch->pseudo_register_read);
921 fprintf_unfiltered (file,
922 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
923 gdbarch_pseudo_register_write_p (current_gdbarch));
924 fprintf_unfiltered (file,
925 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
926 (long) current_gdbarch->pseudo_register_write);
927 fprintf_unfiltered (file,
928 "gdbarch_dump: ptr_bit = %s\n",
929 paddr_d (current_gdbarch->ptr_bit));
930 fprintf_unfiltered (file,
931 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
932 gdbarch_push_dummy_call_p (current_gdbarch));
933 fprintf_unfiltered (file,
934 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
935 (long) current_gdbarch->push_dummy_call);
936 fprintf_unfiltered (file,
937 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
938 gdbarch_push_dummy_code_p (current_gdbarch));
939 fprintf_unfiltered (file,
940 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
941 (long) current_gdbarch->push_dummy_code);
942 fprintf_unfiltered (file,
943 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
944 gdbarch_read_pc_p (current_gdbarch));
945 fprintf_unfiltered (file,
946 "gdbarch_dump: read_pc = <0x%lx>\n",
947 (long) current_gdbarch->read_pc);
948 fprintf_unfiltered (file,
949 "gdbarch_dump: register_name = <0x%lx>\n",
950 (long) current_gdbarch->register_name);
951 fprintf_unfiltered (file,
952 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
953 (long) current_gdbarch->register_reggroup_p);
954 fprintf_unfiltered (file,
955 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
956 (long) current_gdbarch->register_sim_regno);
957 fprintf_unfiltered (file,
958 "gdbarch_dump: register_to_value = <0x%lx>\n",
959 (long) current_gdbarch->register_to_value);
960 fprintf_unfiltered (file,
961 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
962 gdbarch_register_type_p (current_gdbarch));
963 fprintf_unfiltered (file,
964 "gdbarch_dump: register_type = <0x%lx>\n",
965 (long) current_gdbarch->register_type);
966 fprintf_unfiltered (file,
967 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
968 gdbarch_regset_from_core_section_p (current_gdbarch));
969 fprintf_unfiltered (file,
970 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
971 (long) current_gdbarch->regset_from_core_section);
972 fprintf_unfiltered (file,
973 "gdbarch_dump: remote_register_number = <0x%lx>\n",
974 (long) current_gdbarch->remote_register_number);
975 fprintf_unfiltered (file,
976 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
977 gdbarch_return_value_p (current_gdbarch));
978 fprintf_unfiltered (file,
979 "gdbarch_dump: return_value = <0x%lx>\n",
980 (long) current_gdbarch->return_value);
981 fprintf_unfiltered (file,
982 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
983 (long) current_gdbarch->sdb_reg_to_regnum);
984 fprintf_unfiltered (file,
985 "gdbarch_dump: short_bit = %s\n",
986 paddr_d (current_gdbarch->short_bit));
987 fprintf_unfiltered (file,
988 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
989 gdbarch_single_step_through_delay_p (current_gdbarch));
990 fprintf_unfiltered (file,
991 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
992 (long) current_gdbarch->single_step_through_delay);
993 fprintf_unfiltered (file,
994 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
995 gdbarch_skip_permanent_breakpoint_p (current_gdbarch));
996 fprintf_unfiltered (file,
997 "gdbarch_dump: skip_permanent_breakpoint = <0x%lx>\n",
998 (long) current_gdbarch->skip_permanent_breakpoint);
999 fprintf_unfiltered (file,
1000 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1001 (long) current_gdbarch->skip_prologue);
1002 fprintf_unfiltered (file,
1003 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1004 (long) current_gdbarch->skip_solib_resolver);
1005 fprintf_unfiltered (file,
1006 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1007 (long) current_gdbarch->skip_trampoline_code);
1008 fprintf_unfiltered (file,
1009 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1010 (long) current_gdbarch->smash_text_address);
1011 #ifdef SOFTWARE_SINGLE_STEP_P
1012 fprintf_unfiltered (file,
1013 "gdbarch_dump: %s # %s\n",
1014 "SOFTWARE_SINGLE_STEP_P()",
1015 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1017 fprintf_unfiltered (file,
1018 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1019 gdbarch_software_single_step_p (current_gdbarch));
1020 #ifdef SOFTWARE_SINGLE_STEP
1021 fprintf_unfiltered (file,
1022 "gdbarch_dump: %s # %s\n",
1023 "SOFTWARE_SINGLE_STEP(frame)",
1024 XSTRING (SOFTWARE_SINGLE_STEP (frame)));
1026 fprintf_unfiltered (file,
1027 "gdbarch_dump: software_single_step = <0x%lx>\n",
1028 (long) current_gdbarch->software_single_step);
1029 fprintf_unfiltered (file,
1030 "gdbarch_dump: sp_regnum = %s\n",
1031 paddr_d (current_gdbarch->sp_regnum));
1032 fprintf_unfiltered (file,
1033 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1034 (long) current_gdbarch->stab_reg_to_regnum);
1035 fprintf_unfiltered (file,
1036 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1037 (long) current_gdbarch->stabs_argument_has_addr);
1038 #ifdef STORE_RETURN_VALUE
1039 fprintf_unfiltered (file,
1040 "gdbarch_dump: %s # %s\n",
1041 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1042 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
1044 fprintf_unfiltered (file,
1045 "gdbarch_dump: store_return_value = <0x%lx>\n",
1046 (long) current_gdbarch->store_return_value);
1047 fprintf_unfiltered (file,
1048 "gdbarch_dump: target_desc = %s\n",
1049 paddr_d ((long) current_gdbarch->target_desc));
1050 fprintf_unfiltered (file,
1051 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1052 gdbarch_unwind_dummy_id_p (current_gdbarch));
1053 fprintf_unfiltered (file,
1054 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1055 (long) current_gdbarch->unwind_dummy_id);
1056 fprintf_unfiltered (file,
1057 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1058 gdbarch_unwind_pc_p (current_gdbarch));
1059 fprintf_unfiltered (file,
1060 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1061 (long) current_gdbarch->unwind_pc);
1062 fprintf_unfiltered (file,
1063 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1064 gdbarch_unwind_sp_p (current_gdbarch));
1065 fprintf_unfiltered (file,
1066 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1067 (long) current_gdbarch->unwind_sp);
1068 fprintf_unfiltered (file,
1069 "gdbarch_dump: value_from_register = <0x%lx>\n",
1070 (long) current_gdbarch->value_from_register);
1071 fprintf_unfiltered (file,
1072 "gdbarch_dump: value_to_register = <0x%lx>\n",
1073 (long) current_gdbarch->value_to_register);
1074 fprintf_unfiltered (file,
1075 "gdbarch_dump: vbit_in_delta = %s\n",
1076 paddr_d (current_gdbarch->vbit_in_delta));
1077 fprintf_unfiltered (file,
1078 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1079 (long) current_gdbarch->virtual_frame_pointer);
1080 fprintf_unfiltered (file,
1081 "gdbarch_dump: vtable_function_descriptors = %s\n",
1082 paddr_d (current_gdbarch->vtable_function_descriptors));
1083 fprintf_unfiltered (file,
1084 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1085 gdbarch_write_pc_p (current_gdbarch));
1086 fprintf_unfiltered (file,
1087 "gdbarch_dump: write_pc = <0x%lx>\n",
1088 (long) current_gdbarch->write_pc);
1089 if (current_gdbarch->dump_tdep != NULL)
1090 current_gdbarch->dump_tdep (current_gdbarch, file);
1093 struct gdbarch_tdep *
1094 gdbarch_tdep (struct gdbarch *gdbarch)
1096 if (gdbarch_debug >= 2)
1097 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1098 return gdbarch->tdep;
1102 const struct bfd_arch_info *
1103 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1105 gdb_assert (gdbarch != NULL);
1106 if (gdbarch_debug >= 2)
1107 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1108 return gdbarch->bfd_arch_info;
1112 gdbarch_byte_order (struct gdbarch *gdbarch)
1114 gdb_assert (gdbarch != NULL);
1115 if (gdbarch_debug >= 2)
1116 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1117 return gdbarch->byte_order;
1121 gdbarch_osabi (struct gdbarch *gdbarch)
1123 gdb_assert (gdbarch != NULL);
1124 if (gdbarch_debug >= 2)
1125 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1126 return gdbarch->osabi;
1129 const struct target_desc *
1130 gdbarch_target_desc (struct gdbarch *gdbarch)
1132 gdb_assert (gdbarch != NULL);
1133 if (gdbarch_debug >= 2)
1134 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1135 return gdbarch->target_desc;
1139 gdbarch_short_bit (struct gdbarch *gdbarch)
1141 gdb_assert (gdbarch != NULL);
1142 /* Skip verify of short_bit, invalid_p == 0 */
1143 if (gdbarch_debug >= 2)
1144 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1145 return gdbarch->short_bit;
1149 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1152 gdbarch->short_bit = short_bit;
1156 gdbarch_int_bit (struct gdbarch *gdbarch)
1158 gdb_assert (gdbarch != NULL);
1159 /* Skip verify of int_bit, invalid_p == 0 */
1160 if (gdbarch_debug >= 2)
1161 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1162 return gdbarch->int_bit;
1166 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1169 gdbarch->int_bit = int_bit;
1173 gdbarch_long_bit (struct gdbarch *gdbarch)
1175 gdb_assert (gdbarch != NULL);
1176 /* Skip verify of long_bit, invalid_p == 0 */
1177 if (gdbarch_debug >= 2)
1178 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1179 return gdbarch->long_bit;
1183 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1186 gdbarch->long_bit = long_bit;
1190 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1192 gdb_assert (gdbarch != NULL);
1193 /* Skip verify of long_long_bit, invalid_p == 0 */
1194 if (gdbarch_debug >= 2)
1195 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1196 return gdbarch->long_long_bit;
1200 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1203 gdbarch->long_long_bit = long_long_bit;
1207 gdbarch_float_bit (struct gdbarch *gdbarch)
1209 gdb_assert (gdbarch != NULL);
1210 /* Skip verify of float_bit, invalid_p == 0 */
1211 if (gdbarch_debug >= 2)
1212 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1213 return gdbarch->float_bit;
1217 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1220 gdbarch->float_bit = float_bit;
1223 const struct floatformat **
1224 gdbarch_float_format (struct gdbarch *gdbarch)
1226 gdb_assert (gdbarch != NULL);
1227 if (gdbarch_debug >= 2)
1228 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1229 return gdbarch->float_format;
1233 set_gdbarch_float_format (struct gdbarch *gdbarch,
1234 const struct floatformat ** float_format)
1236 gdbarch->float_format = float_format;
1240 gdbarch_double_bit (struct gdbarch *gdbarch)
1242 gdb_assert (gdbarch != NULL);
1243 /* Skip verify of double_bit, invalid_p == 0 */
1244 if (gdbarch_debug >= 2)
1245 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1246 return gdbarch->double_bit;
1250 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1253 gdbarch->double_bit = double_bit;
1256 const struct floatformat **
1257 gdbarch_double_format (struct gdbarch *gdbarch)
1259 gdb_assert (gdbarch != NULL);
1260 if (gdbarch_debug >= 2)
1261 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1262 return gdbarch->double_format;
1266 set_gdbarch_double_format (struct gdbarch *gdbarch,
1267 const struct floatformat ** double_format)
1269 gdbarch->double_format = double_format;
1273 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1275 gdb_assert (gdbarch != NULL);
1276 /* Skip verify of long_double_bit, invalid_p == 0 */
1277 if (gdbarch_debug >= 2)
1278 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1279 return gdbarch->long_double_bit;
1283 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1284 int long_double_bit)
1286 gdbarch->long_double_bit = long_double_bit;
1289 const struct floatformat **
1290 gdbarch_long_double_format (struct gdbarch *gdbarch)
1292 gdb_assert (gdbarch != NULL);
1293 if (gdbarch_debug >= 2)
1294 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1295 return gdbarch->long_double_format;
1299 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1300 const struct floatformat ** long_double_format)
1302 gdbarch->long_double_format = long_double_format;
1306 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1308 gdb_assert (gdbarch != NULL);
1309 /* Skip verify of ptr_bit, invalid_p == 0 */
1310 if (gdbarch_debug >= 2)
1311 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1312 return gdbarch->ptr_bit;
1316 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1319 gdbarch->ptr_bit = ptr_bit;
1323 gdbarch_addr_bit (struct gdbarch *gdbarch)
1325 gdb_assert (gdbarch != NULL);
1326 /* Check variable changed from pre-default. */
1327 gdb_assert (gdbarch->addr_bit != 0);
1328 if (gdbarch_debug >= 2)
1329 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1330 return gdbarch->addr_bit;
1334 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1337 gdbarch->addr_bit = addr_bit;
1341 gdbarch_char_signed (struct gdbarch *gdbarch)
1343 gdb_assert (gdbarch != NULL);
1344 /* Check variable changed from pre-default. */
1345 gdb_assert (gdbarch->char_signed != -1);
1346 if (gdbarch_debug >= 2)
1347 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1348 return gdbarch->char_signed;
1352 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1355 gdbarch->char_signed = char_signed;
1359 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1361 gdb_assert (gdbarch != NULL);
1362 return gdbarch->read_pc != NULL;
1366 gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache)
1368 gdb_assert (gdbarch != NULL);
1369 gdb_assert (gdbarch->read_pc != NULL);
1370 if (gdbarch_debug >= 2)
1371 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1372 return gdbarch->read_pc (regcache);
1376 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1377 gdbarch_read_pc_ftype read_pc)
1379 gdbarch->read_pc = read_pc;
1383 gdbarch_write_pc_p (struct gdbarch *gdbarch)
1385 gdb_assert (gdbarch != NULL);
1386 return gdbarch->write_pc != NULL;
1390 gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val)
1392 gdb_assert (gdbarch != NULL);
1393 gdb_assert (gdbarch->write_pc != NULL);
1394 if (gdbarch_debug >= 2)
1395 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1396 gdbarch->write_pc (regcache, val);
1400 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1401 gdbarch_write_pc_ftype write_pc)
1403 gdbarch->write_pc = write_pc;
1407 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1409 gdb_assert (gdbarch != NULL);
1410 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1411 if (gdbarch_debug >= 2)
1412 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1413 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
1417 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1418 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1420 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1424 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1426 gdb_assert (gdbarch != NULL);
1427 return gdbarch->pseudo_register_read != NULL;
1431 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
1433 gdb_assert (gdbarch != NULL);
1434 gdb_assert (gdbarch->pseudo_register_read != NULL);
1435 if (gdbarch_debug >= 2)
1436 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1437 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1441 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1442 gdbarch_pseudo_register_read_ftype pseudo_register_read)
1444 gdbarch->pseudo_register_read = pseudo_register_read;
1448 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
1450 gdb_assert (gdbarch != NULL);
1451 return gdbarch->pseudo_register_write != NULL;
1455 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
1457 gdb_assert (gdbarch != NULL);
1458 gdb_assert (gdbarch->pseudo_register_write != NULL);
1459 if (gdbarch_debug >= 2)
1460 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1461 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
1465 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1466 gdbarch_pseudo_register_write_ftype pseudo_register_write)
1468 gdbarch->pseudo_register_write = pseudo_register_write;
1472 gdbarch_num_regs (struct gdbarch *gdbarch)
1474 gdb_assert (gdbarch != NULL);
1475 /* Check variable changed from pre-default. */
1476 gdb_assert (gdbarch->num_regs != -1);
1477 if (gdbarch_debug >= 2)
1478 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1479 return gdbarch->num_regs;
1483 set_gdbarch_num_regs (struct gdbarch *gdbarch,
1486 gdbarch->num_regs = num_regs;
1490 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
1492 gdb_assert (gdbarch != NULL);
1493 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1494 if (gdbarch_debug >= 2)
1495 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
1496 return gdbarch->num_pseudo_regs;
1500 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
1501 int num_pseudo_regs)
1503 gdbarch->num_pseudo_regs = num_pseudo_regs;
1507 gdbarch_sp_regnum (struct gdbarch *gdbarch)
1509 gdb_assert (gdbarch != NULL);
1510 /* Skip verify of sp_regnum, invalid_p == 0 */
1511 if (gdbarch_debug >= 2)
1512 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
1513 return gdbarch->sp_regnum;
1517 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
1520 gdbarch->sp_regnum = sp_regnum;
1524 gdbarch_pc_regnum (struct gdbarch *gdbarch)
1526 gdb_assert (gdbarch != NULL);
1527 /* Skip verify of pc_regnum, invalid_p == 0 */
1528 if (gdbarch_debug >= 2)
1529 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
1530 return gdbarch->pc_regnum;
1534 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
1537 gdbarch->pc_regnum = pc_regnum;
1541 gdbarch_ps_regnum (struct gdbarch *gdbarch)
1543 gdb_assert (gdbarch != NULL);
1544 /* Skip verify of ps_regnum, invalid_p == 0 */
1545 if (gdbarch_debug >= 2)
1546 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
1547 return gdbarch->ps_regnum;
1551 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
1554 gdbarch->ps_regnum = ps_regnum;
1558 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
1560 gdb_assert (gdbarch != NULL);
1561 /* Skip verify of fp0_regnum, invalid_p == 0 */
1562 if (gdbarch_debug >= 2)
1563 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
1564 return gdbarch->fp0_regnum;
1568 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
1571 gdbarch->fp0_regnum = fp0_regnum;
1575 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
1577 gdb_assert (gdbarch != NULL);
1578 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
1579 if (gdbarch_debug >= 2)
1580 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
1581 return gdbarch->stab_reg_to_regnum (stab_regnr);
1585 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
1586 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
1588 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
1592 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
1594 gdb_assert (gdbarch != NULL);
1595 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
1596 if (gdbarch_debug >= 2)
1597 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
1598 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
1602 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
1603 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
1605 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
1609 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
1611 gdb_assert (gdbarch != NULL);
1612 gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
1613 if (gdbarch_debug >= 2)
1614 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
1615 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
1619 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
1620 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
1622 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
1626 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
1628 gdb_assert (gdbarch != NULL);
1629 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
1630 if (gdbarch_debug >= 2)
1631 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
1632 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
1636 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
1637 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
1639 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
1643 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
1645 gdb_assert (gdbarch != NULL);
1646 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
1647 if (gdbarch_debug >= 2)
1648 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
1649 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
1653 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
1654 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
1656 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
1660 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
1662 gdb_assert (gdbarch != NULL);
1663 gdb_assert (gdbarch->register_name != NULL);
1664 if (gdbarch_debug >= 2)
1665 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
1666 return gdbarch->register_name (regnr);
1670 set_gdbarch_register_name (struct gdbarch *gdbarch,
1671 gdbarch_register_name_ftype register_name)
1673 gdbarch->register_name = register_name;
1677 gdbarch_register_type_p (struct gdbarch *gdbarch)
1679 gdb_assert (gdbarch != NULL);
1680 return gdbarch->register_type != NULL;
1684 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
1686 gdb_assert (gdbarch != NULL);
1687 gdb_assert (gdbarch->register_type != NULL);
1688 if (gdbarch_debug >= 2)
1689 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
1690 return gdbarch->register_type (gdbarch, reg_nr);
1694 set_gdbarch_register_type (struct gdbarch *gdbarch,
1695 gdbarch_register_type_ftype register_type)
1697 gdbarch->register_type = register_type;
1701 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
1703 gdb_assert (gdbarch != NULL);
1704 return gdbarch->unwind_dummy_id != NULL;
1708 gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
1710 gdb_assert (gdbarch != NULL);
1711 gdb_assert (gdbarch->unwind_dummy_id != NULL);
1712 if (gdbarch_debug >= 2)
1713 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
1714 return gdbarch->unwind_dummy_id (gdbarch, info);
1718 set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
1719 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
1721 gdbarch->unwind_dummy_id = unwind_dummy_id;
1725 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
1727 gdb_assert (gdbarch != NULL);
1728 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1729 if (gdbarch_debug >= 2)
1730 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
1731 return gdbarch->deprecated_fp_regnum;
1735 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
1736 int deprecated_fp_regnum)
1738 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
1742 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
1744 gdb_assert (gdbarch != NULL);
1745 return gdbarch->push_dummy_call != NULL;
1749 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)
1751 gdb_assert (gdbarch != NULL);
1752 gdb_assert (gdbarch->push_dummy_call != NULL);
1753 if (gdbarch_debug >= 2)
1754 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
1755 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
1759 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
1760 gdbarch_push_dummy_call_ftype push_dummy_call)
1762 gdbarch->push_dummy_call = push_dummy_call;
1766 gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
1768 gdb_assert (gdbarch != NULL);
1769 if (gdbarch_debug >= 2)
1770 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
1771 return gdbarch->deprecated_register_size;
1775 set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
1776 int deprecated_register_size)
1778 gdbarch->deprecated_register_size = deprecated_register_size;
1782 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
1784 gdb_assert (gdbarch != NULL);
1785 /* Skip verify of call_dummy_location, invalid_p == 0 */
1786 if (gdbarch_debug >= 2)
1787 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
1788 return gdbarch->call_dummy_location;
1792 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
1793 int call_dummy_location)
1795 gdbarch->call_dummy_location = call_dummy_location;
1799 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
1801 gdb_assert (gdbarch != NULL);
1802 return gdbarch->push_dummy_code != NULL;
1806 gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache)
1808 gdb_assert (gdbarch != NULL);
1809 gdb_assert (gdbarch->push_dummy_code != NULL);
1810 if (gdbarch_debug >= 2)
1811 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
1812 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr, regcache);
1816 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
1817 gdbarch_push_dummy_code_ftype push_dummy_code)
1819 gdbarch->push_dummy_code = push_dummy_code;
1823 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
1825 gdb_assert (gdbarch != NULL);
1826 gdb_assert (gdbarch->print_registers_info != NULL);
1827 if (gdbarch_debug >= 2)
1828 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
1829 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
1833 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
1834 gdbarch_print_registers_info_ftype print_registers_info)
1836 gdbarch->print_registers_info = print_registers_info;
1840 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
1842 gdb_assert (gdbarch != NULL);
1843 return gdbarch->print_float_info != NULL;
1847 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1849 gdb_assert (gdbarch != NULL);
1850 gdb_assert (gdbarch->print_float_info != NULL);
1851 if (gdbarch_debug >= 2)
1852 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
1853 gdbarch->print_float_info (gdbarch, file, frame, args);
1857 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
1858 gdbarch_print_float_info_ftype print_float_info)
1860 gdbarch->print_float_info = print_float_info;
1864 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
1866 gdb_assert (gdbarch != NULL);
1867 return gdbarch->print_vector_info != NULL;
1871 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1873 gdb_assert (gdbarch != NULL);
1874 gdb_assert (gdbarch->print_vector_info != NULL);
1875 if (gdbarch_debug >= 2)
1876 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
1877 gdbarch->print_vector_info (gdbarch, file, frame, args);
1881 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
1882 gdbarch_print_vector_info_ftype print_vector_info)
1884 gdbarch->print_vector_info = print_vector_info;
1888 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
1890 gdb_assert (gdbarch != NULL);
1891 gdb_assert (gdbarch->register_sim_regno != NULL);
1892 if (gdbarch_debug >= 2)
1893 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
1894 return gdbarch->register_sim_regno (reg_nr);
1898 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
1899 gdbarch_register_sim_regno_ftype register_sim_regno)
1901 gdbarch->register_sim_regno = register_sim_regno;
1905 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
1907 gdb_assert (gdbarch != NULL);
1908 gdb_assert (gdbarch->cannot_fetch_register != NULL);
1909 if (gdbarch_debug >= 2)
1910 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
1911 return gdbarch->cannot_fetch_register (regnum);
1915 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
1916 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
1918 gdbarch->cannot_fetch_register = cannot_fetch_register;
1922 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
1924 gdb_assert (gdbarch != NULL);
1925 gdb_assert (gdbarch->cannot_store_register != NULL);
1926 if (gdbarch_debug >= 2)
1927 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
1928 return gdbarch->cannot_store_register (regnum);
1932 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
1933 gdbarch_cannot_store_register_ftype cannot_store_register)
1935 gdbarch->cannot_store_register = cannot_store_register;
1939 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
1941 gdb_assert (gdbarch != NULL);
1942 return gdbarch->get_longjmp_target != NULL;
1946 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc)
1948 gdb_assert (gdbarch != NULL);
1949 gdb_assert (gdbarch->get_longjmp_target != NULL);
1950 if (gdbarch_debug >= 2)
1951 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
1952 return gdbarch->get_longjmp_target (frame, pc);
1956 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
1957 gdbarch_get_longjmp_target_ftype get_longjmp_target)
1959 gdbarch->get_longjmp_target = get_longjmp_target;
1963 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
1965 gdb_assert (gdbarch != NULL);
1966 if (gdbarch_debug >= 2)
1967 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
1968 return gdbarch->believe_pcc_promotion;
1972 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
1973 int believe_pcc_promotion)
1975 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
1979 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
1981 gdb_assert (gdbarch != NULL);
1982 gdb_assert (gdbarch->convert_register_p != NULL);
1983 if (gdbarch_debug >= 2)
1984 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
1985 return gdbarch->convert_register_p (regnum, type);
1989 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
1990 gdbarch_convert_register_p_ftype convert_register_p)
1992 gdbarch->convert_register_p = convert_register_p;
1996 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf)
1998 gdb_assert (gdbarch != NULL);
1999 gdb_assert (gdbarch->register_to_value != NULL);
2000 if (gdbarch_debug >= 2)
2001 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2002 gdbarch->register_to_value (frame, regnum, type, buf);
2006 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2007 gdbarch_register_to_value_ftype register_to_value)
2009 gdbarch->register_to_value = register_to_value;
2013 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
2015 gdb_assert (gdbarch != NULL);
2016 gdb_assert (gdbarch->value_to_register != NULL);
2017 if (gdbarch_debug >= 2)
2018 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2019 gdbarch->value_to_register (frame, regnum, type, buf);
2023 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2024 gdbarch_value_to_register_ftype value_to_register)
2026 gdbarch->value_to_register = value_to_register;
2030 gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
2032 gdb_assert (gdbarch != NULL);
2033 gdb_assert (gdbarch->value_from_register != NULL);
2034 if (gdbarch_debug >= 2)
2035 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
2036 return gdbarch->value_from_register (type, regnum, frame);
2040 set_gdbarch_value_from_register (struct gdbarch *gdbarch,
2041 gdbarch_value_from_register_ftype value_from_register)
2043 gdbarch->value_from_register = value_from_register;
2047 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2049 gdb_assert (gdbarch != NULL);
2050 gdb_assert (gdbarch->pointer_to_address != NULL);
2051 if (gdbarch_debug >= 2)
2052 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2053 return gdbarch->pointer_to_address (type, buf);
2057 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2058 gdbarch_pointer_to_address_ftype pointer_to_address)
2060 gdbarch->pointer_to_address = pointer_to_address;
2064 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
2066 gdb_assert (gdbarch != NULL);
2067 gdb_assert (gdbarch->address_to_pointer != NULL);
2068 if (gdbarch_debug >= 2)
2069 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2070 gdbarch->address_to_pointer (type, buf, addr);
2074 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2075 gdbarch_address_to_pointer_ftype address_to_pointer)
2077 gdbarch->address_to_pointer = address_to_pointer;
2081 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2083 gdb_assert (gdbarch != NULL);
2084 return gdbarch->integer_to_address != NULL;
2088 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2090 gdb_assert (gdbarch != NULL);
2091 gdb_assert (gdbarch->integer_to_address != NULL);
2092 if (gdbarch_debug >= 2)
2093 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2094 return gdbarch->integer_to_address (gdbarch, type, buf);
2098 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2099 gdbarch_integer_to_address_ftype integer_to_address)
2101 gdbarch->integer_to_address = integer_to_address;
2105 gdbarch_return_value_p (struct gdbarch *gdbarch)
2107 gdb_assert (gdbarch != NULL);
2108 return gdbarch->return_value != legacy_return_value;
2111 enum return_value_convention
2112 gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2114 gdb_assert (gdbarch != NULL);
2115 gdb_assert (gdbarch->return_value != NULL);
2116 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2117 if (gdbarch_debug >= 2)
2118 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2119 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
2123 set_gdbarch_return_value (struct gdbarch *gdbarch,
2124 gdbarch_return_value_ftype return_value)
2126 gdbarch->return_value = return_value;
2130 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf)
2132 gdb_assert (gdbarch != NULL);
2133 gdb_assert (gdbarch->extract_return_value != NULL);
2134 if (gdbarch_debug >= 2)
2135 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
2136 gdbarch->extract_return_value (type, regcache, valbuf);
2140 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
2141 gdbarch_extract_return_value_ftype extract_return_value)
2143 gdbarch->extract_return_value = extract_return_value;
2147 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
2149 gdb_assert (gdbarch != NULL);
2150 gdb_assert (gdbarch->store_return_value != NULL);
2151 if (gdbarch_debug >= 2)
2152 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
2153 gdbarch->store_return_value (type, regcache, valbuf);
2157 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
2158 gdbarch_store_return_value_ftype store_return_value)
2160 gdbarch->store_return_value = store_return_value;
2164 gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
2166 gdb_assert (gdbarch != NULL);
2167 gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
2168 if (gdbarch_debug >= 2)
2169 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
2170 return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
2174 set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
2175 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
2177 gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
2181 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2183 gdb_assert (gdbarch != NULL);
2184 gdb_assert (gdbarch->skip_prologue != NULL);
2185 if (gdbarch_debug >= 2)
2186 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2187 return gdbarch->skip_prologue (ip);
2191 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2192 gdbarch_skip_prologue_ftype skip_prologue)
2194 gdbarch->skip_prologue = skip_prologue;
2198 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2200 gdb_assert (gdbarch != NULL);
2201 gdb_assert (gdbarch->inner_than != NULL);
2202 if (gdbarch_debug >= 2)
2203 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2204 return gdbarch->inner_than (lhs, rhs);
2208 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2209 gdbarch_inner_than_ftype inner_than)
2211 gdbarch->inner_than = inner_than;
2215 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2217 gdb_assert (gdbarch != NULL);
2218 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2219 if (gdbarch_debug >= 2)
2220 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2221 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
2225 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2226 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2228 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2232 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2234 gdb_assert (gdbarch != NULL);
2235 return gdbarch->adjust_breakpoint_address != NULL;
2239 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2241 gdb_assert (gdbarch != NULL);
2242 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2243 if (gdbarch_debug >= 2)
2244 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2245 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2249 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2250 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2252 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2256 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2258 gdb_assert (gdbarch != NULL);
2259 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2260 if (gdbarch_debug >= 2)
2261 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2262 return gdbarch->memory_insert_breakpoint (bp_tgt);
2266 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2267 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2269 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2273 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2275 gdb_assert (gdbarch != NULL);
2276 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2277 if (gdbarch_debug >= 2)
2278 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2279 return gdbarch->memory_remove_breakpoint (bp_tgt);
2283 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2284 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2286 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2290 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2292 gdb_assert (gdbarch != NULL);
2293 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2294 if (gdbarch_debug >= 2)
2295 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2296 return gdbarch->decr_pc_after_break;
2300 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2301 CORE_ADDR decr_pc_after_break)
2303 gdbarch->decr_pc_after_break = decr_pc_after_break;
2307 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2309 gdb_assert (gdbarch != NULL);
2310 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2311 if (gdbarch_debug >= 2)
2312 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2313 return gdbarch->deprecated_function_start_offset;
2317 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2318 CORE_ADDR deprecated_function_start_offset)
2320 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2324 gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
2326 gdb_assert (gdbarch != NULL);
2327 gdb_assert (gdbarch->remote_register_number != NULL);
2328 if (gdbarch_debug >= 2)
2329 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
2330 return gdbarch->remote_register_number (gdbarch, regno);
2334 set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
2335 gdbarch_remote_register_number_ftype remote_register_number)
2337 gdbarch->remote_register_number = remote_register_number;
2341 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2343 gdb_assert (gdbarch != NULL);
2344 return gdbarch->fetch_tls_load_module_address != NULL;
2348 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
2350 gdb_assert (gdbarch != NULL);
2351 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
2352 if (gdbarch_debug >= 2)
2353 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
2354 return gdbarch->fetch_tls_load_module_address (objfile);
2358 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
2359 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
2361 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
2365 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
2367 gdb_assert (gdbarch != NULL);
2368 /* Skip verify of frame_args_skip, invalid_p == 0 */
2369 if (gdbarch_debug >= 2)
2370 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2371 return gdbarch->frame_args_skip;
2375 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2376 CORE_ADDR frame_args_skip)
2378 gdbarch->frame_args_skip = frame_args_skip;
2382 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
2384 gdb_assert (gdbarch != NULL);
2385 return gdbarch->unwind_pc != NULL;
2389 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
2391 gdb_assert (gdbarch != NULL);
2392 gdb_assert (gdbarch->unwind_pc != NULL);
2393 if (gdbarch_debug >= 2)
2394 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
2395 return gdbarch->unwind_pc (gdbarch, next_frame);
2399 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
2400 gdbarch_unwind_pc_ftype unwind_pc)
2402 gdbarch->unwind_pc = unwind_pc;
2406 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
2408 gdb_assert (gdbarch != NULL);
2409 return gdbarch->unwind_sp != NULL;
2413 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
2415 gdb_assert (gdbarch != NULL);
2416 gdb_assert (gdbarch->unwind_sp != NULL);
2417 if (gdbarch_debug >= 2)
2418 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
2419 return gdbarch->unwind_sp (gdbarch, next_frame);
2423 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
2424 gdbarch_unwind_sp_ftype unwind_sp)
2426 gdbarch->unwind_sp = unwind_sp;
2430 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
2432 gdb_assert (gdbarch != NULL);
2433 return gdbarch->frame_num_args != NULL;
2437 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2439 gdb_assert (gdbarch != NULL);
2440 gdb_assert (gdbarch->frame_num_args != NULL);
2441 if (gdbarch_debug >= 2)
2442 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
2443 return gdbarch->frame_num_args (frame);
2447 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
2448 gdbarch_frame_num_args_ftype frame_num_args)
2450 gdbarch->frame_num_args = frame_num_args;
2454 gdbarch_frame_align_p (struct gdbarch *gdbarch)
2456 gdb_assert (gdbarch != NULL);
2457 return gdbarch->frame_align != NULL;
2461 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
2463 gdb_assert (gdbarch != NULL);
2464 gdb_assert (gdbarch->frame_align != NULL);
2465 if (gdbarch_debug >= 2)
2466 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
2467 return gdbarch->frame_align (gdbarch, address);
2471 set_gdbarch_frame_align (struct gdbarch *gdbarch,
2472 gdbarch_frame_align_ftype frame_align)
2474 gdbarch->frame_align = frame_align;
2478 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
2480 gdb_assert (gdbarch != NULL);
2481 return gdbarch->deprecated_reg_struct_has_addr != NULL;
2485 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
2487 gdb_assert (gdbarch != NULL);
2488 gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
2489 if (gdbarch_debug >= 2)
2490 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
2491 return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
2495 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
2496 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
2498 gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
2502 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
2504 gdb_assert (gdbarch != NULL);
2505 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
2506 if (gdbarch_debug >= 2)
2507 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
2508 return gdbarch->stabs_argument_has_addr (gdbarch, type);
2512 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
2513 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
2515 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
2519 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
2521 gdb_assert (gdbarch != NULL);
2522 if (gdbarch_debug >= 2)
2523 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
2524 return gdbarch->frame_red_zone_size;
2528 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
2529 int frame_red_zone_size)
2531 gdbarch->frame_red_zone_size = frame_red_zone_size;
2535 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
2537 gdb_assert (gdbarch != NULL);
2538 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
2539 if (gdbarch_debug >= 2)
2540 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
2541 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
2545 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
2546 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
2548 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
2552 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
2554 gdb_assert (gdbarch != NULL);
2555 gdb_assert (gdbarch->addr_bits_remove != NULL);
2556 if (gdbarch_debug >= 2)
2557 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
2558 return gdbarch->addr_bits_remove (addr);
2562 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
2563 gdbarch_addr_bits_remove_ftype addr_bits_remove)
2565 gdbarch->addr_bits_remove = addr_bits_remove;
2569 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
2571 gdb_assert (gdbarch != NULL);
2572 gdb_assert (gdbarch->smash_text_address != NULL);
2573 if (gdbarch_debug >= 2)
2574 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
2575 return gdbarch->smash_text_address (addr);
2579 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
2580 gdbarch_smash_text_address_ftype smash_text_address)
2582 gdbarch->smash_text_address = smash_text_address;
2586 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
2588 gdb_assert (gdbarch != NULL);
2589 return gdbarch->software_single_step != NULL;
2593 gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
2595 gdb_assert (gdbarch != NULL);
2596 gdb_assert (gdbarch->software_single_step != NULL);
2597 if (gdbarch_debug >= 2)
2598 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
2599 return gdbarch->software_single_step (frame);
2603 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
2604 gdbarch_software_single_step_ftype software_single_step)
2606 gdbarch->software_single_step = software_single_step;
2610 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
2612 gdb_assert (gdbarch != NULL);
2613 return gdbarch->single_step_through_delay != NULL;
2617 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
2619 gdb_assert (gdbarch != NULL);
2620 gdb_assert (gdbarch->single_step_through_delay != NULL);
2621 if (gdbarch_debug >= 2)
2622 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
2623 return gdbarch->single_step_through_delay (gdbarch, frame);
2627 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
2628 gdbarch_single_step_through_delay_ftype single_step_through_delay)
2630 gdbarch->single_step_through_delay = single_step_through_delay;
2634 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
2636 gdb_assert (gdbarch != NULL);
2637 gdb_assert (gdbarch->print_insn != NULL);
2638 if (gdbarch_debug >= 2)
2639 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
2640 return gdbarch->print_insn (vma, info);
2644 set_gdbarch_print_insn (struct gdbarch *gdbarch,
2645 gdbarch_print_insn_ftype print_insn)
2647 gdbarch->print_insn = print_insn;
2651 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc)
2653 gdb_assert (gdbarch != NULL);
2654 gdb_assert (gdbarch->skip_trampoline_code != NULL);
2655 if (gdbarch_debug >= 2)
2656 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
2657 return gdbarch->skip_trampoline_code (frame, pc);
2661 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
2662 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
2664 gdbarch->skip_trampoline_code = skip_trampoline_code;
2668 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
2670 gdb_assert (gdbarch != NULL);
2671 gdb_assert (gdbarch->skip_solib_resolver != NULL);
2672 if (gdbarch_debug >= 2)
2673 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
2674 return gdbarch->skip_solib_resolver (gdbarch, pc);
2678 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
2679 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
2681 gdbarch->skip_solib_resolver = skip_solib_resolver;
2685 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
2687 gdb_assert (gdbarch != NULL);
2688 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
2689 if (gdbarch_debug >= 2)
2690 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
2691 return gdbarch->in_solib_return_trampoline (pc, name);
2695 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
2696 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
2698 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
2702 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
2704 gdb_assert (gdbarch != NULL);
2705 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
2706 if (gdbarch_debug >= 2)
2707 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
2708 return gdbarch->in_function_epilogue_p (gdbarch, addr);
2712 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
2713 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
2715 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
2719 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
2721 gdb_assert (gdbarch != NULL);
2722 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
2723 if (gdbarch_debug >= 2)
2724 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
2725 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
2729 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
2730 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
2732 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
2736 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
2738 gdb_assert (gdbarch != NULL);
2739 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
2740 if (gdbarch_debug >= 2)
2741 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
2742 gdbarch->elf_make_msymbol_special (sym, msym);
2746 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
2747 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
2749 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
2753 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
2755 gdb_assert (gdbarch != NULL);
2756 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
2757 if (gdbarch_debug >= 2)
2758 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
2759 gdbarch->coff_make_msymbol_special (val, msym);
2763 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
2764 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
2766 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
2770 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
2772 gdb_assert (gdbarch != NULL);
2773 /* Skip verify of name_of_malloc, invalid_p == 0 */
2774 if (gdbarch_debug >= 2)
2775 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
2776 return gdbarch->name_of_malloc;
2780 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
2781 const char * name_of_malloc)
2783 gdbarch->name_of_malloc = name_of_malloc;
2787 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
2789 gdb_assert (gdbarch != NULL);
2790 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2791 if (gdbarch_debug >= 2)
2792 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
2793 return gdbarch->cannot_step_breakpoint;
2797 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
2798 int cannot_step_breakpoint)
2800 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
2804 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
2806 gdb_assert (gdbarch != NULL);
2807 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2808 if (gdbarch_debug >= 2)
2809 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
2810 return gdbarch->have_nonsteppable_watchpoint;
2814 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
2815 int have_nonsteppable_watchpoint)
2817 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
2821 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
2823 gdb_assert (gdbarch != NULL);
2824 return gdbarch->address_class_type_flags != NULL;
2828 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
2830 gdb_assert (gdbarch != NULL);
2831 gdb_assert (gdbarch->address_class_type_flags != NULL);
2832 if (gdbarch_debug >= 2)
2833 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
2834 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
2838 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
2839 gdbarch_address_class_type_flags_ftype address_class_type_flags)
2841 gdbarch->address_class_type_flags = address_class_type_flags;
2845 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
2847 gdb_assert (gdbarch != NULL);
2848 return gdbarch->address_class_type_flags_to_name != NULL;
2852 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
2854 gdb_assert (gdbarch != NULL);
2855 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
2856 if (gdbarch_debug >= 2)
2857 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
2858 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
2862 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
2863 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
2865 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
2869 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
2871 gdb_assert (gdbarch != NULL);
2872 return gdbarch->address_class_name_to_type_flags != NULL;
2876 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
2878 gdb_assert (gdbarch != NULL);
2879 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
2880 if (gdbarch_debug >= 2)
2881 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
2882 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
2886 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
2887 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
2889 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
2893 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
2895 gdb_assert (gdbarch != NULL);
2896 gdb_assert (gdbarch->register_reggroup_p != NULL);
2897 if (gdbarch_debug >= 2)
2898 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
2899 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
2903 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
2904 gdbarch_register_reggroup_p_ftype register_reggroup_p)
2906 gdbarch->register_reggroup_p = register_reggroup_p;
2910 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
2912 gdb_assert (gdbarch != NULL);
2913 return gdbarch->fetch_pointer_argument != NULL;
2917 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
2919 gdb_assert (gdbarch != NULL);
2920 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
2921 if (gdbarch_debug >= 2)
2922 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
2923 return gdbarch->fetch_pointer_argument (frame, argi, type);
2927 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
2928 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
2930 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
2934 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
2936 gdb_assert (gdbarch != NULL);
2937 return gdbarch->regset_from_core_section != NULL;
2940 const struct regset *
2941 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
2943 gdb_assert (gdbarch != NULL);
2944 gdb_assert (gdbarch->regset_from_core_section != NULL);
2945 if (gdbarch_debug >= 2)
2946 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
2947 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
2951 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
2952 gdbarch_regset_from_core_section_ftype regset_from_core_section)
2954 gdbarch->regset_from_core_section = regset_from_core_section;
2958 gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
2960 gdb_assert (gdbarch != NULL);
2961 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
2962 if (gdbarch_debug >= 2)
2963 fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
2964 return gdbarch->vtable_function_descriptors;
2968 set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
2969 int vtable_function_descriptors)
2971 gdbarch->vtable_function_descriptors = vtable_function_descriptors;
2975 gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
2977 gdb_assert (gdbarch != NULL);
2978 /* Skip verify of vbit_in_delta, invalid_p == 0 */
2979 if (gdbarch_debug >= 2)
2980 fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
2981 return gdbarch->vbit_in_delta;
2985 set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
2988 gdbarch->vbit_in_delta = vbit_in_delta;
2992 gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
2994 gdb_assert (gdbarch != NULL);
2995 return gdbarch->skip_permanent_breakpoint != NULL;
2999 gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
3001 gdb_assert (gdbarch != NULL);
3002 gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
3003 if (gdbarch_debug >= 2)
3004 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
3005 gdbarch->skip_permanent_breakpoint (regcache);
3009 set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
3010 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
3012 gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
3016 gdbarch_overlay_update_p (struct gdbarch *gdbarch)
3018 gdb_assert (gdbarch != NULL);
3019 return gdbarch->overlay_update != NULL;
3023 gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
3025 gdb_assert (gdbarch != NULL);
3026 gdb_assert (gdbarch->overlay_update != NULL);
3027 if (gdbarch_debug >= 2)
3028 fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
3029 gdbarch->overlay_update (osect);
3033 set_gdbarch_overlay_update (struct gdbarch *gdbarch,
3034 gdbarch_overlay_update_ftype overlay_update)
3036 gdbarch->overlay_update = overlay_update;
3040 /* Keep a registry of per-architecture data-pointers required by GDB
3047 gdbarch_data_pre_init_ftype *pre_init;
3048 gdbarch_data_post_init_ftype *post_init;
3051 struct gdbarch_data_registration
3053 struct gdbarch_data *data;
3054 struct gdbarch_data_registration *next;
3057 struct gdbarch_data_registry
3060 struct gdbarch_data_registration *registrations;
3063 struct gdbarch_data_registry gdbarch_data_registry =
3068 static struct gdbarch_data *
3069 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3070 gdbarch_data_post_init_ftype *post_init)
3072 struct gdbarch_data_registration **curr;
3073 /* Append the new registraration. */
3074 for (curr = &gdbarch_data_registry.registrations;
3076 curr = &(*curr)->next);
3077 (*curr) = XMALLOC (struct gdbarch_data_registration);
3078 (*curr)->next = NULL;
3079 (*curr)->data = XMALLOC (struct gdbarch_data);
3080 (*curr)->data->index = gdbarch_data_registry.nr++;
3081 (*curr)->data->pre_init = pre_init;
3082 (*curr)->data->post_init = post_init;
3083 (*curr)->data->init_p = 1;
3084 return (*curr)->data;
3087 struct gdbarch_data *
3088 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3090 return gdbarch_data_register (pre_init, NULL);
3093 struct gdbarch_data *
3094 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3096 return gdbarch_data_register (NULL, post_init);
3099 /* Create/delete the gdbarch data vector. */
3102 alloc_gdbarch_data (struct gdbarch *gdbarch)
3104 gdb_assert (gdbarch->data == NULL);
3105 gdbarch->nr_data = gdbarch_data_registry.nr;
3106 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3109 /* Initialize the current value of the specified per-architecture
3113 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3114 struct gdbarch_data *data,
3117 gdb_assert (data->index < gdbarch->nr_data);
3118 gdb_assert (gdbarch->data[data->index] == NULL);
3119 gdb_assert (data->pre_init == NULL);
3120 gdbarch->data[data->index] = pointer;
3123 /* Return the current value of the specified per-architecture
3127 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3129 gdb_assert (data->index < gdbarch->nr_data);
3130 if (gdbarch->data[data->index] == NULL)
3132 /* The data-pointer isn't initialized, call init() to get a
3134 if (data->pre_init != NULL)
3135 /* Mid architecture creation: pass just the obstack, and not
3136 the entire architecture, as that way it isn't possible for
3137 pre-init code to refer to undefined architecture
3139 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3140 else if (gdbarch->initialized_p
3141 && data->post_init != NULL)
3142 /* Post architecture creation: pass the entire architecture
3143 (as all fields are valid), but be careful to also detect
3144 recursive references. */
3146 gdb_assert (data->init_p);
3148 gdbarch->data[data->index] = data->post_init (gdbarch);
3152 /* The architecture initialization hasn't completed - punt -
3153 hope that the caller knows what they are doing. Once
3154 deprecated_set_gdbarch_data has been initialized, this can be
3155 changed to an internal error. */
3157 gdb_assert (gdbarch->data[data->index] != NULL);
3159 return gdbarch->data[data->index];
3164 /* Keep a registry of swapped data required by GDB modules. */
3169 struct gdbarch_swap_registration *source;
3170 struct gdbarch_swap *next;
3173 struct gdbarch_swap_registration
3176 unsigned long sizeof_data;
3177 gdbarch_swap_ftype *init;
3178 struct gdbarch_swap_registration *next;
3181 struct gdbarch_swap_registry
3184 struct gdbarch_swap_registration *registrations;
3187 struct gdbarch_swap_registry gdbarch_swap_registry =
3193 deprecated_register_gdbarch_swap (void *data,
3194 unsigned long sizeof_data,
3195 gdbarch_swap_ftype *init)
3197 struct gdbarch_swap_registration **rego;
3198 for (rego = &gdbarch_swap_registry.registrations;
3200 rego = &(*rego)->next);
3201 (*rego) = XMALLOC (struct gdbarch_swap_registration);
3202 (*rego)->next = NULL;
3203 (*rego)->init = init;
3204 (*rego)->data = data;
3205 (*rego)->sizeof_data = sizeof_data;
3209 current_gdbarch_swap_init_hack (void)
3211 struct gdbarch_swap_registration *rego;
3212 struct gdbarch_swap **curr = ¤t_gdbarch->swap;
3213 for (rego = gdbarch_swap_registry.registrations;
3217 if (rego->data != NULL)
3219 (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch,
3220 struct gdbarch_swap);
3221 (*curr)->source = rego;
3222 (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch,
3224 (*curr)->next = NULL;
3225 curr = &(*curr)->next;
3227 if (rego->init != NULL)
3232 static struct gdbarch *
3233 current_gdbarch_swap_out_hack (void)
3235 struct gdbarch *old_gdbarch = current_gdbarch;
3236 struct gdbarch_swap *curr;
3238 gdb_assert (old_gdbarch != NULL);
3239 for (curr = old_gdbarch->swap;
3243 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
3244 memset (curr->source->data, 0, curr->source->sizeof_data);
3246 current_gdbarch = NULL;
3251 current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch)
3253 struct gdbarch_swap *curr;
3255 gdb_assert (current_gdbarch == NULL);
3256 for (curr = new_gdbarch->swap;
3259 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
3260 current_gdbarch = new_gdbarch;
3264 /* Keep a registry of the architectures known by GDB. */
3266 struct gdbarch_registration
3268 enum bfd_architecture bfd_architecture;
3269 gdbarch_init_ftype *init;
3270 gdbarch_dump_tdep_ftype *dump_tdep;
3271 struct gdbarch_list *arches;
3272 struct gdbarch_registration *next;
3275 static struct gdbarch_registration *gdbarch_registry = NULL;
3278 append_name (const char ***buf, int *nr, const char *name)
3280 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3286 gdbarch_printable_names (void)
3288 /* Accumulate a list of names based on the registed list of
3290 enum bfd_architecture a;
3292 const char **arches = NULL;
3293 struct gdbarch_registration *rego;
3294 for (rego = gdbarch_registry;
3298 const struct bfd_arch_info *ap;
3299 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3301 internal_error (__FILE__, __LINE__,
3302 _("gdbarch_architecture_names: multi-arch unknown"));
3305 append_name (&arches, &nr_arches, ap->printable_name);
3310 append_name (&arches, &nr_arches, NULL);
3316 gdbarch_register (enum bfd_architecture bfd_architecture,
3317 gdbarch_init_ftype *init,
3318 gdbarch_dump_tdep_ftype *dump_tdep)
3320 struct gdbarch_registration **curr;
3321 const struct bfd_arch_info *bfd_arch_info;
3322 /* Check that BFD recognizes this architecture */
3323 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3324 if (bfd_arch_info == NULL)
3326 internal_error (__FILE__, __LINE__,
3327 _("gdbarch: Attempt to register unknown architecture (%d)"),
3330 /* Check that we haven't seen this architecture before */
3331 for (curr = &gdbarch_registry;
3333 curr = &(*curr)->next)
3335 if (bfd_architecture == (*curr)->bfd_architecture)
3336 internal_error (__FILE__, __LINE__,
3337 _("gdbarch: Duplicate registraration of architecture (%s)"),
3338 bfd_arch_info->printable_name);
3342 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
3343 bfd_arch_info->printable_name,
3346 (*curr) = XMALLOC (struct gdbarch_registration);
3347 (*curr)->bfd_architecture = bfd_architecture;
3348 (*curr)->init = init;
3349 (*curr)->dump_tdep = dump_tdep;
3350 (*curr)->arches = NULL;
3351 (*curr)->next = NULL;
3355 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3356 gdbarch_init_ftype *init)
3358 gdbarch_register (bfd_architecture, init, NULL);
3362 /* Look for an architecture using gdbarch_info. */
3364 struct gdbarch_list *
3365 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
3366 const struct gdbarch_info *info)
3368 for (; arches != NULL; arches = arches->next)
3370 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
3372 if (info->byte_order != arches->gdbarch->byte_order)
3374 if (info->osabi != arches->gdbarch->osabi)
3376 if (info->target_desc != arches->gdbarch->target_desc)
3384 /* Find an architecture that matches the specified INFO. Create a new
3385 architecture if needed. Return that new architecture. Assumes
3386 that there is no current architecture. */
3388 static struct gdbarch *
3389 find_arch_by_info (struct gdbarch_info info)
3391 struct gdbarch *new_gdbarch;
3392 struct gdbarch_registration *rego;
3394 /* The existing architecture has been swapped out - all this code
3395 works from a clean slate. */
3396 gdb_assert (current_gdbarch == NULL);
3398 /* Fill in missing parts of the INFO struct using a number of
3399 sources: "set ..."; INFOabfd supplied; and the global
3401 gdbarch_info_fill (&info);
3403 /* Must have found some sort of architecture. */
3404 gdb_assert (info.bfd_arch_info != NULL);
3408 fprintf_unfiltered (gdb_stdlog,
3409 "find_arch_by_info: info.bfd_arch_info %s\n",
3410 (info.bfd_arch_info != NULL
3411 ? info.bfd_arch_info->printable_name
3413 fprintf_unfiltered (gdb_stdlog,
3414 "find_arch_by_info: info.byte_order %d (%s)\n",
3416 (info.byte_order == BFD_ENDIAN_BIG ? "big"
3417 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
3419 fprintf_unfiltered (gdb_stdlog,
3420 "find_arch_by_info: info.osabi %d (%s)\n",
3421 info.osabi, gdbarch_osabi_name (info.osabi));
3422 fprintf_unfiltered (gdb_stdlog,
3423 "find_arch_by_info: info.abfd 0x%lx\n",
3425 fprintf_unfiltered (gdb_stdlog,
3426 "find_arch_by_info: info.tdep_info 0x%lx\n",
3427 (long) info.tdep_info);
3430 /* Find the tdep code that knows about this architecture. */
3431 for (rego = gdbarch_registry;
3434 if (rego->bfd_architecture == info.bfd_arch_info->arch)
3439 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3440 "No matching architecture\n");
3444 /* Ask the tdep code for an architecture that matches "info". */
3445 new_gdbarch = rego->init (info, rego->arches);
3447 /* Did the tdep code like it? No. Reject the change and revert to
3448 the old architecture. */
3449 if (new_gdbarch == NULL)
3452 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3453 "Target rejected architecture\n");
3457 /* Is this a pre-existing architecture (as determined by already
3458 being initialized)? Move it to the front of the architecture
3459 list (keeping the list sorted Most Recently Used). */
3460 if (new_gdbarch->initialized_p)
3462 struct gdbarch_list **list;
3463 struct gdbarch_list *this;
3465 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3466 "Previous architecture 0x%08lx (%s) selected\n",
3468 new_gdbarch->bfd_arch_info->printable_name);
3469 /* Find the existing arch in the list. */
3470 for (list = ®o->arches;
3471 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
3472 list = &(*list)->next);
3473 /* It had better be in the list of architectures. */
3474 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
3477 (*list) = this->next;
3478 /* Insert THIS at the front. */
3479 this->next = rego->arches;
3480 rego->arches = this;
3485 /* It's a new architecture. */
3487 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3488 "New architecture 0x%08lx (%s) selected\n",
3490 new_gdbarch->bfd_arch_info->printable_name);
3492 /* Insert the new architecture into the front of the architecture
3493 list (keep the list sorted Most Recently Used). */
3495 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
3496 this->next = rego->arches;
3497 this->gdbarch = new_gdbarch;
3498 rego->arches = this;
3501 /* Check that the newly installed architecture is valid. Plug in
3502 any post init values. */
3503 new_gdbarch->dump_tdep = rego->dump_tdep;
3504 verify_gdbarch (new_gdbarch);
3505 new_gdbarch->initialized_p = 1;
3507 /* Initialize any per-architecture swap areas. This phase requires
3508 a valid global CURRENT_GDBARCH. Set it momentarially, and then
3509 swap the entire architecture out. */
3510 current_gdbarch = new_gdbarch;
3511 current_gdbarch_swap_init_hack ();
3512 current_gdbarch_swap_out_hack ();
3515 gdbarch_dump (new_gdbarch, gdb_stdlog);
3521 gdbarch_find_by_info (struct gdbarch_info info)
3523 /* Save the previously selected architecture, setting the global to
3524 NULL. This stops things like gdbarch->init() trying to use the
3525 previous architecture's configuration. The previous architecture
3526 may not even be of the same architecture family. The most recent
3527 architecture of the same family is found at the head of the
3528 rego->arches list. */
3529 struct gdbarch *old_gdbarch = current_gdbarch_swap_out_hack ();
3531 /* Find the specified architecture. */
3532 struct gdbarch *new_gdbarch = find_arch_by_info (info);
3534 /* Restore the existing architecture. */
3535 gdb_assert (current_gdbarch == NULL);
3536 current_gdbarch_swap_in_hack (old_gdbarch);
3541 /* Make the specified architecture current, swapping the existing one
3545 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
3547 gdb_assert (new_gdbarch != NULL);
3548 gdb_assert (current_gdbarch != NULL);
3549 gdb_assert (new_gdbarch->initialized_p);
3550 current_gdbarch_swap_out_hack ();
3551 current_gdbarch_swap_in_hack (new_gdbarch);
3552 architecture_changed_event ();
3553 reinit_frame_cache ();
3556 extern void _initialize_gdbarch (void);
3559 _initialize_gdbarch (void)
3561 struct cmd_list_element *c;
3563 add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
3564 Set architecture debugging."), _("\
3565 Show architecture debugging."), _("\
3566 When non-zero, architecture debugging is enabled."),
3569 &setdebuglist, &showdebuglist);