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;
149 gdbarch_read_pc_ftype *read_pc;
150 gdbarch_write_pc_ftype *write_pc;
151 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
152 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
153 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
160 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
161 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
162 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
163 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
164 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
165 gdbarch_register_name_ftype *register_name;
166 gdbarch_register_type_ftype *register_type;
167 gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
168 int deprecated_fp_regnum;
169 gdbarch_push_dummy_call_ftype *push_dummy_call;
170 int deprecated_register_size;
171 int call_dummy_location;
172 gdbarch_push_dummy_code_ftype *push_dummy_code;
173 gdbarch_print_registers_info_ftype *print_registers_info;
174 gdbarch_print_float_info_ftype *print_float_info;
175 gdbarch_print_vector_info_ftype *print_vector_info;
176 gdbarch_register_sim_regno_ftype *register_sim_regno;
177 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
178 gdbarch_cannot_store_register_ftype *cannot_store_register;
179 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
180 int believe_pcc_promotion;
181 gdbarch_convert_register_p_ftype *convert_register_p;
182 gdbarch_register_to_value_ftype *register_to_value;
183 gdbarch_value_to_register_ftype *value_to_register;
184 gdbarch_value_from_register_ftype *value_from_register;
185 gdbarch_pointer_to_address_ftype *pointer_to_address;
186 gdbarch_address_to_pointer_ftype *address_to_pointer;
187 gdbarch_integer_to_address_ftype *integer_to_address;
188 gdbarch_return_value_ftype *return_value;
189 gdbarch_extract_return_value_ftype *extract_return_value;
190 gdbarch_store_return_value_ftype *store_return_value;
191 gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
192 gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
193 gdbarch_skip_prologue_ftype *skip_prologue;
194 gdbarch_inner_than_ftype *inner_than;
195 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
196 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
197 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
198 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
199 CORE_ADDR decr_pc_after_break;
200 CORE_ADDR deprecated_function_start_offset;
201 gdbarch_remote_register_number_ftype *remote_register_number;
202 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
203 CORE_ADDR frame_args_skip;
204 gdbarch_unwind_pc_ftype *unwind_pc;
205 gdbarch_unwind_sp_ftype *unwind_sp;
206 gdbarch_frame_num_args_ftype *frame_num_args;
207 gdbarch_frame_align_ftype *frame_align;
208 gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr;
209 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
210 int frame_red_zone_size;
211 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
212 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
213 gdbarch_smash_text_address_ftype *smash_text_address;
214 gdbarch_software_single_step_ftype *software_single_step;
215 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
216 gdbarch_print_insn_ftype *print_insn;
217 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
218 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
219 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
220 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
221 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
222 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
223 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
224 const char * name_of_malloc;
225 int cannot_step_breakpoint;
226 int have_nonsteppable_watchpoint;
227 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
228 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
229 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
230 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
231 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
232 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
233 int vtable_function_descriptors;
235 gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
236 gdbarch_overlay_update_ftype *overlay_update;
240 /* The default architecture uses host values (for want of a better
243 extern const struct bfd_arch_info bfd_default_arch_struct;
245 struct gdbarch startup_gdbarch =
247 1, /* Always initialized. */
248 NULL, /* The obstack. */
249 /* basic architecture information */
250 &bfd_default_arch_struct, /* bfd_arch_info */
251 BFD_ENDIAN_BIG, /* byte_order */
252 GDB_OSABI_UNKNOWN, /* osabi */
254 /* target specific vector and its dump routine */
256 /*per-architecture data-pointers and swap regions */
258 /* Multi-arch values */
259 8 * sizeof (short), /* short_bit */
260 8 * sizeof (int), /* int_bit */
261 8 * sizeof (long), /* long_bit */
262 8 * sizeof (LONGEST), /* long_long_bit */
263 8 * sizeof (float), /* float_bit */
264 0, /* float_format */
265 8 * sizeof (double), /* double_bit */
266 0, /* double_format */
267 8 * sizeof (long double), /* long_double_bit */
268 0, /* long_double_format */
269 8 * sizeof (void*), /* ptr_bit */
270 8 * sizeof (void*), /* addr_bit */
271 8 * sizeof (void*), /* bfd_vma_bit */
275 0, /* virtual_frame_pointer */
276 0, /* pseudo_register_read */
277 0, /* pseudo_register_write */
279 0, /* num_pseudo_regs */
284 0, /* stab_reg_to_regnum */
285 0, /* ecoff_reg_to_regnum */
286 0, /* dwarf_reg_to_regnum */
287 0, /* sdb_reg_to_regnum */
288 0, /* dwarf2_reg_to_regnum */
289 0, /* register_name */
290 0, /* register_type */
291 0, /* unwind_dummy_id */
292 -1, /* deprecated_fp_regnum */
293 0, /* push_dummy_call */
294 0, /* deprecated_register_size */
295 0, /* call_dummy_location */
296 0, /* push_dummy_code */
297 default_print_registers_info, /* print_registers_info */
298 0, /* print_float_info */
299 0, /* print_vector_info */
300 0, /* register_sim_regno */
301 0, /* cannot_fetch_register */
302 0, /* cannot_store_register */
303 0, /* get_longjmp_target */
304 0, /* believe_pcc_promotion */
305 0, /* convert_register_p */
306 0, /* register_to_value */
307 0, /* value_to_register */
308 0, /* value_from_register */
309 0, /* pointer_to_address */
310 0, /* address_to_pointer */
311 0, /* integer_to_address */
312 0, /* return_value */
313 0, /* extract_return_value */
314 0, /* store_return_value */
315 0, /* deprecated_use_struct_convention */
316 0, /* deprecated_extract_struct_value_address */
317 0, /* skip_prologue */
319 0, /* breakpoint_from_pc */
320 0, /* adjust_breakpoint_address */
321 0, /* memory_insert_breakpoint */
322 0, /* memory_remove_breakpoint */
323 0, /* decr_pc_after_break */
324 0, /* deprecated_function_start_offset */
325 default_remote_register_number, /* remote_register_number */
326 0, /* fetch_tls_load_module_address */
327 0, /* frame_args_skip */
330 0, /* frame_num_args */
332 0, /* deprecated_reg_struct_has_addr */
333 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
334 0, /* frame_red_zone_size */
335 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
336 0, /* addr_bits_remove */
337 0, /* smash_text_address */
338 0, /* software_single_step */
339 0, /* single_step_through_delay */
341 0, /* skip_trampoline_code */
342 generic_skip_solib_resolver, /* skip_solib_resolver */
343 0, /* in_solib_return_trampoline */
344 generic_in_function_epilogue_p, /* in_function_epilogue_p */
345 construct_inferior_arguments, /* construct_inferior_arguments */
346 0, /* elf_make_msymbol_special */
347 0, /* coff_make_msymbol_special */
348 "malloc", /* name_of_malloc */
349 0, /* cannot_step_breakpoint */
350 0, /* have_nonsteppable_watchpoint */
351 0, /* address_class_type_flags */
352 0, /* address_class_type_flags_to_name */
353 0, /* address_class_name_to_type_flags */
354 default_register_reggroup_p, /* register_reggroup_p */
355 0, /* fetch_pointer_argument */
356 0, /* regset_from_core_section */
357 0, /* vtable_function_descriptors */
358 0, /* vbit_in_delta */
359 0, /* skip_permanent_breakpoint */
360 0, /* overlay_update */
361 /* startup_gdbarch() */
364 struct gdbarch *current_gdbarch = &startup_gdbarch;
366 /* Create a new ``struct gdbarch'' based on information provided by
367 ``struct gdbarch_info''. */
370 gdbarch_alloc (const struct gdbarch_info *info,
371 struct gdbarch_tdep *tdep)
373 /* NOTE: The new architecture variable is named ``current_gdbarch''
374 so that macros such as TARGET_ARCHITECTURE, when expanded, refer to
375 the current local architecture and not the previous global
376 architecture. This ensures that the new architectures initial
377 values are not influenced by the previous architecture. Once
378 everything is parameterised with gdbarch, this will go away. */
379 struct gdbarch *current_gdbarch;
381 /* Create an obstack for allocating all the per-architecture memory,
382 then use that to allocate the architecture vector. */
383 struct obstack *obstack = XMALLOC (struct obstack);
384 obstack_init (obstack);
385 current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch));
386 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
387 current_gdbarch->obstack = obstack;
389 alloc_gdbarch_data (current_gdbarch);
391 current_gdbarch->tdep = tdep;
393 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
394 current_gdbarch->byte_order = info->byte_order;
395 current_gdbarch->osabi = info->osabi;
396 current_gdbarch->target_desc = info->target_desc;
398 /* Force the explicit initialization of these. */
399 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
400 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
401 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
402 current_gdbarch->long_long_bit = 2*current_gdbarch->long_bit;
403 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
404 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
405 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
406 current_gdbarch->ptr_bit = current_gdbarch->int_bit;
407 current_gdbarch->bfd_vma_bit = gdbarch_bfd_arch_info (current_gdbarch)->bits_per_address;
408 current_gdbarch->char_signed = -1;
409 current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
410 current_gdbarch->num_regs = -1;
411 current_gdbarch->sp_regnum = -1;
412 current_gdbarch->pc_regnum = -1;
413 current_gdbarch->ps_regnum = -1;
414 current_gdbarch->fp0_regnum = -1;
415 current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
416 current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
417 current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
418 current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
419 current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
420 current_gdbarch->deprecated_fp_regnum = -1;
421 current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
422 current_gdbarch->print_registers_info = default_print_registers_info;
423 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
424 current_gdbarch->cannot_fetch_register = cannot_register_not;
425 current_gdbarch->cannot_store_register = cannot_register_not;
426 current_gdbarch->convert_register_p = generic_convert_register_p;
427 current_gdbarch->value_from_register = default_value_from_register;
428 current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
429 current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
430 current_gdbarch->return_value = legacy_return_value;
431 current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
432 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
433 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
434 current_gdbarch->remote_register_number = default_remote_register_number;
435 current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
436 current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
437 current_gdbarch->addr_bits_remove = core_addr_identity;
438 current_gdbarch->smash_text_address = core_addr_identity;
439 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
440 current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
441 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
442 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
443 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
444 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
445 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
446 current_gdbarch->name_of_malloc = "malloc";
447 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
448 /* gdbarch_alloc() */
450 return current_gdbarch;
454 /* Allocate extra space using the per-architecture obstack. */
457 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
459 void *data = obstack_alloc (arch->obstack, size);
460 memset (data, 0, size);
465 /* Free a gdbarch struct. This should never happen in normal
466 operation --- once you've created a gdbarch, you keep it around.
467 However, if an architecture's init function encounters an error
468 building the structure, it may need to clean up a partially
469 constructed gdbarch. */
472 gdbarch_free (struct gdbarch *arch)
474 struct obstack *obstack;
475 gdb_assert (arch != NULL);
476 gdb_assert (!arch->initialized_p);
477 obstack = arch->obstack;
478 obstack_free (obstack, 0); /* Includes the ARCH. */
483 /* Ensure that all values in a GDBARCH are reasonable. */
485 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
486 just happens to match the global variable ``current_gdbarch''. That
487 way macros refering to that variable get the local and not the global
488 version - ulgh. Once everything is parameterised with gdbarch, this
492 verify_gdbarch (struct gdbarch *current_gdbarch)
495 struct cleanup *cleanups;
498 log = mem_fileopen ();
499 cleanups = make_cleanup_ui_file_delete (log);
501 if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
502 fprintf_unfiltered (log, "\n\tbyte-order");
503 if (current_gdbarch->bfd_arch_info == NULL)
504 fprintf_unfiltered (log, "\n\tbfd_arch_info");
505 /* Check those that need to be defined for the given multi-arch level. */
506 /* Skip verify of short_bit, invalid_p == 0 */
507 /* Skip verify of int_bit, invalid_p == 0 */
508 /* Skip verify of long_bit, invalid_p == 0 */
509 /* Skip verify of long_long_bit, invalid_p == 0 */
510 /* Skip verify of float_bit, invalid_p == 0 */
511 if (current_gdbarch->float_format == 0)
512 current_gdbarch->float_format = floatformats_ieee_single;
513 /* Skip verify of double_bit, invalid_p == 0 */
514 if (current_gdbarch->double_format == 0)
515 current_gdbarch->double_format = floatformats_ieee_double;
516 /* Skip verify of long_double_bit, invalid_p == 0 */
517 if (current_gdbarch->long_double_format == 0)
518 current_gdbarch->long_double_format = floatformats_ieee_double;
519 /* Skip verify of ptr_bit, invalid_p == 0 */
520 if (current_gdbarch->addr_bit == 0)
521 current_gdbarch->addr_bit = gdbarch_ptr_bit (current_gdbarch);
522 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
523 if (current_gdbarch->char_signed == -1)
524 current_gdbarch->char_signed = 1;
525 /* Skip verify of read_pc, has predicate */
526 /* Skip verify of write_pc, has predicate */
527 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
528 /* Skip verify of pseudo_register_read, has predicate */
529 /* Skip verify of pseudo_register_write, has predicate */
530 if (current_gdbarch->num_regs == -1)
531 fprintf_unfiltered (log, "\n\tnum_regs");
532 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
533 /* Skip verify of sp_regnum, invalid_p == 0 */
534 /* Skip verify of pc_regnum, invalid_p == 0 */
535 /* Skip verify of ps_regnum, invalid_p == 0 */
536 /* Skip verify of fp0_regnum, invalid_p == 0 */
537 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
538 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
539 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
540 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
541 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
542 /* Skip verify of register_type, has predicate */
543 /* Skip verify of unwind_dummy_id, has predicate */
544 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
545 /* Skip verify of push_dummy_call, has predicate */
546 /* Skip verify of call_dummy_location, invalid_p == 0 */
547 /* Skip verify of push_dummy_code, has predicate */
548 /* Skip verify of print_registers_info, invalid_p == 0 */
549 /* Skip verify of print_float_info, has predicate */
550 /* Skip verify of print_vector_info, has predicate */
551 /* Skip verify of register_sim_regno, invalid_p == 0 */
552 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
553 /* Skip verify of cannot_store_register, invalid_p == 0 */
554 /* Skip verify of get_longjmp_target, has predicate */
555 /* Skip verify of convert_register_p, invalid_p == 0 */
556 /* Skip verify of value_from_register, invalid_p == 0 */
557 /* Skip verify of pointer_to_address, invalid_p == 0 */
558 /* Skip verify of address_to_pointer, invalid_p == 0 */
559 /* Skip verify of integer_to_address, has predicate */
560 /* Skip verify of return_value, has predicate */
561 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
562 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
563 if (current_gdbarch->skip_prologue == 0)
564 fprintf_unfiltered (log, "\n\tskip_prologue");
565 if (current_gdbarch->inner_than == 0)
566 fprintf_unfiltered (log, "\n\tinner_than");
567 if (current_gdbarch->breakpoint_from_pc == 0)
568 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
569 /* Skip verify of adjust_breakpoint_address, has predicate */
570 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
571 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
572 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
573 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
574 /* Skip verify of remote_register_number, invalid_p == 0 */
575 /* Skip verify of fetch_tls_load_module_address, has predicate */
576 /* Skip verify of frame_args_skip, invalid_p == 0 */
577 /* Skip verify of unwind_pc, has predicate */
578 /* Skip verify of unwind_sp, has predicate */
579 /* Skip verify of frame_num_args, has predicate */
580 /* Skip verify of frame_align, has predicate */
581 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
582 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
583 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
584 /* Skip verify of addr_bits_remove, invalid_p == 0 */
585 /* Skip verify of smash_text_address, invalid_p == 0 */
586 /* Skip verify of software_single_step, has predicate */
587 /* Skip verify of single_step_through_delay, has predicate */
588 if (current_gdbarch->print_insn == 0)
589 fprintf_unfiltered (log, "\n\tprint_insn");
590 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
591 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
592 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
593 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
594 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
595 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
596 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
597 /* Skip verify of name_of_malloc, invalid_p == 0 */
598 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
599 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
600 /* Skip verify of address_class_type_flags, has predicate */
601 /* Skip verify of address_class_type_flags_to_name, has predicate */
602 /* Skip verify of address_class_name_to_type_flags, has predicate */
603 /* Skip verify of register_reggroup_p, invalid_p == 0 */
604 /* Skip verify of fetch_pointer_argument, has predicate */
605 /* Skip verify of regset_from_core_section, has predicate */
606 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
607 /* Skip verify of vbit_in_delta, invalid_p == 0 */
608 /* Skip verify of skip_permanent_breakpoint, has predicate */
609 /* Skip verify of overlay_update, has predicate */
610 buf = ui_file_xstrdup (log, &dummy);
611 make_cleanup (xfree, buf);
612 if (strlen (buf) > 0)
613 internal_error (__FILE__, __LINE__,
614 _("verify_gdbarch: the following are invalid ...%s"),
616 do_cleanups (cleanups);
620 /* Print out the details of the current architecture. */
622 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
623 just happens to match the global variable ``current_gdbarch''. That
624 way macros refering to that variable get the local and not the global
625 version - ulgh. Once everything is parameterised with gdbarch, this
629 gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
631 const char *gdb_xm_file = "<not-defined>";
632 const char *gdb_nm_file = "<not-defined>";
633 const char *gdb_tm_file = "<not-defined>";
634 #if defined (GDB_XM_FILE)
635 gdb_xm_file = GDB_XM_FILE;
637 fprintf_unfiltered (file,
638 "gdbarch_dump: GDB_XM_FILE = %s\n",
640 #if defined (GDB_NM_FILE)
641 gdb_nm_file = GDB_NM_FILE;
643 fprintf_unfiltered (file,
644 "gdbarch_dump: GDB_NM_FILE = %s\n",
646 #if defined (GDB_TM_FILE)
647 gdb_tm_file = GDB_TM_FILE;
649 fprintf_unfiltered (file,
650 "gdbarch_dump: GDB_TM_FILE = %s\n",
652 fprintf_unfiltered (file,
653 "gdbarch_dump: addr_bit = %s\n",
654 paddr_d (current_gdbarch->addr_bit));
655 fprintf_unfiltered (file,
656 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
657 (long) current_gdbarch->addr_bits_remove);
658 fprintf_unfiltered (file,
659 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
660 gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
661 fprintf_unfiltered (file,
662 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
663 (long) current_gdbarch->address_class_name_to_type_flags);
664 fprintf_unfiltered (file,
665 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
666 gdbarch_address_class_type_flags_p (current_gdbarch));
667 fprintf_unfiltered (file,
668 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
669 (long) current_gdbarch->address_class_type_flags);
670 fprintf_unfiltered (file,
671 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
672 gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
673 fprintf_unfiltered (file,
674 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
675 (long) current_gdbarch->address_class_type_flags_to_name);
676 fprintf_unfiltered (file,
677 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
678 (long) current_gdbarch->address_to_pointer);
679 fprintf_unfiltered (file,
680 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
681 gdbarch_adjust_breakpoint_address_p (current_gdbarch));
682 fprintf_unfiltered (file,
683 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
684 (long) current_gdbarch->adjust_breakpoint_address);
685 #ifdef BELIEVE_PCC_PROMOTION
686 fprintf_unfiltered (file,
687 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
688 XSTRING (BELIEVE_PCC_PROMOTION));
690 fprintf_unfiltered (file,
691 "gdbarch_dump: believe_pcc_promotion = %s\n",
692 paddr_d (current_gdbarch->believe_pcc_promotion));
693 fprintf_unfiltered (file,
694 "gdbarch_dump: bfd_arch_info = %s\n",
695 gdbarch_bfd_arch_info (current_gdbarch)->printable_name);
696 fprintf_unfiltered (file,
697 "gdbarch_dump: bfd_vma_bit = %s\n",
698 paddr_d (current_gdbarch->bfd_vma_bit));
699 fprintf_unfiltered (file,
700 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
701 (long) current_gdbarch->breakpoint_from_pc);
702 fprintf_unfiltered (file,
703 "gdbarch_dump: byte_order = %s\n",
704 paddr_d (current_gdbarch->byte_order));
705 fprintf_unfiltered (file,
706 "gdbarch_dump: call_dummy_location = %s\n",
707 paddr_d (current_gdbarch->call_dummy_location));
708 fprintf_unfiltered (file,
709 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
710 (long) current_gdbarch->cannot_fetch_register);
711 fprintf_unfiltered (file,
712 "gdbarch_dump: cannot_step_breakpoint = %s\n",
713 paddr_d (current_gdbarch->cannot_step_breakpoint));
714 fprintf_unfiltered (file,
715 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
716 (long) current_gdbarch->cannot_store_register);
717 fprintf_unfiltered (file,
718 "gdbarch_dump: char_signed = %s\n",
719 paddr_d (current_gdbarch->char_signed));
720 fprintf_unfiltered (file,
721 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
722 (long) current_gdbarch->coff_make_msymbol_special);
723 fprintf_unfiltered (file,
724 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
725 (long) current_gdbarch->construct_inferior_arguments);
726 fprintf_unfiltered (file,
727 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
728 (long) current_gdbarch->convert_from_func_ptr_addr);
729 fprintf_unfiltered (file,
730 "gdbarch_dump: convert_register_p = <0x%lx>\n",
731 (long) current_gdbarch->convert_register_p);
732 fprintf_unfiltered (file,
733 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
734 paddr_nz (current_gdbarch->decr_pc_after_break));
735 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
736 fprintf_unfiltered (file,
737 "gdbarch_dump: %s # %s\n",
738 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
739 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
741 fprintf_unfiltered (file,
742 "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
743 gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch));
744 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
745 fprintf_unfiltered (file,
746 "gdbarch_dump: %s # %s\n",
747 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
748 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
750 fprintf_unfiltered (file,
751 "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
752 (long) current_gdbarch->deprecated_extract_struct_value_address);
753 #ifdef DEPRECATED_FP_REGNUM
754 fprintf_unfiltered (file,
755 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
756 XSTRING (DEPRECATED_FP_REGNUM));
758 fprintf_unfiltered (file,
759 "gdbarch_dump: deprecated_fp_regnum = %s\n",
760 paddr_d (current_gdbarch->deprecated_fp_regnum));
761 #ifdef DEPRECATED_FUNCTION_START_OFFSET
762 fprintf_unfiltered (file,
763 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
764 XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
766 fprintf_unfiltered (file,
767 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
768 paddr_nz (current_gdbarch->deprecated_function_start_offset));
769 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
770 fprintf_unfiltered (file,
771 "gdbarch_dump: %s # %s\n",
772 "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
773 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
775 fprintf_unfiltered (file,
776 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
777 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch));
778 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
779 fprintf_unfiltered (file,
780 "gdbarch_dump: %s # %s\n",
781 "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
782 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
784 fprintf_unfiltered (file,
785 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
786 (long) current_gdbarch->deprecated_reg_struct_has_addr);
787 #ifdef DEPRECATED_REGISTER_SIZE
788 fprintf_unfiltered (file,
789 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
790 XSTRING (DEPRECATED_REGISTER_SIZE));
792 fprintf_unfiltered (file,
793 "gdbarch_dump: deprecated_register_size = %s\n",
794 paddr_d (current_gdbarch->deprecated_register_size));
795 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
796 fprintf_unfiltered (file,
797 "gdbarch_dump: %s # %s\n",
798 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
799 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type)));
801 fprintf_unfiltered (file,
802 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
803 (long) current_gdbarch->deprecated_use_struct_convention);
804 fprintf_unfiltered (file,
805 "gdbarch_dump: double_bit = %s\n",
806 paddr_d (current_gdbarch->double_bit));
807 fprintf_unfiltered (file,
808 "gdbarch_dump: double_format = %s\n",
809 pformat (current_gdbarch->double_format));
810 fprintf_unfiltered (file,
811 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
812 (long) current_gdbarch->dwarf2_reg_to_regnum);
813 fprintf_unfiltered (file,
814 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
815 (long) current_gdbarch->dwarf_reg_to_regnum);
816 fprintf_unfiltered (file,
817 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
818 (long) current_gdbarch->ecoff_reg_to_regnum);
819 fprintf_unfiltered (file,
820 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
821 (long) current_gdbarch->elf_make_msymbol_special);
822 #ifdef EXTRACT_RETURN_VALUE
823 fprintf_unfiltered (file,
824 "gdbarch_dump: %s # %s\n",
825 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
826 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
828 fprintf_unfiltered (file,
829 "gdbarch_dump: extract_return_value = <0x%lx>\n",
830 (long) current_gdbarch->extract_return_value);
831 fprintf_unfiltered (file,
832 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
833 gdbarch_fetch_pointer_argument_p (current_gdbarch));
834 fprintf_unfiltered (file,
835 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
836 (long) current_gdbarch->fetch_pointer_argument);
837 fprintf_unfiltered (file,
838 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
839 gdbarch_fetch_tls_load_module_address_p (current_gdbarch));
840 fprintf_unfiltered (file,
841 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
842 (long) current_gdbarch->fetch_tls_load_module_address);
843 fprintf_unfiltered (file,
844 "gdbarch_dump: float_bit = %s\n",
845 paddr_d (current_gdbarch->float_bit));
846 fprintf_unfiltered (file,
847 "gdbarch_dump: float_format = %s\n",
848 pformat (current_gdbarch->float_format));
850 fprintf_unfiltered (file,
851 "gdbarch_dump: FP0_REGNUM # %s\n",
852 XSTRING (FP0_REGNUM));
854 fprintf_unfiltered (file,
855 "gdbarch_dump: fp0_regnum = %s\n",
856 paddr_d (current_gdbarch->fp0_regnum));
857 fprintf_unfiltered (file,
858 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
859 gdbarch_frame_align_p (current_gdbarch));
860 fprintf_unfiltered (file,
861 "gdbarch_dump: frame_align = <0x%lx>\n",
862 (long) current_gdbarch->frame_align);
863 fprintf_unfiltered (file,
864 "gdbarch_dump: frame_args_skip = 0x%s\n",
865 paddr_nz (current_gdbarch->frame_args_skip));
866 fprintf_unfiltered (file,
867 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
868 gdbarch_frame_num_args_p (current_gdbarch));
869 fprintf_unfiltered (file,
870 "gdbarch_dump: frame_num_args = <0x%lx>\n",
871 (long) current_gdbarch->frame_num_args);
872 fprintf_unfiltered (file,
873 "gdbarch_dump: frame_red_zone_size = %s\n",
874 paddr_d (current_gdbarch->frame_red_zone_size));
875 fprintf_unfiltered (file,
876 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
877 gdbarch_get_longjmp_target_p (current_gdbarch));
878 fprintf_unfiltered (file,
879 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
880 (long) current_gdbarch->get_longjmp_target);
881 fprintf_unfiltered (file,
882 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
883 paddr_d (current_gdbarch->have_nonsteppable_watchpoint));
884 fprintf_unfiltered (file,
885 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
886 (long) current_gdbarch->in_function_epilogue_p);
887 fprintf_unfiltered (file,
888 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
889 (long) current_gdbarch->in_solib_return_trampoline);
890 fprintf_unfiltered (file,
891 "gdbarch_dump: inner_than = <0x%lx>\n",
892 (long) current_gdbarch->inner_than);
893 fprintf_unfiltered (file,
894 "gdbarch_dump: int_bit = %s\n",
895 paddr_d (current_gdbarch->int_bit));
896 fprintf_unfiltered (file,
897 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
898 gdbarch_integer_to_address_p (current_gdbarch));
899 fprintf_unfiltered (file,
900 "gdbarch_dump: integer_to_address = <0x%lx>\n",
901 (long) current_gdbarch->integer_to_address);
902 fprintf_unfiltered (file,
903 "gdbarch_dump: long_bit = %s\n",
904 paddr_d (current_gdbarch->long_bit));
905 fprintf_unfiltered (file,
906 "gdbarch_dump: long_double_bit = %s\n",
907 paddr_d (current_gdbarch->long_double_bit));
908 fprintf_unfiltered (file,
909 "gdbarch_dump: long_double_format = %s\n",
910 pformat (current_gdbarch->long_double_format));
911 fprintf_unfiltered (file,
912 "gdbarch_dump: long_long_bit = %s\n",
913 paddr_d (current_gdbarch->long_long_bit));
914 fprintf_unfiltered (file,
915 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
916 (long) current_gdbarch->memory_insert_breakpoint);
917 fprintf_unfiltered (file,
918 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
919 (long) current_gdbarch->memory_remove_breakpoint);
920 fprintf_unfiltered (file,
921 "gdbarch_dump: name_of_malloc = %s\n",
922 current_gdbarch->name_of_malloc);
923 fprintf_unfiltered (file,
924 "gdbarch_dump: num_pseudo_regs = %s\n",
925 paddr_d (current_gdbarch->num_pseudo_regs));
926 fprintf_unfiltered (file,
927 "gdbarch_dump: num_regs = %s\n",
928 paddr_d (current_gdbarch->num_regs));
929 fprintf_unfiltered (file,
930 "gdbarch_dump: osabi = %s\n",
931 paddr_d (current_gdbarch->osabi));
932 fprintf_unfiltered (file,
933 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
934 gdbarch_overlay_update_p (current_gdbarch));
935 fprintf_unfiltered (file,
936 "gdbarch_dump: overlay_update = <0x%lx>\n",
937 (long) current_gdbarch->overlay_update);
939 fprintf_unfiltered (file,
940 "gdbarch_dump: PC_REGNUM # %s\n",
941 XSTRING (PC_REGNUM));
943 fprintf_unfiltered (file,
944 "gdbarch_dump: pc_regnum = %s\n",
945 paddr_d (current_gdbarch->pc_regnum));
946 fprintf_unfiltered (file,
947 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
948 (long) current_gdbarch->pointer_to_address);
949 fprintf_unfiltered (file,
950 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
951 gdbarch_print_float_info_p (current_gdbarch));
952 fprintf_unfiltered (file,
953 "gdbarch_dump: print_float_info = <0x%lx>\n",
954 (long) current_gdbarch->print_float_info);
955 #ifdef TARGET_PRINT_INSN
956 fprintf_unfiltered (file,
957 "gdbarch_dump: %s # %s\n",
958 "TARGET_PRINT_INSN(vma, info)",
959 XSTRING (TARGET_PRINT_INSN (vma, info)));
961 fprintf_unfiltered (file,
962 "gdbarch_dump: print_insn = <0x%lx>\n",
963 (long) current_gdbarch->print_insn);
964 fprintf_unfiltered (file,
965 "gdbarch_dump: print_registers_info = <0x%lx>\n",
966 (long) current_gdbarch->print_registers_info);
967 fprintf_unfiltered (file,
968 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
969 gdbarch_print_vector_info_p (current_gdbarch));
970 fprintf_unfiltered (file,
971 "gdbarch_dump: print_vector_info = <0x%lx>\n",
972 (long) current_gdbarch->print_vector_info);
974 fprintf_unfiltered (file,
975 "gdbarch_dump: PS_REGNUM # %s\n",
976 XSTRING (PS_REGNUM));
978 fprintf_unfiltered (file,
979 "gdbarch_dump: ps_regnum = %s\n",
980 paddr_d (current_gdbarch->ps_regnum));
981 fprintf_unfiltered (file,
982 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
983 gdbarch_pseudo_register_read_p (current_gdbarch));
984 fprintf_unfiltered (file,
985 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
986 (long) current_gdbarch->pseudo_register_read);
987 fprintf_unfiltered (file,
988 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
989 gdbarch_pseudo_register_write_p (current_gdbarch));
990 fprintf_unfiltered (file,
991 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
992 (long) current_gdbarch->pseudo_register_write);
993 fprintf_unfiltered (file,
994 "gdbarch_dump: ptr_bit = %s\n",
995 paddr_d (current_gdbarch->ptr_bit));
996 fprintf_unfiltered (file,
997 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
998 gdbarch_push_dummy_call_p (current_gdbarch));
999 fprintf_unfiltered (file,
1000 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
1001 (long) current_gdbarch->push_dummy_call);
1002 fprintf_unfiltered (file,
1003 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1004 gdbarch_push_dummy_code_p (current_gdbarch));
1005 fprintf_unfiltered (file,
1006 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
1007 (long) current_gdbarch->push_dummy_code);
1008 fprintf_unfiltered (file,
1009 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1010 gdbarch_read_pc_p (current_gdbarch));
1011 fprintf_unfiltered (file,
1012 "gdbarch_dump: read_pc = <0x%lx>\n",
1013 (long) current_gdbarch->read_pc);
1014 fprintf_unfiltered (file,
1015 "gdbarch_dump: register_name = <0x%lx>\n",
1016 (long) current_gdbarch->register_name);
1017 fprintf_unfiltered (file,
1018 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
1019 (long) current_gdbarch->register_reggroup_p);
1020 fprintf_unfiltered (file,
1021 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
1022 (long) current_gdbarch->register_sim_regno);
1023 fprintf_unfiltered (file,
1024 "gdbarch_dump: register_to_value = <0x%lx>\n",
1025 (long) current_gdbarch->register_to_value);
1026 fprintf_unfiltered (file,
1027 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1028 gdbarch_register_type_p (current_gdbarch));
1029 fprintf_unfiltered (file,
1030 "gdbarch_dump: register_type = <0x%lx>\n",
1031 (long) current_gdbarch->register_type);
1032 fprintf_unfiltered (file,
1033 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1034 gdbarch_regset_from_core_section_p (current_gdbarch));
1035 fprintf_unfiltered (file,
1036 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
1037 (long) current_gdbarch->regset_from_core_section);
1038 fprintf_unfiltered (file,
1039 "gdbarch_dump: remote_register_number = <0x%lx>\n",
1040 (long) current_gdbarch->remote_register_number);
1041 fprintf_unfiltered (file,
1042 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1043 gdbarch_return_value_p (current_gdbarch));
1044 fprintf_unfiltered (file,
1045 "gdbarch_dump: return_value = <0x%lx>\n",
1046 (long) current_gdbarch->return_value);
1047 fprintf_unfiltered (file,
1048 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1049 (long) current_gdbarch->sdb_reg_to_regnum);
1050 fprintf_unfiltered (file,
1051 "gdbarch_dump: short_bit = %s\n",
1052 paddr_d (current_gdbarch->short_bit));
1053 fprintf_unfiltered (file,
1054 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1055 gdbarch_single_step_through_delay_p (current_gdbarch));
1056 fprintf_unfiltered (file,
1057 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
1058 (long) current_gdbarch->single_step_through_delay);
1059 fprintf_unfiltered (file,
1060 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1061 gdbarch_skip_permanent_breakpoint_p (current_gdbarch));
1062 fprintf_unfiltered (file,
1063 "gdbarch_dump: skip_permanent_breakpoint = <0x%lx>\n",
1064 (long) current_gdbarch->skip_permanent_breakpoint);
1065 fprintf_unfiltered (file,
1066 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1067 (long) current_gdbarch->skip_prologue);
1068 fprintf_unfiltered (file,
1069 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1070 (long) current_gdbarch->skip_solib_resolver);
1071 fprintf_unfiltered (file,
1072 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1073 (long) current_gdbarch->skip_trampoline_code);
1074 fprintf_unfiltered (file,
1075 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1076 (long) current_gdbarch->smash_text_address);
1077 #ifdef SOFTWARE_SINGLE_STEP_P
1078 fprintf_unfiltered (file,
1079 "gdbarch_dump: %s # %s\n",
1080 "SOFTWARE_SINGLE_STEP_P()",
1081 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1083 fprintf_unfiltered (file,
1084 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1085 gdbarch_software_single_step_p (current_gdbarch));
1086 #ifdef SOFTWARE_SINGLE_STEP
1087 fprintf_unfiltered (file,
1088 "gdbarch_dump: %s # %s\n",
1089 "SOFTWARE_SINGLE_STEP(frame)",
1090 XSTRING (SOFTWARE_SINGLE_STEP (frame)));
1092 fprintf_unfiltered (file,
1093 "gdbarch_dump: software_single_step = <0x%lx>\n",
1094 (long) current_gdbarch->software_single_step);
1096 fprintf_unfiltered (file,
1097 "gdbarch_dump: SP_REGNUM # %s\n",
1098 XSTRING (SP_REGNUM));
1100 fprintf_unfiltered (file,
1101 "gdbarch_dump: sp_regnum = %s\n",
1102 paddr_d (current_gdbarch->sp_regnum));
1103 fprintf_unfiltered (file,
1104 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1105 (long) current_gdbarch->stab_reg_to_regnum);
1106 fprintf_unfiltered (file,
1107 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1108 (long) current_gdbarch->stabs_argument_has_addr);
1109 #ifdef STORE_RETURN_VALUE
1110 fprintf_unfiltered (file,
1111 "gdbarch_dump: %s # %s\n",
1112 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1113 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
1115 fprintf_unfiltered (file,
1116 "gdbarch_dump: store_return_value = <0x%lx>\n",
1117 (long) current_gdbarch->store_return_value);
1118 fprintf_unfiltered (file,
1119 "gdbarch_dump: target_desc = %s\n",
1120 paddr_d ((long) current_gdbarch->target_desc));
1121 fprintf_unfiltered (file,
1122 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1123 gdbarch_unwind_dummy_id_p (current_gdbarch));
1124 fprintf_unfiltered (file,
1125 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1126 (long) current_gdbarch->unwind_dummy_id);
1127 fprintf_unfiltered (file,
1128 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1129 gdbarch_unwind_pc_p (current_gdbarch));
1130 fprintf_unfiltered (file,
1131 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1132 (long) current_gdbarch->unwind_pc);
1133 fprintf_unfiltered (file,
1134 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1135 gdbarch_unwind_sp_p (current_gdbarch));
1136 fprintf_unfiltered (file,
1137 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1138 (long) current_gdbarch->unwind_sp);
1139 fprintf_unfiltered (file,
1140 "gdbarch_dump: value_from_register = <0x%lx>\n",
1141 (long) current_gdbarch->value_from_register);
1142 fprintf_unfiltered (file,
1143 "gdbarch_dump: value_to_register = <0x%lx>\n",
1144 (long) current_gdbarch->value_to_register);
1145 fprintf_unfiltered (file,
1146 "gdbarch_dump: vbit_in_delta = %s\n",
1147 paddr_d (current_gdbarch->vbit_in_delta));
1148 fprintf_unfiltered (file,
1149 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1150 (long) current_gdbarch->virtual_frame_pointer);
1151 fprintf_unfiltered (file,
1152 "gdbarch_dump: vtable_function_descriptors = %s\n",
1153 paddr_d (current_gdbarch->vtable_function_descriptors));
1154 fprintf_unfiltered (file,
1155 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1156 gdbarch_write_pc_p (current_gdbarch));
1157 fprintf_unfiltered (file,
1158 "gdbarch_dump: write_pc = <0x%lx>\n",
1159 (long) current_gdbarch->write_pc);
1160 if (current_gdbarch->dump_tdep != NULL)
1161 current_gdbarch->dump_tdep (current_gdbarch, file);
1164 struct gdbarch_tdep *
1165 gdbarch_tdep (struct gdbarch *gdbarch)
1167 if (gdbarch_debug >= 2)
1168 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1169 return gdbarch->tdep;
1173 const struct bfd_arch_info *
1174 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1176 gdb_assert (gdbarch != NULL);
1177 if (gdbarch_debug >= 2)
1178 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1179 return gdbarch->bfd_arch_info;
1183 gdbarch_byte_order (struct gdbarch *gdbarch)
1185 gdb_assert (gdbarch != NULL);
1186 if (gdbarch_debug >= 2)
1187 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1188 return gdbarch->byte_order;
1192 gdbarch_osabi (struct gdbarch *gdbarch)
1194 gdb_assert (gdbarch != NULL);
1195 if (gdbarch_debug >= 2)
1196 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1197 return gdbarch->osabi;
1200 const struct target_desc *
1201 gdbarch_target_desc (struct gdbarch *gdbarch)
1203 gdb_assert (gdbarch != NULL);
1204 if (gdbarch_debug >= 2)
1205 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1206 return gdbarch->target_desc;
1210 gdbarch_short_bit (struct gdbarch *gdbarch)
1212 gdb_assert (gdbarch != NULL);
1213 /* Skip verify of short_bit, invalid_p == 0 */
1214 if (gdbarch_debug >= 2)
1215 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1216 return gdbarch->short_bit;
1220 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1223 gdbarch->short_bit = short_bit;
1227 gdbarch_int_bit (struct gdbarch *gdbarch)
1229 gdb_assert (gdbarch != NULL);
1230 /* Skip verify of int_bit, invalid_p == 0 */
1231 if (gdbarch_debug >= 2)
1232 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1233 return gdbarch->int_bit;
1237 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1240 gdbarch->int_bit = int_bit;
1244 gdbarch_long_bit (struct gdbarch *gdbarch)
1246 gdb_assert (gdbarch != NULL);
1247 /* Skip verify of long_bit, invalid_p == 0 */
1248 if (gdbarch_debug >= 2)
1249 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1250 return gdbarch->long_bit;
1254 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1257 gdbarch->long_bit = long_bit;
1261 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1263 gdb_assert (gdbarch != NULL);
1264 /* Skip verify of long_long_bit, invalid_p == 0 */
1265 if (gdbarch_debug >= 2)
1266 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1267 return gdbarch->long_long_bit;
1271 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1274 gdbarch->long_long_bit = long_long_bit;
1278 gdbarch_float_bit (struct gdbarch *gdbarch)
1280 gdb_assert (gdbarch != NULL);
1281 /* Skip verify of float_bit, invalid_p == 0 */
1282 if (gdbarch_debug >= 2)
1283 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1284 return gdbarch->float_bit;
1288 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1291 gdbarch->float_bit = float_bit;
1294 const struct floatformat **
1295 gdbarch_float_format (struct gdbarch *gdbarch)
1297 gdb_assert (gdbarch != NULL);
1298 if (gdbarch_debug >= 2)
1299 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1300 return gdbarch->float_format;
1304 set_gdbarch_float_format (struct gdbarch *gdbarch,
1305 const struct floatformat ** float_format)
1307 gdbarch->float_format = float_format;
1311 gdbarch_double_bit (struct gdbarch *gdbarch)
1313 gdb_assert (gdbarch != NULL);
1314 /* Skip verify of double_bit, invalid_p == 0 */
1315 if (gdbarch_debug >= 2)
1316 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1317 return gdbarch->double_bit;
1321 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1324 gdbarch->double_bit = double_bit;
1327 const struct floatformat **
1328 gdbarch_double_format (struct gdbarch *gdbarch)
1330 gdb_assert (gdbarch != NULL);
1331 if (gdbarch_debug >= 2)
1332 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1333 return gdbarch->double_format;
1337 set_gdbarch_double_format (struct gdbarch *gdbarch,
1338 const struct floatformat ** double_format)
1340 gdbarch->double_format = double_format;
1344 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1346 gdb_assert (gdbarch != NULL);
1347 /* Skip verify of long_double_bit, invalid_p == 0 */
1348 if (gdbarch_debug >= 2)
1349 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1350 return gdbarch->long_double_bit;
1354 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1355 int long_double_bit)
1357 gdbarch->long_double_bit = long_double_bit;
1360 const struct floatformat **
1361 gdbarch_long_double_format (struct gdbarch *gdbarch)
1363 gdb_assert (gdbarch != NULL);
1364 if (gdbarch_debug >= 2)
1365 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1366 return gdbarch->long_double_format;
1370 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1371 const struct floatformat ** long_double_format)
1373 gdbarch->long_double_format = long_double_format;
1377 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1379 gdb_assert (gdbarch != NULL);
1380 /* Skip verify of ptr_bit, invalid_p == 0 */
1381 if (gdbarch_debug >= 2)
1382 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1383 return gdbarch->ptr_bit;
1387 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1390 gdbarch->ptr_bit = ptr_bit;
1394 gdbarch_addr_bit (struct gdbarch *gdbarch)
1396 gdb_assert (gdbarch != NULL);
1397 /* Check variable changed from pre-default. */
1398 gdb_assert (gdbarch->addr_bit != 0);
1399 if (gdbarch_debug >= 2)
1400 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1401 return gdbarch->addr_bit;
1405 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1408 gdbarch->addr_bit = addr_bit;
1412 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
1414 gdb_assert (gdbarch != NULL);
1415 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1416 if (gdbarch_debug >= 2)
1417 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
1418 return gdbarch->bfd_vma_bit;
1422 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
1425 gdbarch->bfd_vma_bit = bfd_vma_bit;
1429 gdbarch_char_signed (struct gdbarch *gdbarch)
1431 gdb_assert (gdbarch != NULL);
1432 /* Check variable changed from pre-default. */
1433 gdb_assert (gdbarch->char_signed != -1);
1434 if (gdbarch_debug >= 2)
1435 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1436 return gdbarch->char_signed;
1440 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1443 gdbarch->char_signed = char_signed;
1447 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1449 gdb_assert (gdbarch != NULL);
1450 return gdbarch->read_pc != NULL;
1454 gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache)
1456 gdb_assert (gdbarch != NULL);
1457 gdb_assert (gdbarch->read_pc != NULL);
1458 if (gdbarch_debug >= 2)
1459 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1460 return gdbarch->read_pc (regcache);
1464 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1465 gdbarch_read_pc_ftype read_pc)
1467 gdbarch->read_pc = read_pc;
1471 gdbarch_write_pc_p (struct gdbarch *gdbarch)
1473 gdb_assert (gdbarch != NULL);
1474 return gdbarch->write_pc != NULL;
1478 gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val)
1480 gdb_assert (gdbarch != NULL);
1481 gdb_assert (gdbarch->write_pc != NULL);
1482 if (gdbarch_debug >= 2)
1483 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1484 gdbarch->write_pc (regcache, val);
1488 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1489 gdbarch_write_pc_ftype write_pc)
1491 gdbarch->write_pc = write_pc;
1495 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1497 gdb_assert (gdbarch != NULL);
1498 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1499 if (gdbarch_debug >= 2)
1500 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1501 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
1505 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1506 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1508 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1512 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1514 gdb_assert (gdbarch != NULL);
1515 return gdbarch->pseudo_register_read != NULL;
1519 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
1521 gdb_assert (gdbarch != NULL);
1522 gdb_assert (gdbarch->pseudo_register_read != NULL);
1523 if (gdbarch_debug >= 2)
1524 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1525 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1529 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1530 gdbarch_pseudo_register_read_ftype pseudo_register_read)
1532 gdbarch->pseudo_register_read = pseudo_register_read;
1536 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
1538 gdb_assert (gdbarch != NULL);
1539 return gdbarch->pseudo_register_write != NULL;
1543 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
1545 gdb_assert (gdbarch != NULL);
1546 gdb_assert (gdbarch->pseudo_register_write != NULL);
1547 if (gdbarch_debug >= 2)
1548 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1549 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
1553 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1554 gdbarch_pseudo_register_write_ftype pseudo_register_write)
1556 gdbarch->pseudo_register_write = pseudo_register_write;
1560 gdbarch_num_regs (struct gdbarch *gdbarch)
1562 gdb_assert (gdbarch != NULL);
1563 /* Check variable changed from pre-default. */
1564 gdb_assert (gdbarch->num_regs != -1);
1565 if (gdbarch_debug >= 2)
1566 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1567 return gdbarch->num_regs;
1571 set_gdbarch_num_regs (struct gdbarch *gdbarch,
1574 gdbarch->num_regs = num_regs;
1578 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
1580 gdb_assert (gdbarch != NULL);
1581 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1582 if (gdbarch_debug >= 2)
1583 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
1584 return gdbarch->num_pseudo_regs;
1588 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
1589 int num_pseudo_regs)
1591 gdbarch->num_pseudo_regs = num_pseudo_regs;
1595 gdbarch_sp_regnum (struct gdbarch *gdbarch)
1597 gdb_assert (gdbarch != NULL);
1598 /* Skip verify of sp_regnum, invalid_p == 0 */
1599 if (gdbarch_debug >= 2)
1600 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
1601 return gdbarch->sp_regnum;
1605 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
1608 gdbarch->sp_regnum = sp_regnum;
1612 gdbarch_pc_regnum (struct gdbarch *gdbarch)
1614 gdb_assert (gdbarch != NULL);
1615 /* Skip verify of pc_regnum, invalid_p == 0 */
1616 if (gdbarch_debug >= 2)
1617 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
1618 return gdbarch->pc_regnum;
1622 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
1625 gdbarch->pc_regnum = pc_regnum;
1629 gdbarch_ps_regnum (struct gdbarch *gdbarch)
1631 gdb_assert (gdbarch != NULL);
1632 /* Skip verify of ps_regnum, invalid_p == 0 */
1633 if (gdbarch_debug >= 2)
1634 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
1635 return gdbarch->ps_regnum;
1639 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
1642 gdbarch->ps_regnum = ps_regnum;
1646 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
1648 gdb_assert (gdbarch != NULL);
1649 /* Skip verify of fp0_regnum, invalid_p == 0 */
1650 if (gdbarch_debug >= 2)
1651 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
1652 return gdbarch->fp0_regnum;
1656 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
1659 gdbarch->fp0_regnum = fp0_regnum;
1663 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
1665 gdb_assert (gdbarch != NULL);
1666 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
1667 if (gdbarch_debug >= 2)
1668 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
1669 return gdbarch->stab_reg_to_regnum (stab_regnr);
1673 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
1674 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
1676 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
1680 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
1682 gdb_assert (gdbarch != NULL);
1683 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
1684 if (gdbarch_debug >= 2)
1685 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
1686 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
1690 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
1691 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
1693 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
1697 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
1699 gdb_assert (gdbarch != NULL);
1700 gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
1701 if (gdbarch_debug >= 2)
1702 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
1703 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
1707 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
1708 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
1710 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
1714 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
1716 gdb_assert (gdbarch != NULL);
1717 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
1718 if (gdbarch_debug >= 2)
1719 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
1720 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
1724 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
1725 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
1727 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
1731 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
1733 gdb_assert (gdbarch != NULL);
1734 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
1735 if (gdbarch_debug >= 2)
1736 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
1737 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
1741 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
1742 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
1744 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
1748 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
1750 gdb_assert (gdbarch != NULL);
1751 gdb_assert (gdbarch->register_name != NULL);
1752 if (gdbarch_debug >= 2)
1753 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
1754 return gdbarch->register_name (regnr);
1758 set_gdbarch_register_name (struct gdbarch *gdbarch,
1759 gdbarch_register_name_ftype register_name)
1761 gdbarch->register_name = register_name;
1765 gdbarch_register_type_p (struct gdbarch *gdbarch)
1767 gdb_assert (gdbarch != NULL);
1768 return gdbarch->register_type != NULL;
1772 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
1774 gdb_assert (gdbarch != NULL);
1775 gdb_assert (gdbarch->register_type != NULL);
1776 if (gdbarch_debug >= 2)
1777 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
1778 return gdbarch->register_type (gdbarch, reg_nr);
1782 set_gdbarch_register_type (struct gdbarch *gdbarch,
1783 gdbarch_register_type_ftype register_type)
1785 gdbarch->register_type = register_type;
1789 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
1791 gdb_assert (gdbarch != NULL);
1792 return gdbarch->unwind_dummy_id != NULL;
1796 gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
1798 gdb_assert (gdbarch != NULL);
1799 gdb_assert (gdbarch->unwind_dummy_id != NULL);
1800 if (gdbarch_debug >= 2)
1801 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
1802 return gdbarch->unwind_dummy_id (gdbarch, info);
1806 set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
1807 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
1809 gdbarch->unwind_dummy_id = unwind_dummy_id;
1813 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
1815 gdb_assert (gdbarch != NULL);
1816 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1817 if (gdbarch_debug >= 2)
1818 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
1819 return gdbarch->deprecated_fp_regnum;
1823 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
1824 int deprecated_fp_regnum)
1826 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
1830 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
1832 gdb_assert (gdbarch != NULL);
1833 return gdbarch->push_dummy_call != NULL;
1837 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)
1839 gdb_assert (gdbarch != NULL);
1840 gdb_assert (gdbarch->push_dummy_call != NULL);
1841 if (gdbarch_debug >= 2)
1842 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
1843 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
1847 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
1848 gdbarch_push_dummy_call_ftype push_dummy_call)
1850 gdbarch->push_dummy_call = push_dummy_call;
1854 gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
1856 gdb_assert (gdbarch != NULL);
1857 if (gdbarch_debug >= 2)
1858 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
1859 return gdbarch->deprecated_register_size;
1863 set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
1864 int deprecated_register_size)
1866 gdbarch->deprecated_register_size = deprecated_register_size;
1870 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
1872 gdb_assert (gdbarch != NULL);
1873 /* Skip verify of call_dummy_location, invalid_p == 0 */
1874 if (gdbarch_debug >= 2)
1875 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
1876 return gdbarch->call_dummy_location;
1880 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
1881 int call_dummy_location)
1883 gdbarch->call_dummy_location = call_dummy_location;
1887 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
1889 gdb_assert (gdbarch != NULL);
1890 return gdbarch->push_dummy_code != NULL;
1894 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)
1896 gdb_assert (gdbarch != NULL);
1897 gdb_assert (gdbarch->push_dummy_code != NULL);
1898 if (gdbarch_debug >= 2)
1899 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
1900 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr, regcache);
1904 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
1905 gdbarch_push_dummy_code_ftype push_dummy_code)
1907 gdbarch->push_dummy_code = push_dummy_code;
1911 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
1913 gdb_assert (gdbarch != NULL);
1914 gdb_assert (gdbarch->print_registers_info != NULL);
1915 if (gdbarch_debug >= 2)
1916 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
1917 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
1921 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
1922 gdbarch_print_registers_info_ftype print_registers_info)
1924 gdbarch->print_registers_info = print_registers_info;
1928 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
1930 gdb_assert (gdbarch != NULL);
1931 return gdbarch->print_float_info != NULL;
1935 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1937 gdb_assert (gdbarch != NULL);
1938 gdb_assert (gdbarch->print_float_info != NULL);
1939 if (gdbarch_debug >= 2)
1940 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
1941 gdbarch->print_float_info (gdbarch, file, frame, args);
1945 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
1946 gdbarch_print_float_info_ftype print_float_info)
1948 gdbarch->print_float_info = print_float_info;
1952 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
1954 gdb_assert (gdbarch != NULL);
1955 return gdbarch->print_vector_info != NULL;
1959 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1961 gdb_assert (gdbarch != NULL);
1962 gdb_assert (gdbarch->print_vector_info != NULL);
1963 if (gdbarch_debug >= 2)
1964 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
1965 gdbarch->print_vector_info (gdbarch, file, frame, args);
1969 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
1970 gdbarch_print_vector_info_ftype print_vector_info)
1972 gdbarch->print_vector_info = print_vector_info;
1976 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
1978 gdb_assert (gdbarch != NULL);
1979 gdb_assert (gdbarch->register_sim_regno != NULL);
1980 if (gdbarch_debug >= 2)
1981 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
1982 return gdbarch->register_sim_regno (reg_nr);
1986 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
1987 gdbarch_register_sim_regno_ftype register_sim_regno)
1989 gdbarch->register_sim_regno = register_sim_regno;
1993 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
1995 gdb_assert (gdbarch != NULL);
1996 gdb_assert (gdbarch->cannot_fetch_register != NULL);
1997 if (gdbarch_debug >= 2)
1998 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
1999 return gdbarch->cannot_fetch_register (regnum);
2003 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
2004 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
2006 gdbarch->cannot_fetch_register = cannot_fetch_register;
2010 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
2012 gdb_assert (gdbarch != NULL);
2013 gdb_assert (gdbarch->cannot_store_register != NULL);
2014 if (gdbarch_debug >= 2)
2015 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
2016 return gdbarch->cannot_store_register (regnum);
2020 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
2021 gdbarch_cannot_store_register_ftype cannot_store_register)
2023 gdbarch->cannot_store_register = cannot_store_register;
2027 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
2029 gdb_assert (gdbarch != NULL);
2030 return gdbarch->get_longjmp_target != NULL;
2034 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc)
2036 gdb_assert (gdbarch != NULL);
2037 gdb_assert (gdbarch->get_longjmp_target != NULL);
2038 if (gdbarch_debug >= 2)
2039 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
2040 return gdbarch->get_longjmp_target (frame, pc);
2044 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2045 gdbarch_get_longjmp_target_ftype get_longjmp_target)
2047 gdbarch->get_longjmp_target = get_longjmp_target;
2051 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2053 gdb_assert (gdbarch != NULL);
2054 if (gdbarch_debug >= 2)
2055 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2056 return gdbarch->believe_pcc_promotion;
2060 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2061 int believe_pcc_promotion)
2063 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2067 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
2069 gdb_assert (gdbarch != NULL);
2070 gdb_assert (gdbarch->convert_register_p != NULL);
2071 if (gdbarch_debug >= 2)
2072 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
2073 return gdbarch->convert_register_p (regnum, type);
2077 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2078 gdbarch_convert_register_p_ftype convert_register_p)
2080 gdbarch->convert_register_p = convert_register_p;
2084 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf)
2086 gdb_assert (gdbarch != NULL);
2087 gdb_assert (gdbarch->register_to_value != NULL);
2088 if (gdbarch_debug >= 2)
2089 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2090 gdbarch->register_to_value (frame, regnum, type, buf);
2094 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2095 gdbarch_register_to_value_ftype register_to_value)
2097 gdbarch->register_to_value = register_to_value;
2101 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
2103 gdb_assert (gdbarch != NULL);
2104 gdb_assert (gdbarch->value_to_register != NULL);
2105 if (gdbarch_debug >= 2)
2106 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2107 gdbarch->value_to_register (frame, regnum, type, buf);
2111 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2112 gdbarch_value_to_register_ftype value_to_register)
2114 gdbarch->value_to_register = value_to_register;
2118 gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
2120 gdb_assert (gdbarch != NULL);
2121 gdb_assert (gdbarch->value_from_register != NULL);
2122 if (gdbarch_debug >= 2)
2123 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
2124 return gdbarch->value_from_register (type, regnum, frame);
2128 set_gdbarch_value_from_register (struct gdbarch *gdbarch,
2129 gdbarch_value_from_register_ftype value_from_register)
2131 gdbarch->value_from_register = value_from_register;
2135 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2137 gdb_assert (gdbarch != NULL);
2138 gdb_assert (gdbarch->pointer_to_address != NULL);
2139 if (gdbarch_debug >= 2)
2140 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2141 return gdbarch->pointer_to_address (type, buf);
2145 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2146 gdbarch_pointer_to_address_ftype pointer_to_address)
2148 gdbarch->pointer_to_address = pointer_to_address;
2152 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
2154 gdb_assert (gdbarch != NULL);
2155 gdb_assert (gdbarch->address_to_pointer != NULL);
2156 if (gdbarch_debug >= 2)
2157 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2158 gdbarch->address_to_pointer (type, buf, addr);
2162 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2163 gdbarch_address_to_pointer_ftype address_to_pointer)
2165 gdbarch->address_to_pointer = address_to_pointer;
2169 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2171 gdb_assert (gdbarch != NULL);
2172 return gdbarch->integer_to_address != NULL;
2176 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2178 gdb_assert (gdbarch != NULL);
2179 gdb_assert (gdbarch->integer_to_address != NULL);
2180 if (gdbarch_debug >= 2)
2181 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2182 return gdbarch->integer_to_address (gdbarch, type, buf);
2186 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2187 gdbarch_integer_to_address_ftype integer_to_address)
2189 gdbarch->integer_to_address = integer_to_address;
2193 gdbarch_return_value_p (struct gdbarch *gdbarch)
2195 gdb_assert (gdbarch != NULL);
2196 return gdbarch->return_value != legacy_return_value;
2199 enum return_value_convention
2200 gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2202 gdb_assert (gdbarch != NULL);
2203 gdb_assert (gdbarch->return_value != NULL);
2204 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2205 if (gdbarch_debug >= 2)
2206 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2207 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
2211 set_gdbarch_return_value (struct gdbarch *gdbarch,
2212 gdbarch_return_value_ftype return_value)
2214 gdbarch->return_value = return_value;
2218 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf)
2220 gdb_assert (gdbarch != NULL);
2221 gdb_assert (gdbarch->extract_return_value != NULL);
2222 if (gdbarch_debug >= 2)
2223 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
2224 gdbarch->extract_return_value (type, regcache, valbuf);
2228 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
2229 gdbarch_extract_return_value_ftype extract_return_value)
2231 gdbarch->extract_return_value = extract_return_value;
2235 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
2237 gdb_assert (gdbarch != NULL);
2238 gdb_assert (gdbarch->store_return_value != NULL);
2239 if (gdbarch_debug >= 2)
2240 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
2241 gdbarch->store_return_value (type, regcache, valbuf);
2245 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
2246 gdbarch_store_return_value_ftype store_return_value)
2248 gdbarch->store_return_value = store_return_value;
2252 gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
2254 gdb_assert (gdbarch != NULL);
2255 gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
2256 if (gdbarch_debug >= 2)
2257 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
2258 return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
2262 set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
2263 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
2265 gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
2269 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
2271 gdb_assert (gdbarch != NULL);
2272 return gdbarch->deprecated_extract_struct_value_address != NULL;
2276 gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
2278 gdb_assert (gdbarch != NULL);
2279 gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL);
2280 if (gdbarch_debug >= 2)
2281 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
2282 return gdbarch->deprecated_extract_struct_value_address (regcache);
2286 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
2287 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
2289 gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
2293 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2295 gdb_assert (gdbarch != NULL);
2296 gdb_assert (gdbarch->skip_prologue != NULL);
2297 if (gdbarch_debug >= 2)
2298 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2299 return gdbarch->skip_prologue (ip);
2303 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2304 gdbarch_skip_prologue_ftype skip_prologue)
2306 gdbarch->skip_prologue = skip_prologue;
2310 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2312 gdb_assert (gdbarch != NULL);
2313 gdb_assert (gdbarch->inner_than != NULL);
2314 if (gdbarch_debug >= 2)
2315 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2316 return gdbarch->inner_than (lhs, rhs);
2320 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2321 gdbarch_inner_than_ftype inner_than)
2323 gdbarch->inner_than = inner_than;
2327 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2329 gdb_assert (gdbarch != NULL);
2330 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2331 if (gdbarch_debug >= 2)
2332 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2333 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
2337 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2338 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2340 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2344 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2346 gdb_assert (gdbarch != NULL);
2347 return gdbarch->adjust_breakpoint_address != NULL;
2351 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2353 gdb_assert (gdbarch != NULL);
2354 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2355 if (gdbarch_debug >= 2)
2356 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2357 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2361 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2362 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2364 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2368 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2370 gdb_assert (gdbarch != NULL);
2371 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2372 if (gdbarch_debug >= 2)
2373 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2374 return gdbarch->memory_insert_breakpoint (bp_tgt);
2378 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2379 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2381 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2385 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2387 gdb_assert (gdbarch != NULL);
2388 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2389 if (gdbarch_debug >= 2)
2390 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2391 return gdbarch->memory_remove_breakpoint (bp_tgt);
2395 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2396 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2398 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2402 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2404 gdb_assert (gdbarch != NULL);
2405 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2406 if (gdbarch_debug >= 2)
2407 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2408 return gdbarch->decr_pc_after_break;
2412 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2413 CORE_ADDR decr_pc_after_break)
2415 gdbarch->decr_pc_after_break = decr_pc_after_break;
2419 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2421 gdb_assert (gdbarch != NULL);
2422 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2423 if (gdbarch_debug >= 2)
2424 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2425 return gdbarch->deprecated_function_start_offset;
2429 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2430 CORE_ADDR deprecated_function_start_offset)
2432 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2436 gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
2438 gdb_assert (gdbarch != NULL);
2439 gdb_assert (gdbarch->remote_register_number != NULL);
2440 if (gdbarch_debug >= 2)
2441 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
2442 return gdbarch->remote_register_number (gdbarch, regno);
2446 set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
2447 gdbarch_remote_register_number_ftype remote_register_number)
2449 gdbarch->remote_register_number = remote_register_number;
2453 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2455 gdb_assert (gdbarch != NULL);
2456 return gdbarch->fetch_tls_load_module_address != NULL;
2460 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
2462 gdb_assert (gdbarch != NULL);
2463 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
2464 if (gdbarch_debug >= 2)
2465 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
2466 return gdbarch->fetch_tls_load_module_address (objfile);
2470 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
2471 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
2473 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
2477 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
2479 gdb_assert (gdbarch != NULL);
2480 /* Skip verify of frame_args_skip, invalid_p == 0 */
2481 if (gdbarch_debug >= 2)
2482 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2483 return gdbarch->frame_args_skip;
2487 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2488 CORE_ADDR frame_args_skip)
2490 gdbarch->frame_args_skip = frame_args_skip;
2494 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
2496 gdb_assert (gdbarch != NULL);
2497 return gdbarch->unwind_pc != NULL;
2501 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
2503 gdb_assert (gdbarch != NULL);
2504 gdb_assert (gdbarch->unwind_pc != NULL);
2505 if (gdbarch_debug >= 2)
2506 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
2507 return gdbarch->unwind_pc (gdbarch, next_frame);
2511 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
2512 gdbarch_unwind_pc_ftype unwind_pc)
2514 gdbarch->unwind_pc = unwind_pc;
2518 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
2520 gdb_assert (gdbarch != NULL);
2521 return gdbarch->unwind_sp != NULL;
2525 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
2527 gdb_assert (gdbarch != NULL);
2528 gdb_assert (gdbarch->unwind_sp != NULL);
2529 if (gdbarch_debug >= 2)
2530 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
2531 return gdbarch->unwind_sp (gdbarch, next_frame);
2535 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
2536 gdbarch_unwind_sp_ftype unwind_sp)
2538 gdbarch->unwind_sp = unwind_sp;
2542 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
2544 gdb_assert (gdbarch != NULL);
2545 return gdbarch->frame_num_args != NULL;
2549 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2551 gdb_assert (gdbarch != NULL);
2552 gdb_assert (gdbarch->frame_num_args != NULL);
2553 if (gdbarch_debug >= 2)
2554 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
2555 return gdbarch->frame_num_args (frame);
2559 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
2560 gdbarch_frame_num_args_ftype frame_num_args)
2562 gdbarch->frame_num_args = frame_num_args;
2566 gdbarch_frame_align_p (struct gdbarch *gdbarch)
2568 gdb_assert (gdbarch != NULL);
2569 return gdbarch->frame_align != NULL;
2573 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
2575 gdb_assert (gdbarch != NULL);
2576 gdb_assert (gdbarch->frame_align != NULL);
2577 if (gdbarch_debug >= 2)
2578 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
2579 return gdbarch->frame_align (gdbarch, address);
2583 set_gdbarch_frame_align (struct gdbarch *gdbarch,
2584 gdbarch_frame_align_ftype frame_align)
2586 gdbarch->frame_align = frame_align;
2590 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
2592 gdb_assert (gdbarch != NULL);
2593 return gdbarch->deprecated_reg_struct_has_addr != NULL;
2597 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
2599 gdb_assert (gdbarch != NULL);
2600 gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
2601 if (gdbarch_debug >= 2)
2602 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
2603 return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
2607 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
2608 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
2610 gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
2614 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
2616 gdb_assert (gdbarch != NULL);
2617 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
2618 if (gdbarch_debug >= 2)
2619 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
2620 return gdbarch->stabs_argument_has_addr (gdbarch, type);
2624 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
2625 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
2627 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
2631 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
2633 gdb_assert (gdbarch != NULL);
2634 if (gdbarch_debug >= 2)
2635 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
2636 return gdbarch->frame_red_zone_size;
2640 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
2641 int frame_red_zone_size)
2643 gdbarch->frame_red_zone_size = frame_red_zone_size;
2647 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
2649 gdb_assert (gdbarch != NULL);
2650 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
2651 if (gdbarch_debug >= 2)
2652 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
2653 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
2657 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
2658 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
2660 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
2664 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
2666 gdb_assert (gdbarch != NULL);
2667 gdb_assert (gdbarch->addr_bits_remove != NULL);
2668 if (gdbarch_debug >= 2)
2669 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
2670 return gdbarch->addr_bits_remove (addr);
2674 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
2675 gdbarch_addr_bits_remove_ftype addr_bits_remove)
2677 gdbarch->addr_bits_remove = addr_bits_remove;
2681 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
2683 gdb_assert (gdbarch != NULL);
2684 gdb_assert (gdbarch->smash_text_address != NULL);
2685 if (gdbarch_debug >= 2)
2686 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
2687 return gdbarch->smash_text_address (addr);
2691 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
2692 gdbarch_smash_text_address_ftype smash_text_address)
2694 gdbarch->smash_text_address = smash_text_address;
2698 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
2700 gdb_assert (gdbarch != NULL);
2701 return gdbarch->software_single_step != NULL;
2705 gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
2707 gdb_assert (gdbarch != NULL);
2708 gdb_assert (gdbarch->software_single_step != NULL);
2709 if (gdbarch_debug >= 2)
2710 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
2711 return gdbarch->software_single_step (frame);
2715 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
2716 gdbarch_software_single_step_ftype software_single_step)
2718 gdbarch->software_single_step = software_single_step;
2722 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
2724 gdb_assert (gdbarch != NULL);
2725 return gdbarch->single_step_through_delay != NULL;
2729 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
2731 gdb_assert (gdbarch != NULL);
2732 gdb_assert (gdbarch->single_step_through_delay != NULL);
2733 if (gdbarch_debug >= 2)
2734 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
2735 return gdbarch->single_step_through_delay (gdbarch, frame);
2739 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
2740 gdbarch_single_step_through_delay_ftype single_step_through_delay)
2742 gdbarch->single_step_through_delay = single_step_through_delay;
2746 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
2748 gdb_assert (gdbarch != NULL);
2749 gdb_assert (gdbarch->print_insn != NULL);
2750 if (gdbarch_debug >= 2)
2751 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
2752 return gdbarch->print_insn (vma, info);
2756 set_gdbarch_print_insn (struct gdbarch *gdbarch,
2757 gdbarch_print_insn_ftype print_insn)
2759 gdbarch->print_insn = print_insn;
2763 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc)
2765 gdb_assert (gdbarch != NULL);
2766 gdb_assert (gdbarch->skip_trampoline_code != NULL);
2767 if (gdbarch_debug >= 2)
2768 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
2769 return gdbarch->skip_trampoline_code (frame, pc);
2773 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
2774 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
2776 gdbarch->skip_trampoline_code = skip_trampoline_code;
2780 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
2782 gdb_assert (gdbarch != NULL);
2783 gdb_assert (gdbarch->skip_solib_resolver != NULL);
2784 if (gdbarch_debug >= 2)
2785 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
2786 return gdbarch->skip_solib_resolver (gdbarch, pc);
2790 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
2791 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
2793 gdbarch->skip_solib_resolver = skip_solib_resolver;
2797 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
2799 gdb_assert (gdbarch != NULL);
2800 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
2801 if (gdbarch_debug >= 2)
2802 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
2803 return gdbarch->in_solib_return_trampoline (pc, name);
2807 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
2808 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
2810 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
2814 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
2816 gdb_assert (gdbarch != NULL);
2817 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
2818 if (gdbarch_debug >= 2)
2819 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
2820 return gdbarch->in_function_epilogue_p (gdbarch, addr);
2824 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
2825 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
2827 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
2831 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
2833 gdb_assert (gdbarch != NULL);
2834 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
2835 if (gdbarch_debug >= 2)
2836 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
2837 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
2841 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
2842 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
2844 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
2848 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
2850 gdb_assert (gdbarch != NULL);
2851 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
2852 if (gdbarch_debug >= 2)
2853 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
2854 gdbarch->elf_make_msymbol_special (sym, msym);
2858 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
2859 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
2861 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
2865 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
2867 gdb_assert (gdbarch != NULL);
2868 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
2869 if (gdbarch_debug >= 2)
2870 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
2871 gdbarch->coff_make_msymbol_special (val, msym);
2875 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
2876 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
2878 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
2882 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
2884 gdb_assert (gdbarch != NULL);
2885 /* Skip verify of name_of_malloc, invalid_p == 0 */
2886 if (gdbarch_debug >= 2)
2887 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
2888 return gdbarch->name_of_malloc;
2892 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
2893 const char * name_of_malloc)
2895 gdbarch->name_of_malloc = name_of_malloc;
2899 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
2901 gdb_assert (gdbarch != NULL);
2902 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2903 if (gdbarch_debug >= 2)
2904 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
2905 return gdbarch->cannot_step_breakpoint;
2909 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
2910 int cannot_step_breakpoint)
2912 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
2916 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
2918 gdb_assert (gdbarch != NULL);
2919 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2920 if (gdbarch_debug >= 2)
2921 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
2922 return gdbarch->have_nonsteppable_watchpoint;
2926 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
2927 int have_nonsteppable_watchpoint)
2929 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
2933 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
2935 gdb_assert (gdbarch != NULL);
2936 return gdbarch->address_class_type_flags != NULL;
2940 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
2942 gdb_assert (gdbarch != NULL);
2943 gdb_assert (gdbarch->address_class_type_flags != NULL);
2944 if (gdbarch_debug >= 2)
2945 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
2946 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
2950 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
2951 gdbarch_address_class_type_flags_ftype address_class_type_flags)
2953 gdbarch->address_class_type_flags = address_class_type_flags;
2957 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
2959 gdb_assert (gdbarch != NULL);
2960 return gdbarch->address_class_type_flags_to_name != NULL;
2964 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
2966 gdb_assert (gdbarch != NULL);
2967 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
2968 if (gdbarch_debug >= 2)
2969 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
2970 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
2974 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
2975 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
2977 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
2981 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
2983 gdb_assert (gdbarch != NULL);
2984 return gdbarch->address_class_name_to_type_flags != NULL;
2988 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
2990 gdb_assert (gdbarch != NULL);
2991 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
2992 if (gdbarch_debug >= 2)
2993 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
2994 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
2998 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
2999 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
3001 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
3005 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
3007 gdb_assert (gdbarch != NULL);
3008 gdb_assert (gdbarch->register_reggroup_p != NULL);
3009 if (gdbarch_debug >= 2)
3010 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
3011 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
3015 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
3016 gdbarch_register_reggroup_p_ftype register_reggroup_p)
3018 gdbarch->register_reggroup_p = register_reggroup_p;
3022 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
3024 gdb_assert (gdbarch != NULL);
3025 return gdbarch->fetch_pointer_argument != NULL;
3029 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
3031 gdb_assert (gdbarch != NULL);
3032 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
3033 if (gdbarch_debug >= 2)
3034 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
3035 return gdbarch->fetch_pointer_argument (frame, argi, type);
3039 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
3040 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
3042 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
3046 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
3048 gdb_assert (gdbarch != NULL);
3049 return gdbarch->regset_from_core_section != NULL;
3052 const struct regset *
3053 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
3055 gdb_assert (gdbarch != NULL);
3056 gdb_assert (gdbarch->regset_from_core_section != NULL);
3057 if (gdbarch_debug >= 2)
3058 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
3059 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
3063 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
3064 gdbarch_regset_from_core_section_ftype regset_from_core_section)
3066 gdbarch->regset_from_core_section = regset_from_core_section;
3070 gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
3072 gdb_assert (gdbarch != NULL);
3073 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3074 if (gdbarch_debug >= 2)
3075 fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
3076 return gdbarch->vtable_function_descriptors;
3080 set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
3081 int vtable_function_descriptors)
3083 gdbarch->vtable_function_descriptors = vtable_function_descriptors;
3087 gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
3089 gdb_assert (gdbarch != NULL);
3090 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3091 if (gdbarch_debug >= 2)
3092 fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
3093 return gdbarch->vbit_in_delta;
3097 set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
3100 gdbarch->vbit_in_delta = vbit_in_delta;
3104 gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
3106 gdb_assert (gdbarch != NULL);
3107 return gdbarch->skip_permanent_breakpoint != NULL;
3111 gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
3113 gdb_assert (gdbarch != NULL);
3114 gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
3115 if (gdbarch_debug >= 2)
3116 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
3117 gdbarch->skip_permanent_breakpoint (regcache);
3121 set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
3122 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
3124 gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
3128 gdbarch_overlay_update_p (struct gdbarch *gdbarch)
3130 gdb_assert (gdbarch != NULL);
3131 return gdbarch->overlay_update != NULL;
3135 gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
3137 gdb_assert (gdbarch != NULL);
3138 gdb_assert (gdbarch->overlay_update != NULL);
3139 if (gdbarch_debug >= 2)
3140 fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
3141 gdbarch->overlay_update (osect);
3145 set_gdbarch_overlay_update (struct gdbarch *gdbarch,
3146 gdbarch_overlay_update_ftype overlay_update)
3148 gdbarch->overlay_update = overlay_update;
3152 /* Keep a registry of per-architecture data-pointers required by GDB
3159 gdbarch_data_pre_init_ftype *pre_init;
3160 gdbarch_data_post_init_ftype *post_init;
3163 struct gdbarch_data_registration
3165 struct gdbarch_data *data;
3166 struct gdbarch_data_registration *next;
3169 struct gdbarch_data_registry
3172 struct gdbarch_data_registration *registrations;
3175 struct gdbarch_data_registry gdbarch_data_registry =
3180 static struct gdbarch_data *
3181 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3182 gdbarch_data_post_init_ftype *post_init)
3184 struct gdbarch_data_registration **curr;
3185 /* Append the new registraration. */
3186 for (curr = &gdbarch_data_registry.registrations;
3188 curr = &(*curr)->next);
3189 (*curr) = XMALLOC (struct gdbarch_data_registration);
3190 (*curr)->next = NULL;
3191 (*curr)->data = XMALLOC (struct gdbarch_data);
3192 (*curr)->data->index = gdbarch_data_registry.nr++;
3193 (*curr)->data->pre_init = pre_init;
3194 (*curr)->data->post_init = post_init;
3195 (*curr)->data->init_p = 1;
3196 return (*curr)->data;
3199 struct gdbarch_data *
3200 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3202 return gdbarch_data_register (pre_init, NULL);
3205 struct gdbarch_data *
3206 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3208 return gdbarch_data_register (NULL, post_init);
3211 /* Create/delete the gdbarch data vector. */
3214 alloc_gdbarch_data (struct gdbarch *gdbarch)
3216 gdb_assert (gdbarch->data == NULL);
3217 gdbarch->nr_data = gdbarch_data_registry.nr;
3218 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3221 /* Initialize the current value of the specified per-architecture
3225 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3226 struct gdbarch_data *data,
3229 gdb_assert (data->index < gdbarch->nr_data);
3230 gdb_assert (gdbarch->data[data->index] == NULL);
3231 gdb_assert (data->pre_init == NULL);
3232 gdbarch->data[data->index] = pointer;
3235 /* Return the current value of the specified per-architecture
3239 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3241 gdb_assert (data->index < gdbarch->nr_data);
3242 if (gdbarch->data[data->index] == NULL)
3244 /* The data-pointer isn't initialized, call init() to get a
3246 if (data->pre_init != NULL)
3247 /* Mid architecture creation: pass just the obstack, and not
3248 the entire architecture, as that way it isn't possible for
3249 pre-init code to refer to undefined architecture
3251 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3252 else if (gdbarch->initialized_p
3253 && data->post_init != NULL)
3254 /* Post architecture creation: pass the entire architecture
3255 (as all fields are valid), but be careful to also detect
3256 recursive references. */
3258 gdb_assert (data->init_p);
3260 gdbarch->data[data->index] = data->post_init (gdbarch);
3264 /* The architecture initialization hasn't completed - punt -
3265 hope that the caller knows what they are doing. Once
3266 deprecated_set_gdbarch_data has been initialized, this can be
3267 changed to an internal error. */
3269 gdb_assert (gdbarch->data[data->index] != NULL);
3271 return gdbarch->data[data->index];
3276 /* Keep a registry of swapped data required by GDB modules. */
3281 struct gdbarch_swap_registration *source;
3282 struct gdbarch_swap *next;
3285 struct gdbarch_swap_registration
3288 unsigned long sizeof_data;
3289 gdbarch_swap_ftype *init;
3290 struct gdbarch_swap_registration *next;
3293 struct gdbarch_swap_registry
3296 struct gdbarch_swap_registration *registrations;
3299 struct gdbarch_swap_registry gdbarch_swap_registry =
3305 deprecated_register_gdbarch_swap (void *data,
3306 unsigned long sizeof_data,
3307 gdbarch_swap_ftype *init)
3309 struct gdbarch_swap_registration **rego;
3310 for (rego = &gdbarch_swap_registry.registrations;
3312 rego = &(*rego)->next);
3313 (*rego) = XMALLOC (struct gdbarch_swap_registration);
3314 (*rego)->next = NULL;
3315 (*rego)->init = init;
3316 (*rego)->data = data;
3317 (*rego)->sizeof_data = sizeof_data;
3321 current_gdbarch_swap_init_hack (void)
3323 struct gdbarch_swap_registration *rego;
3324 struct gdbarch_swap **curr = ¤t_gdbarch->swap;
3325 for (rego = gdbarch_swap_registry.registrations;
3329 if (rego->data != NULL)
3331 (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch,
3332 struct gdbarch_swap);
3333 (*curr)->source = rego;
3334 (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch,
3336 (*curr)->next = NULL;
3337 curr = &(*curr)->next;
3339 if (rego->init != NULL)
3344 static struct gdbarch *
3345 current_gdbarch_swap_out_hack (void)
3347 struct gdbarch *old_gdbarch = current_gdbarch;
3348 struct gdbarch_swap *curr;
3350 gdb_assert (old_gdbarch != NULL);
3351 for (curr = old_gdbarch->swap;
3355 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
3356 memset (curr->source->data, 0, curr->source->sizeof_data);
3358 current_gdbarch = NULL;
3363 current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch)
3365 struct gdbarch_swap *curr;
3367 gdb_assert (current_gdbarch == NULL);
3368 for (curr = new_gdbarch->swap;
3371 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
3372 current_gdbarch = new_gdbarch;
3376 /* Keep a registry of the architectures known by GDB. */
3378 struct gdbarch_registration
3380 enum bfd_architecture bfd_architecture;
3381 gdbarch_init_ftype *init;
3382 gdbarch_dump_tdep_ftype *dump_tdep;
3383 struct gdbarch_list *arches;
3384 struct gdbarch_registration *next;
3387 static struct gdbarch_registration *gdbarch_registry = NULL;
3390 append_name (const char ***buf, int *nr, const char *name)
3392 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3398 gdbarch_printable_names (void)
3400 /* Accumulate a list of names based on the registed list of
3402 enum bfd_architecture a;
3404 const char **arches = NULL;
3405 struct gdbarch_registration *rego;
3406 for (rego = gdbarch_registry;
3410 const struct bfd_arch_info *ap;
3411 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3413 internal_error (__FILE__, __LINE__,
3414 _("gdbarch_architecture_names: multi-arch unknown"));
3417 append_name (&arches, &nr_arches, ap->printable_name);
3422 append_name (&arches, &nr_arches, NULL);
3428 gdbarch_register (enum bfd_architecture bfd_architecture,
3429 gdbarch_init_ftype *init,
3430 gdbarch_dump_tdep_ftype *dump_tdep)
3432 struct gdbarch_registration **curr;
3433 const struct bfd_arch_info *bfd_arch_info;
3434 /* Check that BFD recognizes this architecture */
3435 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3436 if (bfd_arch_info == NULL)
3438 internal_error (__FILE__, __LINE__,
3439 _("gdbarch: Attempt to register unknown architecture (%d)"),
3442 /* Check that we haven't seen this architecture before */
3443 for (curr = &gdbarch_registry;
3445 curr = &(*curr)->next)
3447 if (bfd_architecture == (*curr)->bfd_architecture)
3448 internal_error (__FILE__, __LINE__,
3449 _("gdbarch: Duplicate registraration of architecture (%s)"),
3450 bfd_arch_info->printable_name);
3454 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
3455 bfd_arch_info->printable_name,
3458 (*curr) = XMALLOC (struct gdbarch_registration);
3459 (*curr)->bfd_architecture = bfd_architecture;
3460 (*curr)->init = init;
3461 (*curr)->dump_tdep = dump_tdep;
3462 (*curr)->arches = NULL;
3463 (*curr)->next = NULL;
3467 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3468 gdbarch_init_ftype *init)
3470 gdbarch_register (bfd_architecture, init, NULL);
3474 /* Look for an architecture using gdbarch_info. */
3476 struct gdbarch_list *
3477 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
3478 const struct gdbarch_info *info)
3480 for (; arches != NULL; arches = arches->next)
3482 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
3484 if (info->byte_order != arches->gdbarch->byte_order)
3486 if (info->osabi != arches->gdbarch->osabi)
3488 if (info->target_desc != arches->gdbarch->target_desc)
3496 /* Find an architecture that matches the specified INFO. Create a new
3497 architecture if needed. Return that new architecture. Assumes
3498 that there is no current architecture. */
3500 static struct gdbarch *
3501 find_arch_by_info (struct gdbarch_info info)
3503 struct gdbarch *new_gdbarch;
3504 struct gdbarch_registration *rego;
3506 /* The existing architecture has been swapped out - all this code
3507 works from a clean slate. */
3508 gdb_assert (current_gdbarch == NULL);
3510 /* Fill in missing parts of the INFO struct using a number of
3511 sources: "set ..."; INFOabfd supplied; and the global
3513 gdbarch_info_fill (&info);
3515 /* Must have found some sort of architecture. */
3516 gdb_assert (info.bfd_arch_info != NULL);
3520 fprintf_unfiltered (gdb_stdlog,
3521 "find_arch_by_info: info.bfd_arch_info %s\n",
3522 (info.bfd_arch_info != NULL
3523 ? info.bfd_arch_info->printable_name
3525 fprintf_unfiltered (gdb_stdlog,
3526 "find_arch_by_info: info.byte_order %d (%s)\n",
3528 (info.byte_order == BFD_ENDIAN_BIG ? "big"
3529 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
3531 fprintf_unfiltered (gdb_stdlog,
3532 "find_arch_by_info: info.osabi %d (%s)\n",
3533 info.osabi, gdbarch_osabi_name (info.osabi));
3534 fprintf_unfiltered (gdb_stdlog,
3535 "find_arch_by_info: info.abfd 0x%lx\n",
3537 fprintf_unfiltered (gdb_stdlog,
3538 "find_arch_by_info: info.tdep_info 0x%lx\n",
3539 (long) info.tdep_info);
3542 /* Find the tdep code that knows about this architecture. */
3543 for (rego = gdbarch_registry;
3546 if (rego->bfd_architecture == info.bfd_arch_info->arch)
3551 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3552 "No matching architecture\n");
3556 /* Ask the tdep code for an architecture that matches "info". */
3557 new_gdbarch = rego->init (info, rego->arches);
3559 /* Did the tdep code like it? No. Reject the change and revert to
3560 the old architecture. */
3561 if (new_gdbarch == NULL)
3564 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3565 "Target rejected architecture\n");
3569 /* Is this a pre-existing architecture (as determined by already
3570 being initialized)? Move it to the front of the architecture
3571 list (keeping the list sorted Most Recently Used). */
3572 if (new_gdbarch->initialized_p)
3574 struct gdbarch_list **list;
3575 struct gdbarch_list *this;
3577 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3578 "Previous architecture 0x%08lx (%s) selected\n",
3580 new_gdbarch->bfd_arch_info->printable_name);
3581 /* Find the existing arch in the list. */
3582 for (list = ®o->arches;
3583 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
3584 list = &(*list)->next);
3585 /* It had better be in the list of architectures. */
3586 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
3589 (*list) = this->next;
3590 /* Insert THIS at the front. */
3591 this->next = rego->arches;
3592 rego->arches = this;
3597 /* It's a new architecture. */
3599 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3600 "New architecture 0x%08lx (%s) selected\n",
3602 new_gdbarch->bfd_arch_info->printable_name);
3604 /* Insert the new architecture into the front of the architecture
3605 list (keep the list sorted Most Recently Used). */
3607 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
3608 this->next = rego->arches;
3609 this->gdbarch = new_gdbarch;
3610 rego->arches = this;
3613 /* Check that the newly installed architecture is valid. Plug in
3614 any post init values. */
3615 new_gdbarch->dump_tdep = rego->dump_tdep;
3616 verify_gdbarch (new_gdbarch);
3617 new_gdbarch->initialized_p = 1;
3619 /* Initialize any per-architecture swap areas. This phase requires
3620 a valid global CURRENT_GDBARCH. Set it momentarially, and then
3621 swap the entire architecture out. */
3622 current_gdbarch = new_gdbarch;
3623 current_gdbarch_swap_init_hack ();
3624 current_gdbarch_swap_out_hack ();
3627 gdbarch_dump (new_gdbarch, gdb_stdlog);
3633 gdbarch_find_by_info (struct gdbarch_info info)
3635 /* Save the previously selected architecture, setting the global to
3636 NULL. This stops things like gdbarch->init() trying to use the
3637 previous architecture's configuration. The previous architecture
3638 may not even be of the same architecture family. The most recent
3639 architecture of the same family is found at the head of the
3640 rego->arches list. */
3641 struct gdbarch *old_gdbarch = current_gdbarch_swap_out_hack ();
3643 /* Find the specified architecture. */
3644 struct gdbarch *new_gdbarch = find_arch_by_info (info);
3646 /* Restore the existing architecture. */
3647 gdb_assert (current_gdbarch == NULL);
3648 current_gdbarch_swap_in_hack (old_gdbarch);
3653 /* Make the specified architecture current, swapping the existing one
3657 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
3659 gdb_assert (new_gdbarch != NULL);
3660 gdb_assert (current_gdbarch != NULL);
3661 gdb_assert (new_gdbarch->initialized_p);
3662 current_gdbarch_swap_out_hack ();
3663 current_gdbarch_swap_in_hack (new_gdbarch);
3664 architecture_changed_event ();
3665 reinit_frame_cache ();
3668 extern void _initialize_gdbarch (void);
3671 _initialize_gdbarch (void)
3673 struct cmd_list_element *c;
3675 add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
3676 Set architecture debugging."), _("\
3677 Show architecture debugging."), _("\
3678 When non-zero, architecture debugging is enabled."),
3681 &setdebuglist, &showdebuglist);