1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
5 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 Boston, MA 02110-1301, USA. */
25 /* This file was created with the aid of ``gdbarch.sh''.
27 The Bourne shell script ``gdbarch.sh'' creates the files
28 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
29 against the existing ``gdbarch.[hc]''. Any differences found
32 If editing this file, please also run gdbarch.sh and merge any
33 changes into that script. Conversely, when making sweeping changes
34 to this file, modifying gdbarch.sh and using its output may prove
39 #include "arch-utils.h"
45 #include "floatformat.h"
47 #include "gdb_assert.h"
48 #include "gdb_string.h"
49 #include "gdb-events.h"
50 #include "reggroups.h"
52 #include "gdb_obstack.h"
54 /* Static function declarations */
56 static void alloc_gdbarch_data (struct gdbarch *);
58 /* Non-zero if we want to trace architecture code. */
61 #define GDBARCH_DEBUG 0
63 int gdbarch_debug = GDBARCH_DEBUG;
65 show_gdbarch_debug (struct ui_file *file, int from_tty,
66 struct cmd_list_element *c, const char *value)
68 fprintf_filtered (file, _("Architecture debugging is %s.\n"), value);
72 pformat (const struct floatformat **format)
77 /* Just print out one of them - this is only for diagnostics. */
78 return format[0]->name;
82 /* Maintain the struct gdbarch object */
86 /* Has this architecture been fully initialized? */
89 /* An obstack bound to the lifetime of the architecture. */
90 struct obstack *obstack;
92 /* basic architectural information */
93 const struct bfd_arch_info * bfd_arch_info;
96 const struct target_desc * target_desc;
98 /* target specific vector. */
99 struct gdbarch_tdep *tdep;
100 gdbarch_dump_tdep_ftype *dump_tdep;
102 /* per-architecture data-pointers */
106 /* per-architecture swap-regions */
107 struct gdbarch_swap *swap;
109 /* Multi-arch values.
111 When extending this structure you must:
115 Declare set/get functions and define the corresponding
118 gdbarch_alloc(): If zero/NULL is not a suitable default,
119 initialize the new field.
121 verify_gdbarch(): Confirm that the target updated the field
124 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
127 ``startup_gdbarch()'': Append an initial value to the static
128 variable (base values on the host's c-type system).
130 get_gdbarch(): Implement the set/get functions (probably using
131 the macro's as shortcuts).
140 const struct floatformat ** float_format;
142 const struct floatformat ** double_format;
144 const struct floatformat ** long_double_format;
148 gdbarch_read_pc_ftype *read_pc;
149 gdbarch_write_pc_ftype *write_pc;
150 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
151 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
152 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
159 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
160 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
161 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
162 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
163 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
164 gdbarch_register_name_ftype *register_name;
165 gdbarch_register_type_ftype *register_type;
166 gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
167 int deprecated_fp_regnum;
168 gdbarch_push_dummy_call_ftype *push_dummy_call;
169 int deprecated_register_size;
170 int call_dummy_location;
171 gdbarch_push_dummy_code_ftype *push_dummy_code;
172 gdbarch_print_registers_info_ftype *print_registers_info;
173 gdbarch_print_float_info_ftype *print_float_info;
174 gdbarch_print_vector_info_ftype *print_vector_info;
175 gdbarch_register_sim_regno_ftype *register_sim_regno;
176 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
177 gdbarch_cannot_store_register_ftype *cannot_store_register;
178 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
179 int believe_pcc_promotion;
180 gdbarch_convert_register_p_ftype *convert_register_p;
181 gdbarch_register_to_value_ftype *register_to_value;
182 gdbarch_value_to_register_ftype *value_to_register;
183 gdbarch_value_from_register_ftype *value_from_register;
184 gdbarch_pointer_to_address_ftype *pointer_to_address;
185 gdbarch_address_to_pointer_ftype *address_to_pointer;
186 gdbarch_integer_to_address_ftype *integer_to_address;
187 gdbarch_return_value_ftype *return_value;
188 gdbarch_extract_return_value_ftype *extract_return_value;
189 gdbarch_store_return_value_ftype *store_return_value;
190 gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
191 gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
192 gdbarch_skip_prologue_ftype *skip_prologue;
193 gdbarch_inner_than_ftype *inner_than;
194 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
195 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
196 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
197 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
198 CORE_ADDR decr_pc_after_break;
199 CORE_ADDR deprecated_function_start_offset;
200 gdbarch_remote_register_number_ftype *remote_register_number;
201 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
202 CORE_ADDR frame_args_skip;
203 gdbarch_unwind_pc_ftype *unwind_pc;
204 gdbarch_unwind_sp_ftype *unwind_sp;
205 gdbarch_frame_num_args_ftype *frame_num_args;
206 gdbarch_frame_align_ftype *frame_align;
207 gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr;
208 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
209 int frame_red_zone_size;
210 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
211 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
212 gdbarch_smash_text_address_ftype *smash_text_address;
213 gdbarch_software_single_step_ftype *software_single_step;
214 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
215 gdbarch_print_insn_ftype *print_insn;
216 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
217 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
218 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
219 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
220 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
221 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
222 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
223 const char * name_of_malloc;
224 int cannot_step_breakpoint;
225 int have_nonsteppable_watchpoint;
226 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
227 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
228 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
229 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
230 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
231 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
232 int vtable_function_descriptors;
234 gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
235 gdbarch_overlay_update_ftype *overlay_update;
239 /* The default architecture uses host values (for want of a better
242 extern const struct bfd_arch_info bfd_default_arch_struct;
244 struct gdbarch startup_gdbarch =
246 1, /* Always initialized. */
247 NULL, /* The obstack. */
248 /* basic architecture information */
249 &bfd_default_arch_struct, /* bfd_arch_info */
250 BFD_ENDIAN_BIG, /* byte_order */
251 GDB_OSABI_UNKNOWN, /* osabi */
253 /* target specific vector and its dump routine */
255 /*per-architecture data-pointers and swap regions */
257 /* Multi-arch values */
258 8 * sizeof (short), /* short_bit */
259 8 * sizeof (int), /* int_bit */
260 8 * sizeof (long), /* long_bit */
261 8 * sizeof (LONGEST), /* long_long_bit */
262 8 * sizeof (float), /* float_bit */
263 0, /* float_format */
264 8 * sizeof (double), /* double_bit */
265 0, /* double_format */
266 8 * sizeof (long double), /* long_double_bit */
267 0, /* long_double_format */
268 8 * sizeof (void*), /* ptr_bit */
269 8 * sizeof (void*), /* addr_bit */
273 0, /* virtual_frame_pointer */
274 0, /* pseudo_register_read */
275 0, /* pseudo_register_write */
277 0, /* num_pseudo_regs */
282 0, /* stab_reg_to_regnum */
283 0, /* ecoff_reg_to_regnum */
284 0, /* dwarf_reg_to_regnum */
285 0, /* sdb_reg_to_regnum */
286 0, /* dwarf2_reg_to_regnum */
287 0, /* register_name */
288 0, /* register_type */
289 0, /* unwind_dummy_id */
290 -1, /* deprecated_fp_regnum */
291 0, /* push_dummy_call */
292 0, /* deprecated_register_size */
293 0, /* call_dummy_location */
294 0, /* push_dummy_code */
295 default_print_registers_info, /* print_registers_info */
296 0, /* print_float_info */
297 0, /* print_vector_info */
298 0, /* register_sim_regno */
299 0, /* cannot_fetch_register */
300 0, /* cannot_store_register */
301 0, /* get_longjmp_target */
302 0, /* believe_pcc_promotion */
303 0, /* convert_register_p */
304 0, /* register_to_value */
305 0, /* value_to_register */
306 0, /* value_from_register */
307 0, /* pointer_to_address */
308 0, /* address_to_pointer */
309 0, /* integer_to_address */
310 0, /* return_value */
311 0, /* extract_return_value */
312 0, /* store_return_value */
313 0, /* deprecated_use_struct_convention */
314 0, /* deprecated_extract_struct_value_address */
315 0, /* skip_prologue */
317 0, /* breakpoint_from_pc */
318 0, /* adjust_breakpoint_address */
319 0, /* memory_insert_breakpoint */
320 0, /* memory_remove_breakpoint */
321 0, /* decr_pc_after_break */
322 0, /* deprecated_function_start_offset */
323 default_remote_register_number, /* remote_register_number */
324 0, /* fetch_tls_load_module_address */
325 0, /* frame_args_skip */
328 0, /* frame_num_args */
330 0, /* deprecated_reg_struct_has_addr */
331 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
332 0, /* frame_red_zone_size */
333 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
334 0, /* addr_bits_remove */
335 0, /* smash_text_address */
336 0, /* software_single_step */
337 0, /* single_step_through_delay */
339 0, /* skip_trampoline_code */
340 generic_skip_solib_resolver, /* skip_solib_resolver */
341 0, /* in_solib_return_trampoline */
342 generic_in_function_epilogue_p, /* in_function_epilogue_p */
343 construct_inferior_arguments, /* construct_inferior_arguments */
344 0, /* elf_make_msymbol_special */
345 0, /* coff_make_msymbol_special */
346 "malloc", /* name_of_malloc */
347 0, /* cannot_step_breakpoint */
348 0, /* have_nonsteppable_watchpoint */
349 0, /* address_class_type_flags */
350 0, /* address_class_type_flags_to_name */
351 0, /* address_class_name_to_type_flags */
352 default_register_reggroup_p, /* register_reggroup_p */
353 0, /* fetch_pointer_argument */
354 0, /* regset_from_core_section */
355 0, /* vtable_function_descriptors */
356 0, /* vbit_in_delta */
357 0, /* skip_permanent_breakpoint */
358 0, /* overlay_update */
359 /* startup_gdbarch() */
362 struct gdbarch *current_gdbarch = &startup_gdbarch;
364 /* Create a new ``struct gdbarch'' based on information provided by
365 ``struct gdbarch_info''. */
368 gdbarch_alloc (const struct gdbarch_info *info,
369 struct gdbarch_tdep *tdep)
371 /* NOTE: The new architecture variable is named ``current_gdbarch''
372 so that macros such as TARGET_ARCHITECTURE, when expanded, refer to
373 the current local architecture and not the previous global
374 architecture. This ensures that the new architectures initial
375 values are not influenced by the previous architecture. Once
376 everything is parameterised with gdbarch, this will go away. */
377 struct gdbarch *current_gdbarch;
379 /* Create an obstack for allocating all the per-architecture memory,
380 then use that to allocate the architecture vector. */
381 struct obstack *obstack = XMALLOC (struct obstack);
382 obstack_init (obstack);
383 current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch));
384 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
385 current_gdbarch->obstack = obstack;
387 alloc_gdbarch_data (current_gdbarch);
389 current_gdbarch->tdep = tdep;
391 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
392 current_gdbarch->byte_order = info->byte_order;
393 current_gdbarch->osabi = info->osabi;
394 current_gdbarch->target_desc = info->target_desc;
396 /* Force the explicit initialization of these. */
397 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
398 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
399 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
400 current_gdbarch->long_long_bit = 2*current_gdbarch->long_bit;
401 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
402 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
403 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
404 current_gdbarch->ptr_bit = current_gdbarch->int_bit;
405 current_gdbarch->char_signed = -1;
406 current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
407 current_gdbarch->num_regs = -1;
408 current_gdbarch->sp_regnum = -1;
409 current_gdbarch->pc_regnum = -1;
410 current_gdbarch->ps_regnum = -1;
411 current_gdbarch->fp0_regnum = -1;
412 current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
413 current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
414 current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
415 current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
416 current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
417 current_gdbarch->deprecated_fp_regnum = -1;
418 current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
419 current_gdbarch->print_registers_info = default_print_registers_info;
420 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
421 current_gdbarch->cannot_fetch_register = cannot_register_not;
422 current_gdbarch->cannot_store_register = cannot_register_not;
423 current_gdbarch->convert_register_p = generic_convert_register_p;
424 current_gdbarch->value_from_register = default_value_from_register;
425 current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
426 current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
427 current_gdbarch->return_value = legacy_return_value;
428 current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
429 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
430 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
431 current_gdbarch->remote_register_number = default_remote_register_number;
432 current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
433 current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
434 current_gdbarch->addr_bits_remove = core_addr_identity;
435 current_gdbarch->smash_text_address = core_addr_identity;
436 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
437 current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
438 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
439 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
440 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
441 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
442 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
443 current_gdbarch->name_of_malloc = "malloc";
444 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
445 /* gdbarch_alloc() */
447 return current_gdbarch;
451 /* Allocate extra space using the per-architecture obstack. */
454 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
456 void *data = obstack_alloc (arch->obstack, size);
457 memset (data, 0, size);
462 /* Free a gdbarch struct. This should never happen in normal
463 operation --- once you've created a gdbarch, you keep it around.
464 However, if an architecture's init function encounters an error
465 building the structure, it may need to clean up a partially
466 constructed gdbarch. */
469 gdbarch_free (struct gdbarch *arch)
471 struct obstack *obstack;
472 gdb_assert (arch != NULL);
473 gdb_assert (!arch->initialized_p);
474 obstack = arch->obstack;
475 obstack_free (obstack, 0); /* Includes the ARCH. */
480 /* Ensure that all values in a GDBARCH are reasonable. */
482 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
483 just happens to match the global variable ``current_gdbarch''. That
484 way macros refering to that variable get the local and not the global
485 version - ulgh. Once everything is parameterised with gdbarch, this
489 verify_gdbarch (struct gdbarch *current_gdbarch)
492 struct cleanup *cleanups;
495 log = mem_fileopen ();
496 cleanups = make_cleanup_ui_file_delete (log);
498 if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
499 fprintf_unfiltered (log, "\n\tbyte-order");
500 if (current_gdbarch->bfd_arch_info == NULL)
501 fprintf_unfiltered (log, "\n\tbfd_arch_info");
502 /* Check those that need to be defined for the given multi-arch level. */
503 /* Skip verify of short_bit, invalid_p == 0 */
504 /* Skip verify of int_bit, invalid_p == 0 */
505 /* Skip verify of long_bit, invalid_p == 0 */
506 /* Skip verify of long_long_bit, invalid_p == 0 */
507 /* Skip verify of float_bit, invalid_p == 0 */
508 if (current_gdbarch->float_format == 0)
509 current_gdbarch->float_format = floatformats_ieee_single;
510 /* Skip verify of double_bit, invalid_p == 0 */
511 if (current_gdbarch->double_format == 0)
512 current_gdbarch->double_format = floatformats_ieee_double;
513 /* Skip verify of long_double_bit, invalid_p == 0 */
514 if (current_gdbarch->long_double_format == 0)
515 current_gdbarch->long_double_format = floatformats_ieee_double;
516 /* Skip verify of ptr_bit, invalid_p == 0 */
517 if (current_gdbarch->addr_bit == 0)
518 current_gdbarch->addr_bit = gdbarch_ptr_bit (current_gdbarch);
519 if (current_gdbarch->char_signed == -1)
520 current_gdbarch->char_signed = 1;
521 /* Skip verify of read_pc, has predicate */
522 /* Skip verify of write_pc, has predicate */
523 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
524 /* Skip verify of pseudo_register_read, has predicate */
525 /* Skip verify of pseudo_register_write, has predicate */
526 if (current_gdbarch->num_regs == -1)
527 fprintf_unfiltered (log, "\n\tnum_regs");
528 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
529 /* Skip verify of sp_regnum, invalid_p == 0 */
530 /* Skip verify of pc_regnum, invalid_p == 0 */
531 /* Skip verify of ps_regnum, invalid_p == 0 */
532 /* Skip verify of fp0_regnum, invalid_p == 0 */
533 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
534 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
535 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
536 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
537 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
538 /* Skip verify of register_type, has predicate */
539 /* Skip verify of unwind_dummy_id, has predicate */
540 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
541 /* Skip verify of push_dummy_call, has predicate */
542 /* Skip verify of call_dummy_location, invalid_p == 0 */
543 /* Skip verify of push_dummy_code, has predicate */
544 /* Skip verify of print_registers_info, invalid_p == 0 */
545 /* Skip verify of print_float_info, has predicate */
546 /* Skip verify of print_vector_info, has predicate */
547 /* Skip verify of register_sim_regno, invalid_p == 0 */
548 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
549 /* Skip verify of cannot_store_register, invalid_p == 0 */
550 /* Skip verify of get_longjmp_target, has predicate */
551 /* Skip verify of convert_register_p, invalid_p == 0 */
552 /* Skip verify of value_from_register, invalid_p == 0 */
553 /* Skip verify of pointer_to_address, invalid_p == 0 */
554 /* Skip verify of address_to_pointer, invalid_p == 0 */
555 /* Skip verify of integer_to_address, has predicate */
556 /* Skip verify of return_value, has predicate */
557 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
558 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
559 if (current_gdbarch->skip_prologue == 0)
560 fprintf_unfiltered (log, "\n\tskip_prologue");
561 if (current_gdbarch->inner_than == 0)
562 fprintf_unfiltered (log, "\n\tinner_than");
563 if (current_gdbarch->breakpoint_from_pc == 0)
564 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
565 /* Skip verify of adjust_breakpoint_address, has predicate */
566 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
567 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
568 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
569 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
570 /* Skip verify of remote_register_number, invalid_p == 0 */
571 /* Skip verify of fetch_tls_load_module_address, has predicate */
572 /* Skip verify of frame_args_skip, invalid_p == 0 */
573 /* Skip verify of unwind_pc, has predicate */
574 /* Skip verify of unwind_sp, has predicate */
575 /* Skip verify of frame_num_args, has predicate */
576 /* Skip verify of frame_align, has predicate */
577 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
578 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
579 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
580 /* Skip verify of addr_bits_remove, invalid_p == 0 */
581 /* Skip verify of smash_text_address, invalid_p == 0 */
582 /* Skip verify of software_single_step, has predicate */
583 /* Skip verify of single_step_through_delay, has predicate */
584 if (current_gdbarch->print_insn == 0)
585 fprintf_unfiltered (log, "\n\tprint_insn");
586 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
587 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
588 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
589 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
590 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
591 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
592 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
593 /* Skip verify of name_of_malloc, invalid_p == 0 */
594 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
595 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
596 /* Skip verify of address_class_type_flags, has predicate */
597 /* Skip verify of address_class_type_flags_to_name, has predicate */
598 /* Skip verify of address_class_name_to_type_flags, has predicate */
599 /* Skip verify of register_reggroup_p, invalid_p == 0 */
600 /* Skip verify of fetch_pointer_argument, has predicate */
601 /* Skip verify of regset_from_core_section, has predicate */
602 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
603 /* Skip verify of vbit_in_delta, invalid_p == 0 */
604 /* Skip verify of skip_permanent_breakpoint, has predicate */
605 /* Skip verify of overlay_update, has predicate */
606 buf = ui_file_xstrdup (log, &dummy);
607 make_cleanup (xfree, buf);
608 if (strlen (buf) > 0)
609 internal_error (__FILE__, __LINE__,
610 _("verify_gdbarch: the following are invalid ...%s"),
612 do_cleanups (cleanups);
616 /* Print out the details of the current architecture. */
618 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
619 just happens to match the global variable ``current_gdbarch''. That
620 way macros refering to that variable get the local and not the global
621 version - ulgh. Once everything is parameterised with gdbarch, this
625 gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
627 const char *gdb_xm_file = "<not-defined>";
628 const char *gdb_nm_file = "<not-defined>";
629 const char *gdb_tm_file = "<not-defined>";
630 #if defined (GDB_XM_FILE)
631 gdb_xm_file = GDB_XM_FILE;
633 fprintf_unfiltered (file,
634 "gdbarch_dump: GDB_XM_FILE = %s\n",
636 #if defined (GDB_NM_FILE)
637 gdb_nm_file = GDB_NM_FILE;
639 fprintf_unfiltered (file,
640 "gdbarch_dump: GDB_NM_FILE = %s\n",
642 #if defined (GDB_TM_FILE)
643 gdb_tm_file = GDB_TM_FILE;
645 fprintf_unfiltered (file,
646 "gdbarch_dump: GDB_TM_FILE = %s\n",
648 fprintf_unfiltered (file,
649 "gdbarch_dump: addr_bit = %s\n",
650 paddr_d (current_gdbarch->addr_bit));
651 fprintf_unfiltered (file,
652 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
653 (long) current_gdbarch->addr_bits_remove);
654 fprintf_unfiltered (file,
655 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
656 gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
657 fprintf_unfiltered (file,
658 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
659 (long) current_gdbarch->address_class_name_to_type_flags);
660 fprintf_unfiltered (file,
661 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
662 gdbarch_address_class_type_flags_p (current_gdbarch));
663 fprintf_unfiltered (file,
664 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
665 (long) current_gdbarch->address_class_type_flags);
666 fprintf_unfiltered (file,
667 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
668 gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
669 fprintf_unfiltered (file,
670 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
671 (long) current_gdbarch->address_class_type_flags_to_name);
672 fprintf_unfiltered (file,
673 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
674 (long) current_gdbarch->address_to_pointer);
675 fprintf_unfiltered (file,
676 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
677 gdbarch_adjust_breakpoint_address_p (current_gdbarch));
678 fprintf_unfiltered (file,
679 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
680 (long) current_gdbarch->adjust_breakpoint_address);
681 #ifdef BELIEVE_PCC_PROMOTION
682 fprintf_unfiltered (file,
683 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
684 XSTRING (BELIEVE_PCC_PROMOTION));
686 fprintf_unfiltered (file,
687 "gdbarch_dump: believe_pcc_promotion = %s\n",
688 paddr_d (current_gdbarch->believe_pcc_promotion));
689 fprintf_unfiltered (file,
690 "gdbarch_dump: bfd_arch_info = %s\n",
691 gdbarch_bfd_arch_info (current_gdbarch)->printable_name);
692 fprintf_unfiltered (file,
693 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
694 (long) current_gdbarch->breakpoint_from_pc);
695 fprintf_unfiltered (file,
696 "gdbarch_dump: byte_order = %s\n",
697 paddr_d (current_gdbarch->byte_order));
698 fprintf_unfiltered (file,
699 "gdbarch_dump: call_dummy_location = %s\n",
700 paddr_d (current_gdbarch->call_dummy_location));
701 fprintf_unfiltered (file,
702 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
703 (long) current_gdbarch->cannot_fetch_register);
704 fprintf_unfiltered (file,
705 "gdbarch_dump: cannot_step_breakpoint = %s\n",
706 paddr_d (current_gdbarch->cannot_step_breakpoint));
707 fprintf_unfiltered (file,
708 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
709 (long) current_gdbarch->cannot_store_register);
710 fprintf_unfiltered (file,
711 "gdbarch_dump: char_signed = %s\n",
712 paddr_d (current_gdbarch->char_signed));
713 fprintf_unfiltered (file,
714 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
715 (long) current_gdbarch->coff_make_msymbol_special);
716 fprintf_unfiltered (file,
717 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
718 (long) current_gdbarch->construct_inferior_arguments);
719 fprintf_unfiltered (file,
720 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
721 (long) current_gdbarch->convert_from_func_ptr_addr);
722 fprintf_unfiltered (file,
723 "gdbarch_dump: convert_register_p = <0x%lx>\n",
724 (long) current_gdbarch->convert_register_p);
725 fprintf_unfiltered (file,
726 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
727 paddr_nz (current_gdbarch->decr_pc_after_break));
728 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
729 fprintf_unfiltered (file,
730 "gdbarch_dump: %s # %s\n",
731 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
732 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
734 fprintf_unfiltered (file,
735 "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
736 gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch));
737 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
738 fprintf_unfiltered (file,
739 "gdbarch_dump: %s # %s\n",
740 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
741 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
743 fprintf_unfiltered (file,
744 "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
745 (long) current_gdbarch->deprecated_extract_struct_value_address);
746 #ifdef DEPRECATED_FP_REGNUM
747 fprintf_unfiltered (file,
748 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
749 XSTRING (DEPRECATED_FP_REGNUM));
751 fprintf_unfiltered (file,
752 "gdbarch_dump: deprecated_fp_regnum = %s\n",
753 paddr_d (current_gdbarch->deprecated_fp_regnum));
754 #ifdef DEPRECATED_FUNCTION_START_OFFSET
755 fprintf_unfiltered (file,
756 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
757 XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
759 fprintf_unfiltered (file,
760 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
761 paddr_nz (current_gdbarch->deprecated_function_start_offset));
762 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
763 fprintf_unfiltered (file,
764 "gdbarch_dump: %s # %s\n",
765 "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
766 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
768 fprintf_unfiltered (file,
769 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
770 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch));
771 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
772 fprintf_unfiltered (file,
773 "gdbarch_dump: %s # %s\n",
774 "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
775 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
777 fprintf_unfiltered (file,
778 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
779 (long) current_gdbarch->deprecated_reg_struct_has_addr);
780 #ifdef DEPRECATED_REGISTER_SIZE
781 fprintf_unfiltered (file,
782 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
783 XSTRING (DEPRECATED_REGISTER_SIZE));
785 fprintf_unfiltered (file,
786 "gdbarch_dump: deprecated_register_size = %s\n",
787 paddr_d (current_gdbarch->deprecated_register_size));
788 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
789 fprintf_unfiltered (file,
790 "gdbarch_dump: %s # %s\n",
791 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
792 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type)));
794 fprintf_unfiltered (file,
795 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
796 (long) current_gdbarch->deprecated_use_struct_convention);
797 fprintf_unfiltered (file,
798 "gdbarch_dump: double_bit = %s\n",
799 paddr_d (current_gdbarch->double_bit));
800 fprintf_unfiltered (file,
801 "gdbarch_dump: double_format = %s\n",
802 pformat (current_gdbarch->double_format));
803 fprintf_unfiltered (file,
804 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
805 (long) current_gdbarch->dwarf2_reg_to_regnum);
806 fprintf_unfiltered (file,
807 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
808 (long) current_gdbarch->dwarf_reg_to_regnum);
809 fprintf_unfiltered (file,
810 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
811 (long) current_gdbarch->ecoff_reg_to_regnum);
812 fprintf_unfiltered (file,
813 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
814 (long) current_gdbarch->elf_make_msymbol_special);
815 #ifdef EXTRACT_RETURN_VALUE
816 fprintf_unfiltered (file,
817 "gdbarch_dump: %s # %s\n",
818 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
819 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
821 fprintf_unfiltered (file,
822 "gdbarch_dump: extract_return_value = <0x%lx>\n",
823 (long) current_gdbarch->extract_return_value);
824 fprintf_unfiltered (file,
825 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
826 gdbarch_fetch_pointer_argument_p (current_gdbarch));
827 fprintf_unfiltered (file,
828 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
829 (long) current_gdbarch->fetch_pointer_argument);
830 fprintf_unfiltered (file,
831 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
832 gdbarch_fetch_tls_load_module_address_p (current_gdbarch));
833 fprintf_unfiltered (file,
834 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
835 (long) current_gdbarch->fetch_tls_load_module_address);
836 fprintf_unfiltered (file,
837 "gdbarch_dump: float_bit = %s\n",
838 paddr_d (current_gdbarch->float_bit));
839 fprintf_unfiltered (file,
840 "gdbarch_dump: float_format = %s\n",
841 pformat (current_gdbarch->float_format));
843 fprintf_unfiltered (file,
844 "gdbarch_dump: FP0_REGNUM # %s\n",
845 XSTRING (FP0_REGNUM));
847 fprintf_unfiltered (file,
848 "gdbarch_dump: fp0_regnum = %s\n",
849 paddr_d (current_gdbarch->fp0_regnum));
850 fprintf_unfiltered (file,
851 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
852 gdbarch_frame_align_p (current_gdbarch));
853 fprintf_unfiltered (file,
854 "gdbarch_dump: frame_align = <0x%lx>\n",
855 (long) current_gdbarch->frame_align);
856 fprintf_unfiltered (file,
857 "gdbarch_dump: frame_args_skip = 0x%s\n",
858 paddr_nz (current_gdbarch->frame_args_skip));
859 fprintf_unfiltered (file,
860 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
861 gdbarch_frame_num_args_p (current_gdbarch));
862 fprintf_unfiltered (file,
863 "gdbarch_dump: frame_num_args = <0x%lx>\n",
864 (long) current_gdbarch->frame_num_args);
865 fprintf_unfiltered (file,
866 "gdbarch_dump: frame_red_zone_size = %s\n",
867 paddr_d (current_gdbarch->frame_red_zone_size));
868 fprintf_unfiltered (file,
869 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
870 gdbarch_get_longjmp_target_p (current_gdbarch));
871 fprintf_unfiltered (file,
872 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
873 (long) current_gdbarch->get_longjmp_target);
874 fprintf_unfiltered (file,
875 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
876 paddr_d (current_gdbarch->have_nonsteppable_watchpoint));
877 fprintf_unfiltered (file,
878 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
879 (long) current_gdbarch->in_function_epilogue_p);
880 fprintf_unfiltered (file,
881 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
882 (long) current_gdbarch->in_solib_return_trampoline);
883 fprintf_unfiltered (file,
884 "gdbarch_dump: inner_than = <0x%lx>\n",
885 (long) current_gdbarch->inner_than);
886 fprintf_unfiltered (file,
887 "gdbarch_dump: int_bit = %s\n",
888 paddr_d (current_gdbarch->int_bit));
889 fprintf_unfiltered (file,
890 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
891 gdbarch_integer_to_address_p (current_gdbarch));
892 fprintf_unfiltered (file,
893 "gdbarch_dump: integer_to_address = <0x%lx>\n",
894 (long) current_gdbarch->integer_to_address);
895 fprintf_unfiltered (file,
896 "gdbarch_dump: long_bit = %s\n",
897 paddr_d (current_gdbarch->long_bit));
898 fprintf_unfiltered (file,
899 "gdbarch_dump: long_double_bit = %s\n",
900 paddr_d (current_gdbarch->long_double_bit));
901 fprintf_unfiltered (file,
902 "gdbarch_dump: long_double_format = %s\n",
903 pformat (current_gdbarch->long_double_format));
904 fprintf_unfiltered (file,
905 "gdbarch_dump: long_long_bit = %s\n",
906 paddr_d (current_gdbarch->long_long_bit));
907 fprintf_unfiltered (file,
908 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
909 (long) current_gdbarch->memory_insert_breakpoint);
910 fprintf_unfiltered (file,
911 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
912 (long) current_gdbarch->memory_remove_breakpoint);
913 fprintf_unfiltered (file,
914 "gdbarch_dump: name_of_malloc = %s\n",
915 current_gdbarch->name_of_malloc);
916 fprintf_unfiltered (file,
917 "gdbarch_dump: num_pseudo_regs = %s\n",
918 paddr_d (current_gdbarch->num_pseudo_regs));
919 fprintf_unfiltered (file,
920 "gdbarch_dump: num_regs = %s\n",
921 paddr_d (current_gdbarch->num_regs));
922 fprintf_unfiltered (file,
923 "gdbarch_dump: osabi = %s\n",
924 paddr_d (current_gdbarch->osabi));
925 fprintf_unfiltered (file,
926 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
927 gdbarch_overlay_update_p (current_gdbarch));
928 fprintf_unfiltered (file,
929 "gdbarch_dump: overlay_update = <0x%lx>\n",
930 (long) current_gdbarch->overlay_update);
932 fprintf_unfiltered (file,
933 "gdbarch_dump: PC_REGNUM # %s\n",
934 XSTRING (PC_REGNUM));
936 fprintf_unfiltered (file,
937 "gdbarch_dump: pc_regnum = %s\n",
938 paddr_d (current_gdbarch->pc_regnum));
939 fprintf_unfiltered (file,
940 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
941 (long) current_gdbarch->pointer_to_address);
942 fprintf_unfiltered (file,
943 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
944 gdbarch_print_float_info_p (current_gdbarch));
945 fprintf_unfiltered (file,
946 "gdbarch_dump: print_float_info = <0x%lx>\n",
947 (long) current_gdbarch->print_float_info);
948 #ifdef TARGET_PRINT_INSN
949 fprintf_unfiltered (file,
950 "gdbarch_dump: %s # %s\n",
951 "TARGET_PRINT_INSN(vma, info)",
952 XSTRING (TARGET_PRINT_INSN (vma, info)));
954 fprintf_unfiltered (file,
955 "gdbarch_dump: print_insn = <0x%lx>\n",
956 (long) current_gdbarch->print_insn);
957 fprintf_unfiltered (file,
958 "gdbarch_dump: print_registers_info = <0x%lx>\n",
959 (long) current_gdbarch->print_registers_info);
960 fprintf_unfiltered (file,
961 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
962 gdbarch_print_vector_info_p (current_gdbarch));
963 fprintf_unfiltered (file,
964 "gdbarch_dump: print_vector_info = <0x%lx>\n",
965 (long) current_gdbarch->print_vector_info);
967 fprintf_unfiltered (file,
968 "gdbarch_dump: PS_REGNUM # %s\n",
969 XSTRING (PS_REGNUM));
971 fprintf_unfiltered (file,
972 "gdbarch_dump: ps_regnum = %s\n",
973 paddr_d (current_gdbarch->ps_regnum));
974 fprintf_unfiltered (file,
975 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
976 gdbarch_pseudo_register_read_p (current_gdbarch));
977 fprintf_unfiltered (file,
978 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
979 (long) current_gdbarch->pseudo_register_read);
980 fprintf_unfiltered (file,
981 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
982 gdbarch_pseudo_register_write_p (current_gdbarch));
983 fprintf_unfiltered (file,
984 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
985 (long) current_gdbarch->pseudo_register_write);
986 fprintf_unfiltered (file,
987 "gdbarch_dump: ptr_bit = %s\n",
988 paddr_d (current_gdbarch->ptr_bit));
989 fprintf_unfiltered (file,
990 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
991 gdbarch_push_dummy_call_p (current_gdbarch));
992 fprintf_unfiltered (file,
993 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
994 (long) current_gdbarch->push_dummy_call);
995 fprintf_unfiltered (file,
996 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
997 gdbarch_push_dummy_code_p (current_gdbarch));
998 fprintf_unfiltered (file,
999 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
1000 (long) current_gdbarch->push_dummy_code);
1001 fprintf_unfiltered (file,
1002 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1003 gdbarch_read_pc_p (current_gdbarch));
1004 fprintf_unfiltered (file,
1005 "gdbarch_dump: read_pc = <0x%lx>\n",
1006 (long) current_gdbarch->read_pc);
1007 fprintf_unfiltered (file,
1008 "gdbarch_dump: register_name = <0x%lx>\n",
1009 (long) current_gdbarch->register_name);
1010 fprintf_unfiltered (file,
1011 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
1012 (long) current_gdbarch->register_reggroup_p);
1013 fprintf_unfiltered (file,
1014 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
1015 (long) current_gdbarch->register_sim_regno);
1016 fprintf_unfiltered (file,
1017 "gdbarch_dump: register_to_value = <0x%lx>\n",
1018 (long) current_gdbarch->register_to_value);
1019 fprintf_unfiltered (file,
1020 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1021 gdbarch_register_type_p (current_gdbarch));
1022 fprintf_unfiltered (file,
1023 "gdbarch_dump: register_type = <0x%lx>\n",
1024 (long) current_gdbarch->register_type);
1025 fprintf_unfiltered (file,
1026 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1027 gdbarch_regset_from_core_section_p (current_gdbarch));
1028 fprintf_unfiltered (file,
1029 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
1030 (long) current_gdbarch->regset_from_core_section);
1031 fprintf_unfiltered (file,
1032 "gdbarch_dump: remote_register_number = <0x%lx>\n",
1033 (long) current_gdbarch->remote_register_number);
1034 fprintf_unfiltered (file,
1035 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1036 gdbarch_return_value_p (current_gdbarch));
1037 fprintf_unfiltered (file,
1038 "gdbarch_dump: return_value = <0x%lx>\n",
1039 (long) current_gdbarch->return_value);
1040 fprintf_unfiltered (file,
1041 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1042 (long) current_gdbarch->sdb_reg_to_regnum);
1043 fprintf_unfiltered (file,
1044 "gdbarch_dump: short_bit = %s\n",
1045 paddr_d (current_gdbarch->short_bit));
1046 fprintf_unfiltered (file,
1047 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1048 gdbarch_single_step_through_delay_p (current_gdbarch));
1049 fprintf_unfiltered (file,
1050 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
1051 (long) current_gdbarch->single_step_through_delay);
1052 fprintf_unfiltered (file,
1053 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1054 gdbarch_skip_permanent_breakpoint_p (current_gdbarch));
1055 fprintf_unfiltered (file,
1056 "gdbarch_dump: skip_permanent_breakpoint = <0x%lx>\n",
1057 (long) current_gdbarch->skip_permanent_breakpoint);
1058 fprintf_unfiltered (file,
1059 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1060 (long) current_gdbarch->skip_prologue);
1061 fprintf_unfiltered (file,
1062 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1063 (long) current_gdbarch->skip_solib_resolver);
1064 fprintf_unfiltered (file,
1065 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1066 (long) current_gdbarch->skip_trampoline_code);
1067 fprintf_unfiltered (file,
1068 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1069 (long) current_gdbarch->smash_text_address);
1070 #ifdef SOFTWARE_SINGLE_STEP_P
1071 fprintf_unfiltered (file,
1072 "gdbarch_dump: %s # %s\n",
1073 "SOFTWARE_SINGLE_STEP_P()",
1074 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1076 fprintf_unfiltered (file,
1077 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1078 gdbarch_software_single_step_p (current_gdbarch));
1079 #ifdef SOFTWARE_SINGLE_STEP
1080 fprintf_unfiltered (file,
1081 "gdbarch_dump: %s # %s\n",
1082 "SOFTWARE_SINGLE_STEP(frame)",
1083 XSTRING (SOFTWARE_SINGLE_STEP (frame)));
1085 fprintf_unfiltered (file,
1086 "gdbarch_dump: software_single_step = <0x%lx>\n",
1087 (long) current_gdbarch->software_single_step);
1089 fprintf_unfiltered (file,
1090 "gdbarch_dump: SP_REGNUM # %s\n",
1091 XSTRING (SP_REGNUM));
1093 fprintf_unfiltered (file,
1094 "gdbarch_dump: sp_regnum = %s\n",
1095 paddr_d (current_gdbarch->sp_regnum));
1096 fprintf_unfiltered (file,
1097 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1098 (long) current_gdbarch->stab_reg_to_regnum);
1099 fprintf_unfiltered (file,
1100 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1101 (long) current_gdbarch->stabs_argument_has_addr);
1102 #ifdef STORE_RETURN_VALUE
1103 fprintf_unfiltered (file,
1104 "gdbarch_dump: %s # %s\n",
1105 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1106 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
1108 fprintf_unfiltered (file,
1109 "gdbarch_dump: store_return_value = <0x%lx>\n",
1110 (long) current_gdbarch->store_return_value);
1111 fprintf_unfiltered (file,
1112 "gdbarch_dump: target_desc = %s\n",
1113 paddr_d ((long) current_gdbarch->target_desc));
1114 fprintf_unfiltered (file,
1115 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1116 gdbarch_unwind_dummy_id_p (current_gdbarch));
1117 fprintf_unfiltered (file,
1118 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1119 (long) current_gdbarch->unwind_dummy_id);
1120 fprintf_unfiltered (file,
1121 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1122 gdbarch_unwind_pc_p (current_gdbarch));
1123 fprintf_unfiltered (file,
1124 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1125 (long) current_gdbarch->unwind_pc);
1126 fprintf_unfiltered (file,
1127 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1128 gdbarch_unwind_sp_p (current_gdbarch));
1129 fprintf_unfiltered (file,
1130 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1131 (long) current_gdbarch->unwind_sp);
1132 fprintf_unfiltered (file,
1133 "gdbarch_dump: value_from_register = <0x%lx>\n",
1134 (long) current_gdbarch->value_from_register);
1135 fprintf_unfiltered (file,
1136 "gdbarch_dump: value_to_register = <0x%lx>\n",
1137 (long) current_gdbarch->value_to_register);
1138 fprintf_unfiltered (file,
1139 "gdbarch_dump: vbit_in_delta = %s\n",
1140 paddr_d (current_gdbarch->vbit_in_delta));
1141 fprintf_unfiltered (file,
1142 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1143 (long) current_gdbarch->virtual_frame_pointer);
1144 fprintf_unfiltered (file,
1145 "gdbarch_dump: vtable_function_descriptors = %s\n",
1146 paddr_d (current_gdbarch->vtable_function_descriptors));
1147 fprintf_unfiltered (file,
1148 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1149 gdbarch_write_pc_p (current_gdbarch));
1150 fprintf_unfiltered (file,
1151 "gdbarch_dump: write_pc = <0x%lx>\n",
1152 (long) current_gdbarch->write_pc);
1153 if (current_gdbarch->dump_tdep != NULL)
1154 current_gdbarch->dump_tdep (current_gdbarch, file);
1157 struct gdbarch_tdep *
1158 gdbarch_tdep (struct gdbarch *gdbarch)
1160 if (gdbarch_debug >= 2)
1161 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1162 return gdbarch->tdep;
1166 const struct bfd_arch_info *
1167 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1169 gdb_assert (gdbarch != NULL);
1170 if (gdbarch_debug >= 2)
1171 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1172 return gdbarch->bfd_arch_info;
1176 gdbarch_byte_order (struct gdbarch *gdbarch)
1178 gdb_assert (gdbarch != NULL);
1179 if (gdbarch_debug >= 2)
1180 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1181 return gdbarch->byte_order;
1185 gdbarch_osabi (struct gdbarch *gdbarch)
1187 gdb_assert (gdbarch != NULL);
1188 if (gdbarch_debug >= 2)
1189 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1190 return gdbarch->osabi;
1193 const struct target_desc *
1194 gdbarch_target_desc (struct gdbarch *gdbarch)
1196 gdb_assert (gdbarch != NULL);
1197 if (gdbarch_debug >= 2)
1198 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1199 return gdbarch->target_desc;
1203 gdbarch_short_bit (struct gdbarch *gdbarch)
1205 gdb_assert (gdbarch != NULL);
1206 /* Skip verify of short_bit, invalid_p == 0 */
1207 if (gdbarch_debug >= 2)
1208 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1209 return gdbarch->short_bit;
1213 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1216 gdbarch->short_bit = short_bit;
1220 gdbarch_int_bit (struct gdbarch *gdbarch)
1222 gdb_assert (gdbarch != NULL);
1223 /* Skip verify of int_bit, invalid_p == 0 */
1224 if (gdbarch_debug >= 2)
1225 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1226 return gdbarch->int_bit;
1230 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1233 gdbarch->int_bit = int_bit;
1237 gdbarch_long_bit (struct gdbarch *gdbarch)
1239 gdb_assert (gdbarch != NULL);
1240 /* Skip verify of long_bit, invalid_p == 0 */
1241 if (gdbarch_debug >= 2)
1242 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1243 return gdbarch->long_bit;
1247 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1250 gdbarch->long_bit = long_bit;
1254 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1256 gdb_assert (gdbarch != NULL);
1257 /* Skip verify of long_long_bit, invalid_p == 0 */
1258 if (gdbarch_debug >= 2)
1259 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1260 return gdbarch->long_long_bit;
1264 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1267 gdbarch->long_long_bit = long_long_bit;
1271 gdbarch_float_bit (struct gdbarch *gdbarch)
1273 gdb_assert (gdbarch != NULL);
1274 /* Skip verify of float_bit, invalid_p == 0 */
1275 if (gdbarch_debug >= 2)
1276 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1277 return gdbarch->float_bit;
1281 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1284 gdbarch->float_bit = float_bit;
1287 const struct floatformat **
1288 gdbarch_float_format (struct gdbarch *gdbarch)
1290 gdb_assert (gdbarch != NULL);
1291 if (gdbarch_debug >= 2)
1292 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1293 return gdbarch->float_format;
1297 set_gdbarch_float_format (struct gdbarch *gdbarch,
1298 const struct floatformat ** float_format)
1300 gdbarch->float_format = float_format;
1304 gdbarch_double_bit (struct gdbarch *gdbarch)
1306 gdb_assert (gdbarch != NULL);
1307 /* Skip verify of double_bit, invalid_p == 0 */
1308 if (gdbarch_debug >= 2)
1309 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1310 return gdbarch->double_bit;
1314 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1317 gdbarch->double_bit = double_bit;
1320 const struct floatformat **
1321 gdbarch_double_format (struct gdbarch *gdbarch)
1323 gdb_assert (gdbarch != NULL);
1324 if (gdbarch_debug >= 2)
1325 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1326 return gdbarch->double_format;
1330 set_gdbarch_double_format (struct gdbarch *gdbarch,
1331 const struct floatformat ** double_format)
1333 gdbarch->double_format = double_format;
1337 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1339 gdb_assert (gdbarch != NULL);
1340 /* Skip verify of long_double_bit, invalid_p == 0 */
1341 if (gdbarch_debug >= 2)
1342 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1343 return gdbarch->long_double_bit;
1347 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1348 int long_double_bit)
1350 gdbarch->long_double_bit = long_double_bit;
1353 const struct floatformat **
1354 gdbarch_long_double_format (struct gdbarch *gdbarch)
1356 gdb_assert (gdbarch != NULL);
1357 if (gdbarch_debug >= 2)
1358 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1359 return gdbarch->long_double_format;
1363 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1364 const struct floatformat ** long_double_format)
1366 gdbarch->long_double_format = long_double_format;
1370 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1372 gdb_assert (gdbarch != NULL);
1373 /* Skip verify of ptr_bit, invalid_p == 0 */
1374 if (gdbarch_debug >= 2)
1375 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1376 return gdbarch->ptr_bit;
1380 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1383 gdbarch->ptr_bit = ptr_bit;
1387 gdbarch_addr_bit (struct gdbarch *gdbarch)
1389 gdb_assert (gdbarch != NULL);
1390 /* Check variable changed from pre-default. */
1391 gdb_assert (gdbarch->addr_bit != 0);
1392 if (gdbarch_debug >= 2)
1393 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1394 return gdbarch->addr_bit;
1398 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1401 gdbarch->addr_bit = addr_bit;
1405 gdbarch_char_signed (struct gdbarch *gdbarch)
1407 gdb_assert (gdbarch != NULL);
1408 /* Check variable changed from pre-default. */
1409 gdb_assert (gdbarch->char_signed != -1);
1410 if (gdbarch_debug >= 2)
1411 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1412 return gdbarch->char_signed;
1416 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1419 gdbarch->char_signed = char_signed;
1423 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1425 gdb_assert (gdbarch != NULL);
1426 return gdbarch->read_pc != NULL;
1430 gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache)
1432 gdb_assert (gdbarch != NULL);
1433 gdb_assert (gdbarch->read_pc != NULL);
1434 if (gdbarch_debug >= 2)
1435 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1436 return gdbarch->read_pc (regcache);
1440 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1441 gdbarch_read_pc_ftype read_pc)
1443 gdbarch->read_pc = read_pc;
1447 gdbarch_write_pc_p (struct gdbarch *gdbarch)
1449 gdb_assert (gdbarch != NULL);
1450 return gdbarch->write_pc != NULL;
1454 gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val)
1456 gdb_assert (gdbarch != NULL);
1457 gdb_assert (gdbarch->write_pc != NULL);
1458 if (gdbarch_debug >= 2)
1459 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1460 gdbarch->write_pc (regcache, val);
1464 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1465 gdbarch_write_pc_ftype write_pc)
1467 gdbarch->write_pc = write_pc;
1471 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1473 gdb_assert (gdbarch != NULL);
1474 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1475 if (gdbarch_debug >= 2)
1476 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1477 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
1481 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1482 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1484 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1488 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1490 gdb_assert (gdbarch != NULL);
1491 return gdbarch->pseudo_register_read != NULL;
1495 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
1497 gdb_assert (gdbarch != NULL);
1498 gdb_assert (gdbarch->pseudo_register_read != NULL);
1499 if (gdbarch_debug >= 2)
1500 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1501 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1505 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1506 gdbarch_pseudo_register_read_ftype pseudo_register_read)
1508 gdbarch->pseudo_register_read = pseudo_register_read;
1512 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
1514 gdb_assert (gdbarch != NULL);
1515 return gdbarch->pseudo_register_write != NULL;
1519 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
1521 gdb_assert (gdbarch != NULL);
1522 gdb_assert (gdbarch->pseudo_register_write != NULL);
1523 if (gdbarch_debug >= 2)
1524 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1525 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
1529 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1530 gdbarch_pseudo_register_write_ftype pseudo_register_write)
1532 gdbarch->pseudo_register_write = pseudo_register_write;
1536 gdbarch_num_regs (struct gdbarch *gdbarch)
1538 gdb_assert (gdbarch != NULL);
1539 /* Check variable changed from pre-default. */
1540 gdb_assert (gdbarch->num_regs != -1);
1541 if (gdbarch_debug >= 2)
1542 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1543 return gdbarch->num_regs;
1547 set_gdbarch_num_regs (struct gdbarch *gdbarch,
1550 gdbarch->num_regs = num_regs;
1554 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
1556 gdb_assert (gdbarch != NULL);
1557 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1558 if (gdbarch_debug >= 2)
1559 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
1560 return gdbarch->num_pseudo_regs;
1564 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
1565 int num_pseudo_regs)
1567 gdbarch->num_pseudo_regs = num_pseudo_regs;
1571 gdbarch_sp_regnum (struct gdbarch *gdbarch)
1573 gdb_assert (gdbarch != NULL);
1574 /* Skip verify of sp_regnum, invalid_p == 0 */
1575 if (gdbarch_debug >= 2)
1576 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
1577 return gdbarch->sp_regnum;
1581 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
1584 gdbarch->sp_regnum = sp_regnum;
1588 gdbarch_pc_regnum (struct gdbarch *gdbarch)
1590 gdb_assert (gdbarch != NULL);
1591 /* Skip verify of pc_regnum, invalid_p == 0 */
1592 if (gdbarch_debug >= 2)
1593 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
1594 return gdbarch->pc_regnum;
1598 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
1601 gdbarch->pc_regnum = pc_regnum;
1605 gdbarch_ps_regnum (struct gdbarch *gdbarch)
1607 gdb_assert (gdbarch != NULL);
1608 /* Skip verify of ps_regnum, invalid_p == 0 */
1609 if (gdbarch_debug >= 2)
1610 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
1611 return gdbarch->ps_regnum;
1615 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
1618 gdbarch->ps_regnum = ps_regnum;
1622 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
1624 gdb_assert (gdbarch != NULL);
1625 /* Skip verify of fp0_regnum, invalid_p == 0 */
1626 if (gdbarch_debug >= 2)
1627 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
1628 return gdbarch->fp0_regnum;
1632 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
1635 gdbarch->fp0_regnum = fp0_regnum;
1639 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
1641 gdb_assert (gdbarch != NULL);
1642 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
1643 if (gdbarch_debug >= 2)
1644 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
1645 return gdbarch->stab_reg_to_regnum (stab_regnr);
1649 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
1650 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
1652 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
1656 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
1658 gdb_assert (gdbarch != NULL);
1659 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
1660 if (gdbarch_debug >= 2)
1661 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
1662 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
1666 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
1667 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
1669 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
1673 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
1675 gdb_assert (gdbarch != NULL);
1676 gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
1677 if (gdbarch_debug >= 2)
1678 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
1679 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
1683 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
1684 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
1686 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
1690 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
1692 gdb_assert (gdbarch != NULL);
1693 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
1694 if (gdbarch_debug >= 2)
1695 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
1696 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
1700 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
1701 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
1703 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
1707 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
1709 gdb_assert (gdbarch != NULL);
1710 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
1711 if (gdbarch_debug >= 2)
1712 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
1713 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
1717 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
1718 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
1720 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
1724 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
1726 gdb_assert (gdbarch != NULL);
1727 gdb_assert (gdbarch->register_name != NULL);
1728 if (gdbarch_debug >= 2)
1729 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
1730 return gdbarch->register_name (regnr);
1734 set_gdbarch_register_name (struct gdbarch *gdbarch,
1735 gdbarch_register_name_ftype register_name)
1737 gdbarch->register_name = register_name;
1741 gdbarch_register_type_p (struct gdbarch *gdbarch)
1743 gdb_assert (gdbarch != NULL);
1744 return gdbarch->register_type != NULL;
1748 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
1750 gdb_assert (gdbarch != NULL);
1751 gdb_assert (gdbarch->register_type != NULL);
1752 if (gdbarch_debug >= 2)
1753 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
1754 return gdbarch->register_type (gdbarch, reg_nr);
1758 set_gdbarch_register_type (struct gdbarch *gdbarch,
1759 gdbarch_register_type_ftype register_type)
1761 gdbarch->register_type = register_type;
1765 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
1767 gdb_assert (gdbarch != NULL);
1768 return gdbarch->unwind_dummy_id != NULL;
1772 gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
1774 gdb_assert (gdbarch != NULL);
1775 gdb_assert (gdbarch->unwind_dummy_id != NULL);
1776 if (gdbarch_debug >= 2)
1777 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
1778 return gdbarch->unwind_dummy_id (gdbarch, info);
1782 set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
1783 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
1785 gdbarch->unwind_dummy_id = unwind_dummy_id;
1789 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
1791 gdb_assert (gdbarch != NULL);
1792 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1793 if (gdbarch_debug >= 2)
1794 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
1795 return gdbarch->deprecated_fp_regnum;
1799 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
1800 int deprecated_fp_regnum)
1802 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
1806 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
1808 gdb_assert (gdbarch != NULL);
1809 return gdbarch->push_dummy_call != NULL;
1813 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)
1815 gdb_assert (gdbarch != NULL);
1816 gdb_assert (gdbarch->push_dummy_call != NULL);
1817 if (gdbarch_debug >= 2)
1818 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
1819 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
1823 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
1824 gdbarch_push_dummy_call_ftype push_dummy_call)
1826 gdbarch->push_dummy_call = push_dummy_call;
1830 gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
1832 gdb_assert (gdbarch != NULL);
1833 if (gdbarch_debug >= 2)
1834 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
1835 return gdbarch->deprecated_register_size;
1839 set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
1840 int deprecated_register_size)
1842 gdbarch->deprecated_register_size = deprecated_register_size;
1846 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
1848 gdb_assert (gdbarch != NULL);
1849 /* Skip verify of call_dummy_location, invalid_p == 0 */
1850 if (gdbarch_debug >= 2)
1851 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
1852 return gdbarch->call_dummy_location;
1856 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
1857 int call_dummy_location)
1859 gdbarch->call_dummy_location = call_dummy_location;
1863 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
1865 gdb_assert (gdbarch != NULL);
1866 return gdbarch->push_dummy_code != NULL;
1870 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)
1872 gdb_assert (gdbarch != NULL);
1873 gdb_assert (gdbarch->push_dummy_code != NULL);
1874 if (gdbarch_debug >= 2)
1875 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
1876 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr, regcache);
1880 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
1881 gdbarch_push_dummy_code_ftype push_dummy_code)
1883 gdbarch->push_dummy_code = push_dummy_code;
1887 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
1889 gdb_assert (gdbarch != NULL);
1890 gdb_assert (gdbarch->print_registers_info != NULL);
1891 if (gdbarch_debug >= 2)
1892 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
1893 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
1897 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
1898 gdbarch_print_registers_info_ftype print_registers_info)
1900 gdbarch->print_registers_info = print_registers_info;
1904 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
1906 gdb_assert (gdbarch != NULL);
1907 return gdbarch->print_float_info != NULL;
1911 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1913 gdb_assert (gdbarch != NULL);
1914 gdb_assert (gdbarch->print_float_info != NULL);
1915 if (gdbarch_debug >= 2)
1916 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
1917 gdbarch->print_float_info (gdbarch, file, frame, args);
1921 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
1922 gdbarch_print_float_info_ftype print_float_info)
1924 gdbarch->print_float_info = print_float_info;
1928 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
1930 gdb_assert (gdbarch != NULL);
1931 return gdbarch->print_vector_info != NULL;
1935 gdbarch_print_vector_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_vector_info != NULL);
1939 if (gdbarch_debug >= 2)
1940 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
1941 gdbarch->print_vector_info (gdbarch, file, frame, args);
1945 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
1946 gdbarch_print_vector_info_ftype print_vector_info)
1948 gdbarch->print_vector_info = print_vector_info;
1952 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
1954 gdb_assert (gdbarch != NULL);
1955 gdb_assert (gdbarch->register_sim_regno != NULL);
1956 if (gdbarch_debug >= 2)
1957 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
1958 return gdbarch->register_sim_regno (reg_nr);
1962 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
1963 gdbarch_register_sim_regno_ftype register_sim_regno)
1965 gdbarch->register_sim_regno = register_sim_regno;
1969 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
1971 gdb_assert (gdbarch != NULL);
1972 gdb_assert (gdbarch->cannot_fetch_register != NULL);
1973 if (gdbarch_debug >= 2)
1974 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
1975 return gdbarch->cannot_fetch_register (regnum);
1979 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
1980 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
1982 gdbarch->cannot_fetch_register = cannot_fetch_register;
1986 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
1988 gdb_assert (gdbarch != NULL);
1989 gdb_assert (gdbarch->cannot_store_register != NULL);
1990 if (gdbarch_debug >= 2)
1991 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
1992 return gdbarch->cannot_store_register (regnum);
1996 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
1997 gdbarch_cannot_store_register_ftype cannot_store_register)
1999 gdbarch->cannot_store_register = cannot_store_register;
2003 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
2005 gdb_assert (gdbarch != NULL);
2006 return gdbarch->get_longjmp_target != NULL;
2010 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc)
2012 gdb_assert (gdbarch != NULL);
2013 gdb_assert (gdbarch->get_longjmp_target != NULL);
2014 if (gdbarch_debug >= 2)
2015 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
2016 return gdbarch->get_longjmp_target (frame, pc);
2020 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2021 gdbarch_get_longjmp_target_ftype get_longjmp_target)
2023 gdbarch->get_longjmp_target = get_longjmp_target;
2027 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2029 gdb_assert (gdbarch != NULL);
2030 if (gdbarch_debug >= 2)
2031 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2032 return gdbarch->believe_pcc_promotion;
2036 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2037 int believe_pcc_promotion)
2039 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2043 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
2045 gdb_assert (gdbarch != NULL);
2046 gdb_assert (gdbarch->convert_register_p != NULL);
2047 if (gdbarch_debug >= 2)
2048 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
2049 return gdbarch->convert_register_p (regnum, type);
2053 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2054 gdbarch_convert_register_p_ftype convert_register_p)
2056 gdbarch->convert_register_p = convert_register_p;
2060 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf)
2062 gdb_assert (gdbarch != NULL);
2063 gdb_assert (gdbarch->register_to_value != NULL);
2064 if (gdbarch_debug >= 2)
2065 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2066 gdbarch->register_to_value (frame, regnum, type, buf);
2070 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2071 gdbarch_register_to_value_ftype register_to_value)
2073 gdbarch->register_to_value = register_to_value;
2077 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
2079 gdb_assert (gdbarch != NULL);
2080 gdb_assert (gdbarch->value_to_register != NULL);
2081 if (gdbarch_debug >= 2)
2082 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2083 gdbarch->value_to_register (frame, regnum, type, buf);
2087 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2088 gdbarch_value_to_register_ftype value_to_register)
2090 gdbarch->value_to_register = value_to_register;
2094 gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
2096 gdb_assert (gdbarch != NULL);
2097 gdb_assert (gdbarch->value_from_register != NULL);
2098 if (gdbarch_debug >= 2)
2099 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
2100 return gdbarch->value_from_register (type, regnum, frame);
2104 set_gdbarch_value_from_register (struct gdbarch *gdbarch,
2105 gdbarch_value_from_register_ftype value_from_register)
2107 gdbarch->value_from_register = value_from_register;
2111 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2113 gdb_assert (gdbarch != NULL);
2114 gdb_assert (gdbarch->pointer_to_address != NULL);
2115 if (gdbarch_debug >= 2)
2116 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2117 return gdbarch->pointer_to_address (type, buf);
2121 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2122 gdbarch_pointer_to_address_ftype pointer_to_address)
2124 gdbarch->pointer_to_address = pointer_to_address;
2128 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
2130 gdb_assert (gdbarch != NULL);
2131 gdb_assert (gdbarch->address_to_pointer != NULL);
2132 if (gdbarch_debug >= 2)
2133 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2134 gdbarch->address_to_pointer (type, buf, addr);
2138 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2139 gdbarch_address_to_pointer_ftype address_to_pointer)
2141 gdbarch->address_to_pointer = address_to_pointer;
2145 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2147 gdb_assert (gdbarch != NULL);
2148 return gdbarch->integer_to_address != NULL;
2152 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2154 gdb_assert (gdbarch != NULL);
2155 gdb_assert (gdbarch->integer_to_address != NULL);
2156 if (gdbarch_debug >= 2)
2157 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2158 return gdbarch->integer_to_address (gdbarch, type, buf);
2162 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2163 gdbarch_integer_to_address_ftype integer_to_address)
2165 gdbarch->integer_to_address = integer_to_address;
2169 gdbarch_return_value_p (struct gdbarch *gdbarch)
2171 gdb_assert (gdbarch != NULL);
2172 return gdbarch->return_value != legacy_return_value;
2175 enum return_value_convention
2176 gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2178 gdb_assert (gdbarch != NULL);
2179 gdb_assert (gdbarch->return_value != NULL);
2180 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2181 if (gdbarch_debug >= 2)
2182 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2183 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
2187 set_gdbarch_return_value (struct gdbarch *gdbarch,
2188 gdbarch_return_value_ftype return_value)
2190 gdbarch->return_value = return_value;
2194 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf)
2196 gdb_assert (gdbarch != NULL);
2197 gdb_assert (gdbarch->extract_return_value != NULL);
2198 if (gdbarch_debug >= 2)
2199 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
2200 gdbarch->extract_return_value (type, regcache, valbuf);
2204 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
2205 gdbarch_extract_return_value_ftype extract_return_value)
2207 gdbarch->extract_return_value = extract_return_value;
2211 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
2213 gdb_assert (gdbarch != NULL);
2214 gdb_assert (gdbarch->store_return_value != NULL);
2215 if (gdbarch_debug >= 2)
2216 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
2217 gdbarch->store_return_value (type, regcache, valbuf);
2221 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
2222 gdbarch_store_return_value_ftype store_return_value)
2224 gdbarch->store_return_value = store_return_value;
2228 gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
2230 gdb_assert (gdbarch != NULL);
2231 gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
2232 if (gdbarch_debug >= 2)
2233 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
2234 return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
2238 set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
2239 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
2241 gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
2245 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
2247 gdb_assert (gdbarch != NULL);
2248 return gdbarch->deprecated_extract_struct_value_address != NULL;
2252 gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
2254 gdb_assert (gdbarch != NULL);
2255 gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL);
2256 if (gdbarch_debug >= 2)
2257 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
2258 return gdbarch->deprecated_extract_struct_value_address (regcache);
2262 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
2263 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
2265 gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
2269 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2271 gdb_assert (gdbarch != NULL);
2272 gdb_assert (gdbarch->skip_prologue != NULL);
2273 if (gdbarch_debug >= 2)
2274 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2275 return gdbarch->skip_prologue (ip);
2279 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2280 gdbarch_skip_prologue_ftype skip_prologue)
2282 gdbarch->skip_prologue = skip_prologue;
2286 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2288 gdb_assert (gdbarch != NULL);
2289 gdb_assert (gdbarch->inner_than != NULL);
2290 if (gdbarch_debug >= 2)
2291 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2292 return gdbarch->inner_than (lhs, rhs);
2296 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2297 gdbarch_inner_than_ftype inner_than)
2299 gdbarch->inner_than = inner_than;
2303 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2305 gdb_assert (gdbarch != NULL);
2306 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2307 if (gdbarch_debug >= 2)
2308 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2309 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
2313 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2314 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2316 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2320 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2322 gdb_assert (gdbarch != NULL);
2323 return gdbarch->adjust_breakpoint_address != NULL;
2327 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2329 gdb_assert (gdbarch != NULL);
2330 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2331 if (gdbarch_debug >= 2)
2332 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2333 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2337 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2338 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2340 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2344 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2346 gdb_assert (gdbarch != NULL);
2347 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2348 if (gdbarch_debug >= 2)
2349 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2350 return gdbarch->memory_insert_breakpoint (bp_tgt);
2354 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2355 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2357 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2361 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2363 gdb_assert (gdbarch != NULL);
2364 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2365 if (gdbarch_debug >= 2)
2366 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2367 return gdbarch->memory_remove_breakpoint (bp_tgt);
2371 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2372 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2374 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2378 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2380 gdb_assert (gdbarch != NULL);
2381 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2382 if (gdbarch_debug >= 2)
2383 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2384 return gdbarch->decr_pc_after_break;
2388 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2389 CORE_ADDR decr_pc_after_break)
2391 gdbarch->decr_pc_after_break = decr_pc_after_break;
2395 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2397 gdb_assert (gdbarch != NULL);
2398 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2399 if (gdbarch_debug >= 2)
2400 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2401 return gdbarch->deprecated_function_start_offset;
2405 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2406 CORE_ADDR deprecated_function_start_offset)
2408 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2412 gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
2414 gdb_assert (gdbarch != NULL);
2415 gdb_assert (gdbarch->remote_register_number != NULL);
2416 if (gdbarch_debug >= 2)
2417 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
2418 return gdbarch->remote_register_number (gdbarch, regno);
2422 set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
2423 gdbarch_remote_register_number_ftype remote_register_number)
2425 gdbarch->remote_register_number = remote_register_number;
2429 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2431 gdb_assert (gdbarch != NULL);
2432 return gdbarch->fetch_tls_load_module_address != NULL;
2436 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
2438 gdb_assert (gdbarch != NULL);
2439 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
2440 if (gdbarch_debug >= 2)
2441 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
2442 return gdbarch->fetch_tls_load_module_address (objfile);
2446 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
2447 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
2449 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
2453 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
2455 gdb_assert (gdbarch != NULL);
2456 /* Skip verify of frame_args_skip, invalid_p == 0 */
2457 if (gdbarch_debug >= 2)
2458 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2459 return gdbarch->frame_args_skip;
2463 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2464 CORE_ADDR frame_args_skip)
2466 gdbarch->frame_args_skip = frame_args_skip;
2470 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
2472 gdb_assert (gdbarch != NULL);
2473 return gdbarch->unwind_pc != NULL;
2477 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
2479 gdb_assert (gdbarch != NULL);
2480 gdb_assert (gdbarch->unwind_pc != NULL);
2481 if (gdbarch_debug >= 2)
2482 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
2483 return gdbarch->unwind_pc (gdbarch, next_frame);
2487 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
2488 gdbarch_unwind_pc_ftype unwind_pc)
2490 gdbarch->unwind_pc = unwind_pc;
2494 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
2496 gdb_assert (gdbarch != NULL);
2497 return gdbarch->unwind_sp != NULL;
2501 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
2503 gdb_assert (gdbarch != NULL);
2504 gdb_assert (gdbarch->unwind_sp != NULL);
2505 if (gdbarch_debug >= 2)
2506 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
2507 return gdbarch->unwind_sp (gdbarch, next_frame);
2511 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
2512 gdbarch_unwind_sp_ftype unwind_sp)
2514 gdbarch->unwind_sp = unwind_sp;
2518 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
2520 gdb_assert (gdbarch != NULL);
2521 return gdbarch->frame_num_args != NULL;
2525 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2527 gdb_assert (gdbarch != NULL);
2528 gdb_assert (gdbarch->frame_num_args != NULL);
2529 if (gdbarch_debug >= 2)
2530 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
2531 return gdbarch->frame_num_args (frame);
2535 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
2536 gdbarch_frame_num_args_ftype frame_num_args)
2538 gdbarch->frame_num_args = frame_num_args;
2542 gdbarch_frame_align_p (struct gdbarch *gdbarch)
2544 gdb_assert (gdbarch != NULL);
2545 return gdbarch->frame_align != NULL;
2549 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
2551 gdb_assert (gdbarch != NULL);
2552 gdb_assert (gdbarch->frame_align != NULL);
2553 if (gdbarch_debug >= 2)
2554 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
2555 return gdbarch->frame_align (gdbarch, address);
2559 set_gdbarch_frame_align (struct gdbarch *gdbarch,
2560 gdbarch_frame_align_ftype frame_align)
2562 gdbarch->frame_align = frame_align;
2566 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
2568 gdb_assert (gdbarch != NULL);
2569 return gdbarch->deprecated_reg_struct_has_addr != NULL;
2573 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
2575 gdb_assert (gdbarch != NULL);
2576 gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
2577 if (gdbarch_debug >= 2)
2578 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
2579 return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
2583 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
2584 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
2586 gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
2590 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
2592 gdb_assert (gdbarch != NULL);
2593 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
2594 if (gdbarch_debug >= 2)
2595 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
2596 return gdbarch->stabs_argument_has_addr (gdbarch, type);
2600 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
2601 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
2603 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
2607 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
2609 gdb_assert (gdbarch != NULL);
2610 if (gdbarch_debug >= 2)
2611 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
2612 return gdbarch->frame_red_zone_size;
2616 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
2617 int frame_red_zone_size)
2619 gdbarch->frame_red_zone_size = frame_red_zone_size;
2623 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
2625 gdb_assert (gdbarch != NULL);
2626 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
2627 if (gdbarch_debug >= 2)
2628 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
2629 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
2633 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
2634 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
2636 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
2640 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
2642 gdb_assert (gdbarch != NULL);
2643 gdb_assert (gdbarch->addr_bits_remove != NULL);
2644 if (gdbarch_debug >= 2)
2645 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
2646 return gdbarch->addr_bits_remove (addr);
2650 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
2651 gdbarch_addr_bits_remove_ftype addr_bits_remove)
2653 gdbarch->addr_bits_remove = addr_bits_remove;
2657 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
2659 gdb_assert (gdbarch != NULL);
2660 gdb_assert (gdbarch->smash_text_address != NULL);
2661 if (gdbarch_debug >= 2)
2662 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
2663 return gdbarch->smash_text_address (addr);
2667 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
2668 gdbarch_smash_text_address_ftype smash_text_address)
2670 gdbarch->smash_text_address = smash_text_address;
2674 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
2676 gdb_assert (gdbarch != NULL);
2677 return gdbarch->software_single_step != NULL;
2681 gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
2683 gdb_assert (gdbarch != NULL);
2684 gdb_assert (gdbarch->software_single_step != NULL);
2685 if (gdbarch_debug >= 2)
2686 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
2687 return gdbarch->software_single_step (frame);
2691 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
2692 gdbarch_software_single_step_ftype software_single_step)
2694 gdbarch->software_single_step = software_single_step;
2698 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
2700 gdb_assert (gdbarch != NULL);
2701 return gdbarch->single_step_through_delay != NULL;
2705 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
2707 gdb_assert (gdbarch != NULL);
2708 gdb_assert (gdbarch->single_step_through_delay != NULL);
2709 if (gdbarch_debug >= 2)
2710 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
2711 return gdbarch->single_step_through_delay (gdbarch, frame);
2715 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
2716 gdbarch_single_step_through_delay_ftype single_step_through_delay)
2718 gdbarch->single_step_through_delay = single_step_through_delay;
2722 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
2724 gdb_assert (gdbarch != NULL);
2725 gdb_assert (gdbarch->print_insn != NULL);
2726 if (gdbarch_debug >= 2)
2727 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
2728 return gdbarch->print_insn (vma, info);
2732 set_gdbarch_print_insn (struct gdbarch *gdbarch,
2733 gdbarch_print_insn_ftype print_insn)
2735 gdbarch->print_insn = print_insn;
2739 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc)
2741 gdb_assert (gdbarch != NULL);
2742 gdb_assert (gdbarch->skip_trampoline_code != NULL);
2743 if (gdbarch_debug >= 2)
2744 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
2745 return gdbarch->skip_trampoline_code (frame, pc);
2749 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
2750 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
2752 gdbarch->skip_trampoline_code = skip_trampoline_code;
2756 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
2758 gdb_assert (gdbarch != NULL);
2759 gdb_assert (gdbarch->skip_solib_resolver != NULL);
2760 if (gdbarch_debug >= 2)
2761 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
2762 return gdbarch->skip_solib_resolver (gdbarch, pc);
2766 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
2767 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
2769 gdbarch->skip_solib_resolver = skip_solib_resolver;
2773 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
2775 gdb_assert (gdbarch != NULL);
2776 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
2777 if (gdbarch_debug >= 2)
2778 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
2779 return gdbarch->in_solib_return_trampoline (pc, name);
2783 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
2784 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
2786 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
2790 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
2792 gdb_assert (gdbarch != NULL);
2793 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
2794 if (gdbarch_debug >= 2)
2795 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
2796 return gdbarch->in_function_epilogue_p (gdbarch, addr);
2800 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
2801 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
2803 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
2807 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
2809 gdb_assert (gdbarch != NULL);
2810 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
2811 if (gdbarch_debug >= 2)
2812 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
2813 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
2817 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
2818 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
2820 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
2824 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
2826 gdb_assert (gdbarch != NULL);
2827 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
2828 if (gdbarch_debug >= 2)
2829 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
2830 gdbarch->elf_make_msymbol_special (sym, msym);
2834 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
2835 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
2837 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
2841 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
2843 gdb_assert (gdbarch != NULL);
2844 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
2845 if (gdbarch_debug >= 2)
2846 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
2847 gdbarch->coff_make_msymbol_special (val, msym);
2851 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
2852 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
2854 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
2858 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
2860 gdb_assert (gdbarch != NULL);
2861 /* Skip verify of name_of_malloc, invalid_p == 0 */
2862 if (gdbarch_debug >= 2)
2863 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
2864 return gdbarch->name_of_malloc;
2868 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
2869 const char * name_of_malloc)
2871 gdbarch->name_of_malloc = name_of_malloc;
2875 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
2877 gdb_assert (gdbarch != NULL);
2878 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2879 if (gdbarch_debug >= 2)
2880 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
2881 return gdbarch->cannot_step_breakpoint;
2885 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
2886 int cannot_step_breakpoint)
2888 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
2892 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
2894 gdb_assert (gdbarch != NULL);
2895 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2896 if (gdbarch_debug >= 2)
2897 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
2898 return gdbarch->have_nonsteppable_watchpoint;
2902 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
2903 int have_nonsteppable_watchpoint)
2905 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
2909 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
2911 gdb_assert (gdbarch != NULL);
2912 return gdbarch->address_class_type_flags != NULL;
2916 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
2918 gdb_assert (gdbarch != NULL);
2919 gdb_assert (gdbarch->address_class_type_flags != NULL);
2920 if (gdbarch_debug >= 2)
2921 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
2922 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
2926 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
2927 gdbarch_address_class_type_flags_ftype address_class_type_flags)
2929 gdbarch->address_class_type_flags = address_class_type_flags;
2933 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
2935 gdb_assert (gdbarch != NULL);
2936 return gdbarch->address_class_type_flags_to_name != NULL;
2940 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
2942 gdb_assert (gdbarch != NULL);
2943 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
2944 if (gdbarch_debug >= 2)
2945 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
2946 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
2950 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
2951 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
2953 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
2957 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
2959 gdb_assert (gdbarch != NULL);
2960 return gdbarch->address_class_name_to_type_flags != NULL;
2964 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
2966 gdb_assert (gdbarch != NULL);
2967 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
2968 if (gdbarch_debug >= 2)
2969 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
2970 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
2974 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
2975 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
2977 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
2981 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
2983 gdb_assert (gdbarch != NULL);
2984 gdb_assert (gdbarch->register_reggroup_p != NULL);
2985 if (gdbarch_debug >= 2)
2986 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
2987 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
2991 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
2992 gdbarch_register_reggroup_p_ftype register_reggroup_p)
2994 gdbarch->register_reggroup_p = register_reggroup_p;
2998 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
3000 gdb_assert (gdbarch != NULL);
3001 return gdbarch->fetch_pointer_argument != NULL;
3005 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
3007 gdb_assert (gdbarch != NULL);
3008 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
3009 if (gdbarch_debug >= 2)
3010 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
3011 return gdbarch->fetch_pointer_argument (frame, argi, type);
3015 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
3016 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
3018 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
3022 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
3024 gdb_assert (gdbarch != NULL);
3025 return gdbarch->regset_from_core_section != NULL;
3028 const struct regset *
3029 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
3031 gdb_assert (gdbarch != NULL);
3032 gdb_assert (gdbarch->regset_from_core_section != NULL);
3033 if (gdbarch_debug >= 2)
3034 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
3035 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
3039 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
3040 gdbarch_regset_from_core_section_ftype regset_from_core_section)
3042 gdbarch->regset_from_core_section = regset_from_core_section;
3046 gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
3048 gdb_assert (gdbarch != NULL);
3049 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3050 if (gdbarch_debug >= 2)
3051 fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
3052 return gdbarch->vtable_function_descriptors;
3056 set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
3057 int vtable_function_descriptors)
3059 gdbarch->vtable_function_descriptors = vtable_function_descriptors;
3063 gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
3065 gdb_assert (gdbarch != NULL);
3066 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3067 if (gdbarch_debug >= 2)
3068 fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
3069 return gdbarch->vbit_in_delta;
3073 set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
3076 gdbarch->vbit_in_delta = vbit_in_delta;
3080 gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
3082 gdb_assert (gdbarch != NULL);
3083 return gdbarch->skip_permanent_breakpoint != NULL;
3087 gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
3089 gdb_assert (gdbarch != NULL);
3090 gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
3091 if (gdbarch_debug >= 2)
3092 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
3093 gdbarch->skip_permanent_breakpoint (regcache);
3097 set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
3098 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
3100 gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
3104 gdbarch_overlay_update_p (struct gdbarch *gdbarch)
3106 gdb_assert (gdbarch != NULL);
3107 return gdbarch->overlay_update != NULL;
3111 gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
3113 gdb_assert (gdbarch != NULL);
3114 gdb_assert (gdbarch->overlay_update != NULL);
3115 if (gdbarch_debug >= 2)
3116 fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
3117 gdbarch->overlay_update (osect);
3121 set_gdbarch_overlay_update (struct gdbarch *gdbarch,
3122 gdbarch_overlay_update_ftype overlay_update)
3124 gdbarch->overlay_update = overlay_update;
3128 /* Keep a registry of per-architecture data-pointers required by GDB
3135 gdbarch_data_pre_init_ftype *pre_init;
3136 gdbarch_data_post_init_ftype *post_init;
3139 struct gdbarch_data_registration
3141 struct gdbarch_data *data;
3142 struct gdbarch_data_registration *next;
3145 struct gdbarch_data_registry
3148 struct gdbarch_data_registration *registrations;
3151 struct gdbarch_data_registry gdbarch_data_registry =
3156 static struct gdbarch_data *
3157 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3158 gdbarch_data_post_init_ftype *post_init)
3160 struct gdbarch_data_registration **curr;
3161 /* Append the new registraration. */
3162 for (curr = &gdbarch_data_registry.registrations;
3164 curr = &(*curr)->next);
3165 (*curr) = XMALLOC (struct gdbarch_data_registration);
3166 (*curr)->next = NULL;
3167 (*curr)->data = XMALLOC (struct gdbarch_data);
3168 (*curr)->data->index = gdbarch_data_registry.nr++;
3169 (*curr)->data->pre_init = pre_init;
3170 (*curr)->data->post_init = post_init;
3171 (*curr)->data->init_p = 1;
3172 return (*curr)->data;
3175 struct gdbarch_data *
3176 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3178 return gdbarch_data_register (pre_init, NULL);
3181 struct gdbarch_data *
3182 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3184 return gdbarch_data_register (NULL, post_init);
3187 /* Create/delete the gdbarch data vector. */
3190 alloc_gdbarch_data (struct gdbarch *gdbarch)
3192 gdb_assert (gdbarch->data == NULL);
3193 gdbarch->nr_data = gdbarch_data_registry.nr;
3194 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3197 /* Initialize the current value of the specified per-architecture
3201 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3202 struct gdbarch_data *data,
3205 gdb_assert (data->index < gdbarch->nr_data);
3206 gdb_assert (gdbarch->data[data->index] == NULL);
3207 gdb_assert (data->pre_init == NULL);
3208 gdbarch->data[data->index] = pointer;
3211 /* Return the current value of the specified per-architecture
3215 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3217 gdb_assert (data->index < gdbarch->nr_data);
3218 if (gdbarch->data[data->index] == NULL)
3220 /* The data-pointer isn't initialized, call init() to get a
3222 if (data->pre_init != NULL)
3223 /* Mid architecture creation: pass just the obstack, and not
3224 the entire architecture, as that way it isn't possible for
3225 pre-init code to refer to undefined architecture
3227 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3228 else if (gdbarch->initialized_p
3229 && data->post_init != NULL)
3230 /* Post architecture creation: pass the entire architecture
3231 (as all fields are valid), but be careful to also detect
3232 recursive references. */
3234 gdb_assert (data->init_p);
3236 gdbarch->data[data->index] = data->post_init (gdbarch);
3240 /* The architecture initialization hasn't completed - punt -
3241 hope that the caller knows what they are doing. Once
3242 deprecated_set_gdbarch_data has been initialized, this can be
3243 changed to an internal error. */
3245 gdb_assert (gdbarch->data[data->index] != NULL);
3247 return gdbarch->data[data->index];
3252 /* Keep a registry of swapped data required by GDB modules. */
3257 struct gdbarch_swap_registration *source;
3258 struct gdbarch_swap *next;
3261 struct gdbarch_swap_registration
3264 unsigned long sizeof_data;
3265 gdbarch_swap_ftype *init;
3266 struct gdbarch_swap_registration *next;
3269 struct gdbarch_swap_registry
3272 struct gdbarch_swap_registration *registrations;
3275 struct gdbarch_swap_registry gdbarch_swap_registry =
3281 deprecated_register_gdbarch_swap (void *data,
3282 unsigned long sizeof_data,
3283 gdbarch_swap_ftype *init)
3285 struct gdbarch_swap_registration **rego;
3286 for (rego = &gdbarch_swap_registry.registrations;
3288 rego = &(*rego)->next);
3289 (*rego) = XMALLOC (struct gdbarch_swap_registration);
3290 (*rego)->next = NULL;
3291 (*rego)->init = init;
3292 (*rego)->data = data;
3293 (*rego)->sizeof_data = sizeof_data;
3297 current_gdbarch_swap_init_hack (void)
3299 struct gdbarch_swap_registration *rego;
3300 struct gdbarch_swap **curr = ¤t_gdbarch->swap;
3301 for (rego = gdbarch_swap_registry.registrations;
3305 if (rego->data != NULL)
3307 (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch,
3308 struct gdbarch_swap);
3309 (*curr)->source = rego;
3310 (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch,
3312 (*curr)->next = NULL;
3313 curr = &(*curr)->next;
3315 if (rego->init != NULL)
3320 static struct gdbarch *
3321 current_gdbarch_swap_out_hack (void)
3323 struct gdbarch *old_gdbarch = current_gdbarch;
3324 struct gdbarch_swap *curr;
3326 gdb_assert (old_gdbarch != NULL);
3327 for (curr = old_gdbarch->swap;
3331 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
3332 memset (curr->source->data, 0, curr->source->sizeof_data);
3334 current_gdbarch = NULL;
3339 current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch)
3341 struct gdbarch_swap *curr;
3343 gdb_assert (current_gdbarch == NULL);
3344 for (curr = new_gdbarch->swap;
3347 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
3348 current_gdbarch = new_gdbarch;
3352 /* Keep a registry of the architectures known by GDB. */
3354 struct gdbarch_registration
3356 enum bfd_architecture bfd_architecture;
3357 gdbarch_init_ftype *init;
3358 gdbarch_dump_tdep_ftype *dump_tdep;
3359 struct gdbarch_list *arches;
3360 struct gdbarch_registration *next;
3363 static struct gdbarch_registration *gdbarch_registry = NULL;
3366 append_name (const char ***buf, int *nr, const char *name)
3368 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3374 gdbarch_printable_names (void)
3376 /* Accumulate a list of names based on the registed list of
3378 enum bfd_architecture a;
3380 const char **arches = NULL;
3381 struct gdbarch_registration *rego;
3382 for (rego = gdbarch_registry;
3386 const struct bfd_arch_info *ap;
3387 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3389 internal_error (__FILE__, __LINE__,
3390 _("gdbarch_architecture_names: multi-arch unknown"));
3393 append_name (&arches, &nr_arches, ap->printable_name);
3398 append_name (&arches, &nr_arches, NULL);
3404 gdbarch_register (enum bfd_architecture bfd_architecture,
3405 gdbarch_init_ftype *init,
3406 gdbarch_dump_tdep_ftype *dump_tdep)
3408 struct gdbarch_registration **curr;
3409 const struct bfd_arch_info *bfd_arch_info;
3410 /* Check that BFD recognizes this architecture */
3411 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3412 if (bfd_arch_info == NULL)
3414 internal_error (__FILE__, __LINE__,
3415 _("gdbarch: Attempt to register unknown architecture (%d)"),
3418 /* Check that we haven't seen this architecture before */
3419 for (curr = &gdbarch_registry;
3421 curr = &(*curr)->next)
3423 if (bfd_architecture == (*curr)->bfd_architecture)
3424 internal_error (__FILE__, __LINE__,
3425 _("gdbarch: Duplicate registraration of architecture (%s)"),
3426 bfd_arch_info->printable_name);
3430 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
3431 bfd_arch_info->printable_name,
3434 (*curr) = XMALLOC (struct gdbarch_registration);
3435 (*curr)->bfd_architecture = bfd_architecture;
3436 (*curr)->init = init;
3437 (*curr)->dump_tdep = dump_tdep;
3438 (*curr)->arches = NULL;
3439 (*curr)->next = NULL;
3443 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3444 gdbarch_init_ftype *init)
3446 gdbarch_register (bfd_architecture, init, NULL);
3450 /* Look for an architecture using gdbarch_info. */
3452 struct gdbarch_list *
3453 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
3454 const struct gdbarch_info *info)
3456 for (; arches != NULL; arches = arches->next)
3458 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
3460 if (info->byte_order != arches->gdbarch->byte_order)
3462 if (info->osabi != arches->gdbarch->osabi)
3464 if (info->target_desc != arches->gdbarch->target_desc)
3472 /* Find an architecture that matches the specified INFO. Create a new
3473 architecture if needed. Return that new architecture. Assumes
3474 that there is no current architecture. */
3476 static struct gdbarch *
3477 find_arch_by_info (struct gdbarch_info info)
3479 struct gdbarch *new_gdbarch;
3480 struct gdbarch_registration *rego;
3482 /* The existing architecture has been swapped out - all this code
3483 works from a clean slate. */
3484 gdb_assert (current_gdbarch == NULL);
3486 /* Fill in missing parts of the INFO struct using a number of
3487 sources: "set ..."; INFOabfd supplied; and the global
3489 gdbarch_info_fill (&info);
3491 /* Must have found some sort of architecture. */
3492 gdb_assert (info.bfd_arch_info != NULL);
3496 fprintf_unfiltered (gdb_stdlog,
3497 "find_arch_by_info: info.bfd_arch_info %s\n",
3498 (info.bfd_arch_info != NULL
3499 ? info.bfd_arch_info->printable_name
3501 fprintf_unfiltered (gdb_stdlog,
3502 "find_arch_by_info: info.byte_order %d (%s)\n",
3504 (info.byte_order == BFD_ENDIAN_BIG ? "big"
3505 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
3507 fprintf_unfiltered (gdb_stdlog,
3508 "find_arch_by_info: info.osabi %d (%s)\n",
3509 info.osabi, gdbarch_osabi_name (info.osabi));
3510 fprintf_unfiltered (gdb_stdlog,
3511 "find_arch_by_info: info.abfd 0x%lx\n",
3513 fprintf_unfiltered (gdb_stdlog,
3514 "find_arch_by_info: info.tdep_info 0x%lx\n",
3515 (long) info.tdep_info);
3518 /* Find the tdep code that knows about this architecture. */
3519 for (rego = gdbarch_registry;
3522 if (rego->bfd_architecture == info.bfd_arch_info->arch)
3527 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3528 "No matching architecture\n");
3532 /* Ask the tdep code for an architecture that matches "info". */
3533 new_gdbarch = rego->init (info, rego->arches);
3535 /* Did the tdep code like it? No. Reject the change and revert to
3536 the old architecture. */
3537 if (new_gdbarch == NULL)
3540 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3541 "Target rejected architecture\n");
3545 /* Is this a pre-existing architecture (as determined by already
3546 being initialized)? Move it to the front of the architecture
3547 list (keeping the list sorted Most Recently Used). */
3548 if (new_gdbarch->initialized_p)
3550 struct gdbarch_list **list;
3551 struct gdbarch_list *this;
3553 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3554 "Previous architecture 0x%08lx (%s) selected\n",
3556 new_gdbarch->bfd_arch_info->printable_name);
3557 /* Find the existing arch in the list. */
3558 for (list = ®o->arches;
3559 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
3560 list = &(*list)->next);
3561 /* It had better be in the list of architectures. */
3562 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
3565 (*list) = this->next;
3566 /* Insert THIS at the front. */
3567 this->next = rego->arches;
3568 rego->arches = this;
3573 /* It's a new architecture. */
3575 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3576 "New architecture 0x%08lx (%s) selected\n",
3578 new_gdbarch->bfd_arch_info->printable_name);
3580 /* Insert the new architecture into the front of the architecture
3581 list (keep the list sorted Most Recently Used). */
3583 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
3584 this->next = rego->arches;
3585 this->gdbarch = new_gdbarch;
3586 rego->arches = this;
3589 /* Check that the newly installed architecture is valid. Plug in
3590 any post init values. */
3591 new_gdbarch->dump_tdep = rego->dump_tdep;
3592 verify_gdbarch (new_gdbarch);
3593 new_gdbarch->initialized_p = 1;
3595 /* Initialize any per-architecture swap areas. This phase requires
3596 a valid global CURRENT_GDBARCH. Set it momentarially, and then
3597 swap the entire architecture out. */
3598 current_gdbarch = new_gdbarch;
3599 current_gdbarch_swap_init_hack ();
3600 current_gdbarch_swap_out_hack ();
3603 gdbarch_dump (new_gdbarch, gdb_stdlog);
3609 gdbarch_find_by_info (struct gdbarch_info info)
3611 /* Save the previously selected architecture, setting the global to
3612 NULL. This stops things like gdbarch->init() trying to use the
3613 previous architecture's configuration. The previous architecture
3614 may not even be of the same architecture family. The most recent
3615 architecture of the same family is found at the head of the
3616 rego->arches list. */
3617 struct gdbarch *old_gdbarch = current_gdbarch_swap_out_hack ();
3619 /* Find the specified architecture. */
3620 struct gdbarch *new_gdbarch = find_arch_by_info (info);
3622 /* Restore the existing architecture. */
3623 gdb_assert (current_gdbarch == NULL);
3624 current_gdbarch_swap_in_hack (old_gdbarch);
3629 /* Make the specified architecture current, swapping the existing one
3633 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
3635 gdb_assert (new_gdbarch != NULL);
3636 gdb_assert (current_gdbarch != NULL);
3637 gdb_assert (new_gdbarch->initialized_p);
3638 current_gdbarch_swap_out_hack ();
3639 current_gdbarch_swap_in_hack (new_gdbarch);
3640 architecture_changed_event ();
3641 reinit_frame_cache ();
3644 extern void _initialize_gdbarch (void);
3647 _initialize_gdbarch (void)
3649 struct cmd_list_element *c;
3651 add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
3652 Set architecture debugging."), _("\
3653 Show architecture debugging."), _("\
3654 When non-zero, architecture debugging is enabled."),
3657 &setdebuglist, &showdebuglist);