1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
5 Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free
6 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., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, 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"
42 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
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;
66 pformat (const struct floatformat *format)
75 /* Maintain the struct gdbarch object */
79 /* Has this architecture been fully initialized? */
82 /* An obstack bound to the lifetime of the architecture. */
83 struct obstack *obstack;
85 /* basic architectural information */
86 const struct bfd_arch_info * bfd_arch_info;
90 /* target specific vector. */
91 struct gdbarch_tdep *tdep;
92 gdbarch_dump_tdep_ftype *dump_tdep;
94 /* per-architecture data-pointers */
98 /* per-architecture swap-regions */
99 struct gdbarch_swap *swap;
101 /* Multi-arch values.
103 When extending this structure you must:
107 Declare set/get functions and define the corresponding
110 gdbarch_alloc(): If zero/NULL is not a suitable default,
111 initialize the new field.
113 verify_gdbarch(): Confirm that the target updated the field
116 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
119 ``startup_gdbarch()'': Append an initial value to the static
120 variable (base values on the host's c-type system).
122 get_gdbarch(): Implement the set/get functions (probably using
123 the macro's as shortcuts).
132 const struct floatformat * float_format;
134 const struct floatformat * double_format;
136 const struct floatformat * long_double_format;
141 gdbarch_read_pc_ftype *read_pc;
142 gdbarch_write_pc_ftype *write_pc;
143 gdbarch_read_sp_ftype *read_sp;
144 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
145 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
146 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
153 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
154 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
155 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
156 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
157 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
158 gdbarch_register_name_ftype *register_name;
159 gdbarch_register_type_ftype *register_type;
160 gdbarch_deprecated_register_byte_ftype *deprecated_register_byte;
161 gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
162 int deprecated_fp_regnum;
163 gdbarch_push_dummy_call_ftype *push_dummy_call;
164 gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments;
165 int deprecated_register_size;
166 int call_dummy_location;
167 gdbarch_push_dummy_code_ftype *push_dummy_code;
168 gdbarch_print_registers_info_ftype *print_registers_info;
169 gdbarch_print_float_info_ftype *print_float_info;
170 gdbarch_print_vector_info_ftype *print_vector_info;
171 gdbarch_register_sim_regno_ftype *register_sim_regno;
172 gdbarch_register_bytes_ok_ftype *register_bytes_ok;
173 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
174 gdbarch_cannot_store_register_ftype *cannot_store_register;
175 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
176 int believe_pcc_promotion;
177 gdbarch_convert_register_p_ftype *convert_register_p;
178 gdbarch_register_to_value_ftype *register_to_value;
179 gdbarch_value_to_register_ftype *value_to_register;
180 gdbarch_pointer_to_address_ftype *pointer_to_address;
181 gdbarch_address_to_pointer_ftype *address_to_pointer;
182 gdbarch_integer_to_address_ftype *integer_to_address;
183 gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return;
184 gdbarch_return_value_ftype *return_value;
185 gdbarch_extract_return_value_ftype *extract_return_value;
186 gdbarch_store_return_value_ftype *store_return_value;
187 gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value;
188 gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value;
189 gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
190 gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
191 gdbarch_skip_prologue_ftype *skip_prologue;
192 gdbarch_inner_than_ftype *inner_than;
193 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
194 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
195 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
196 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
197 CORE_ADDR decr_pc_after_break;
198 CORE_ADDR deprecated_function_start_offset;
199 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
200 CORE_ADDR frame_args_skip;
201 gdbarch_unwind_pc_ftype *unwind_pc;
202 gdbarch_unwind_sp_ftype *unwind_sp;
203 gdbarch_deprecated_saved_pc_after_call_ftype *deprecated_saved_pc_after_call;
204 gdbarch_frame_num_args_ftype *frame_num_args;
205 gdbarch_deprecated_stack_align_ftype *deprecated_stack_align;
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;
235 /* The default architecture uses host values (for want of a better
238 extern const struct bfd_arch_info bfd_default_arch_struct;
240 struct gdbarch startup_gdbarch =
242 1, /* Always initialized. */
243 NULL, /* The obstack. */
244 /* basic architecture information */
245 &bfd_default_arch_struct, /* bfd_arch_info */
246 BFD_ENDIAN_BIG, /* byte_order */
247 GDB_OSABI_UNKNOWN, /* osabi */
248 /* target specific vector and its dump routine */
250 /*per-architecture data-pointers and swap regions */
252 /* Multi-arch values */
253 8 * sizeof (short), /* short_bit */
254 8 * sizeof (int), /* int_bit */
255 8 * sizeof (long), /* long_bit */
256 8 * sizeof (LONGEST), /* long_long_bit */
257 8 * sizeof (float), /* float_bit */
258 0, /* float_format */
259 8 * sizeof (double), /* double_bit */
260 0, /* double_format */
261 8 * sizeof (long double), /* long_double_bit */
262 0, /* long_double_format */
263 8 * sizeof (void*), /* ptr_bit */
264 8 * sizeof (void*), /* addr_bit */
265 8 * sizeof (void*), /* bfd_vma_bit */
270 0, /* virtual_frame_pointer */
271 0, /* pseudo_register_read */
272 0, /* pseudo_register_write */
274 0, /* num_pseudo_regs */
279 0, /* stab_reg_to_regnum */
280 0, /* ecoff_reg_to_regnum */
281 0, /* dwarf_reg_to_regnum */
282 0, /* sdb_reg_to_regnum */
283 0, /* dwarf2_reg_to_regnum */
284 0, /* register_name */
285 0, /* register_type */
286 generic_register_byte, /* deprecated_register_byte */
287 0, /* unwind_dummy_id */
288 -1, /* deprecated_fp_regnum */
289 0, /* push_dummy_call */
290 0, /* deprecated_push_arguments */
291 0, /* deprecated_register_size */
292 0, /* call_dummy_location */
293 0, /* push_dummy_code */
294 default_print_registers_info, /* print_registers_info */
295 0, /* print_float_info */
296 0, /* print_vector_info */
297 0, /* register_sim_regno */
298 0, /* register_bytes_ok */
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, /* pointer_to_address */
307 0, /* address_to_pointer */
308 0, /* integer_to_address */
309 0, /* deprecated_store_struct_return */
310 0, /* return_value */
311 0, /* extract_return_value */
312 0, /* store_return_value */
313 0, /* deprecated_extract_return_value */
314 0, /* deprecated_store_return_value */
315 0, /* deprecated_use_struct_convention */
316 0, /* deprecated_extract_struct_value_address */
317 0, /* skip_prologue */
319 0, /* breakpoint_from_pc */
320 0, /* adjust_breakpoint_address */
321 0, /* memory_insert_breakpoint */
322 0, /* memory_remove_breakpoint */
323 0, /* decr_pc_after_break */
324 0, /* deprecated_function_start_offset */
325 generic_remote_translate_xfer_address, /* remote_translate_xfer_address */
326 0, /* frame_args_skip */
329 0, /* deprecated_saved_pc_after_call */
330 0, /* frame_num_args */
331 0, /* deprecated_stack_align */
333 0, /* deprecated_reg_struct_has_addr */
334 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
335 0, /* frame_red_zone_size */
336 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
337 0, /* addr_bits_remove */
338 0, /* smash_text_address */
339 0, /* software_single_step */
340 0, /* single_step_through_delay */
342 0, /* skip_trampoline_code */
343 generic_skip_solib_resolver, /* skip_solib_resolver */
344 0, /* in_solib_return_trampoline */
345 generic_in_function_epilogue_p, /* in_function_epilogue_p */
346 construct_inferior_arguments, /* construct_inferior_arguments */
347 0, /* elf_make_msymbol_special */
348 0, /* coff_make_msymbol_special */
349 "malloc", /* name_of_malloc */
350 0, /* cannot_step_breakpoint */
351 0, /* have_nonsteppable_watchpoint */
352 0, /* address_class_type_flags */
353 0, /* address_class_type_flags_to_name */
354 0, /* address_class_name_to_type_flags */
355 default_register_reggroup_p, /* register_reggroup_p */
356 0, /* fetch_pointer_argument */
357 0, /* regset_from_core_section */
358 /* startup_gdbarch() */
361 struct gdbarch *current_gdbarch = &startup_gdbarch;
363 /* Create a new ``struct gdbarch'' based on information provided by
364 ``struct gdbarch_info''. */
367 gdbarch_alloc (const struct gdbarch_info *info,
368 struct gdbarch_tdep *tdep)
370 /* NOTE: The new architecture variable is named ``current_gdbarch''
371 so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
372 the current local architecture and not the previous global
373 architecture. This ensures that the new architectures initial
374 values are not influenced by the previous architecture. Once
375 everything is parameterised with gdbarch, this will go away. */
376 struct gdbarch *current_gdbarch;
378 /* Create an obstack for allocating all the per-architecture memory,
379 then use that to allocate the architecture vector. */
380 struct obstack *obstack = XMALLOC (struct obstack);
381 obstack_init (obstack);
382 current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch));
383 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
384 current_gdbarch->obstack = obstack;
386 alloc_gdbarch_data (current_gdbarch);
388 current_gdbarch->tdep = tdep;
390 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
391 current_gdbarch->byte_order = info->byte_order;
392 current_gdbarch->osabi = info->osabi;
394 /* Force the explicit initialization of these. */
395 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
396 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
397 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
398 current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
399 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
400 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
401 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
402 current_gdbarch->ptr_bit = TARGET_INT_BIT;
403 current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
404 current_gdbarch->char_signed = -1;
405 current_gdbarch->write_pc = generic_target_write_pc;
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_register_byte = generic_register_byte;
418 current_gdbarch->deprecated_fp_regnum = -1;
419 current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
420 current_gdbarch->print_registers_info = default_print_registers_info;
421 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
422 current_gdbarch->cannot_fetch_register = cannot_register_not;
423 current_gdbarch->cannot_store_register = cannot_register_not;
424 current_gdbarch->convert_register_p = generic_convert_register_p;
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->extract_return_value = legacy_extract_return_value;
429 current_gdbarch->store_return_value = legacy_store_return_value;
430 current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
431 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
432 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
433 current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
434 current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
435 current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
436 current_gdbarch->addr_bits_remove = core_addr_identity;
437 current_gdbarch->smash_text_address = core_addr_identity;
438 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
439 current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
440 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
441 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
442 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
443 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
444 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
445 current_gdbarch->name_of_malloc = "malloc";
446 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
447 /* gdbarch_alloc() */
449 return current_gdbarch;
453 /* Allocate extra space using the per-architecture obstack. */
456 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
458 void *data = obstack_alloc (arch->obstack, size);
459 memset (data, 0, size);
464 /* Free a gdbarch struct. This should never happen in normal
465 operation --- once you've created a gdbarch, you keep it around.
466 However, if an architecture's init function encounters an error
467 building the structure, it may need to clean up a partially
468 constructed gdbarch. */
471 gdbarch_free (struct gdbarch *arch)
473 struct obstack *obstack;
474 gdb_assert (arch != NULL);
475 gdb_assert (!arch->initialized_p);
476 obstack = arch->obstack;
477 obstack_free (obstack, 0); /* Includes the ARCH. */
482 /* Ensure that all values in a GDBARCH are reasonable. */
484 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
485 just happens to match the global variable ``current_gdbarch''. That
486 way macros refering to that variable get the local and not the global
487 version - ulgh. Once everything is parameterised with gdbarch, this
491 verify_gdbarch (struct gdbarch *current_gdbarch)
494 struct cleanup *cleanups;
497 log = mem_fileopen ();
498 cleanups = make_cleanup_ui_file_delete (log);
500 if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
501 fprintf_unfiltered (log, "\n\tbyte-order");
502 if (current_gdbarch->bfd_arch_info == NULL)
503 fprintf_unfiltered (log, "\n\tbfd_arch_info");
504 /* Check those that need to be defined for the given multi-arch level. */
505 /* Skip verify of short_bit, invalid_p == 0 */
506 /* Skip verify of int_bit, invalid_p == 0 */
507 /* Skip verify of long_bit, invalid_p == 0 */
508 /* Skip verify of long_long_bit, invalid_p == 0 */
509 /* Skip verify of float_bit, invalid_p == 0 */
510 if (current_gdbarch->float_format == 0)
511 current_gdbarch->float_format = default_float_format (current_gdbarch);
512 /* Skip verify of double_bit, invalid_p == 0 */
513 if (current_gdbarch->double_format == 0)
514 current_gdbarch->double_format = default_double_format (current_gdbarch);
515 /* Skip verify of long_double_bit, invalid_p == 0 */
516 if (current_gdbarch->long_double_format == 0)
517 current_gdbarch->long_double_format = default_double_format (current_gdbarch);
518 /* Skip verify of ptr_bit, invalid_p == 0 */
519 if (current_gdbarch->addr_bit == 0)
520 current_gdbarch->addr_bit = TARGET_PTR_BIT;
521 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
522 if (current_gdbarch->char_signed == -1)
523 current_gdbarch->char_signed = 1;
524 /* Skip verify of read_pc, has predicate */
525 /* Skip verify of write_pc, invalid_p == 0 */
526 /* Skip verify of read_sp, has predicate */
527 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
528 /* Skip verify of pseudo_register_read, has predicate */
529 /* Skip verify of pseudo_register_write, has predicate */
530 if (current_gdbarch->num_regs == -1)
531 fprintf_unfiltered (log, "\n\tnum_regs");
532 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
533 /* Skip verify of sp_regnum, invalid_p == 0 */
534 /* Skip verify of pc_regnum, invalid_p == 0 */
535 /* Skip verify of ps_regnum, invalid_p == 0 */
536 /* Skip verify of fp0_regnum, invalid_p == 0 */
537 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
538 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
539 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
540 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
541 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
542 /* Skip verify of register_type, has predicate */
543 /* Skip verify of deprecated_register_byte, has predicate */
544 /* Skip verify of unwind_dummy_id, has predicate */
545 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
546 /* Skip verify of push_dummy_call, has predicate */
547 /* Skip verify of deprecated_push_arguments, has predicate */
548 /* Skip verify of call_dummy_location, invalid_p == 0 */
549 /* Skip verify of push_dummy_code, has predicate */
550 /* Skip verify of print_registers_info, invalid_p == 0 */
551 /* Skip verify of print_float_info, has predicate */
552 /* Skip verify of print_vector_info, has predicate */
553 /* Skip verify of register_sim_regno, invalid_p == 0 */
554 /* Skip verify of register_bytes_ok, has predicate */
555 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
556 /* Skip verify of cannot_store_register, invalid_p == 0 */
557 /* Skip verify of get_longjmp_target, has predicate */
558 /* Skip verify of convert_register_p, invalid_p == 0 */
559 /* Skip verify of pointer_to_address, invalid_p == 0 */
560 /* Skip verify of address_to_pointer, invalid_p == 0 */
561 /* Skip verify of integer_to_address, has predicate */
562 /* Skip verify of deprecated_store_struct_return, has predicate */
563 /* Skip verify of return_value, has predicate */
564 /* Skip verify of extract_return_value, invalid_p == 0 */
565 /* Skip verify of store_return_value, invalid_p == 0 */
566 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
567 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
568 if (current_gdbarch->skip_prologue == 0)
569 fprintf_unfiltered (log, "\n\tskip_prologue");
570 if (current_gdbarch->inner_than == 0)
571 fprintf_unfiltered (log, "\n\tinner_than");
572 if (current_gdbarch->breakpoint_from_pc == 0)
573 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
574 /* Skip verify of adjust_breakpoint_address, has predicate */
575 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
576 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
577 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
578 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
579 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
580 /* Skip verify of frame_args_skip, invalid_p == 0 */
581 /* Skip verify of unwind_pc, has predicate */
582 /* Skip verify of unwind_sp, has predicate */
583 /* Skip verify of deprecated_saved_pc_after_call, has predicate */
584 /* Skip verify of frame_num_args, has predicate */
585 /* Skip verify of deprecated_stack_align, has predicate */
586 /* Skip verify of frame_align, has predicate */
587 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
588 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
589 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
590 /* Skip verify of addr_bits_remove, invalid_p == 0 */
591 /* Skip verify of smash_text_address, invalid_p == 0 */
592 /* Skip verify of software_single_step, has predicate */
593 /* Skip verify of single_step_through_delay, has predicate */
594 if (current_gdbarch->print_insn == 0)
595 fprintf_unfiltered (log, "\n\tprint_insn");
596 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
597 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
598 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
599 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
600 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
601 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
602 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
603 /* Skip verify of name_of_malloc, invalid_p == 0 */
604 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
605 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
606 /* Skip verify of address_class_type_flags, has predicate */
607 /* Skip verify of address_class_type_flags_to_name, has predicate */
608 /* Skip verify of address_class_name_to_type_flags, has predicate */
609 /* Skip verify of register_reggroup_p, invalid_p == 0 */
610 /* Skip verify of fetch_pointer_argument, has predicate */
611 /* Skip verify of regset_from_core_section, has predicate */
612 buf = ui_file_xstrdup (log, &dummy);
613 make_cleanup (xfree, buf);
614 if (strlen (buf) > 0)
615 internal_error (__FILE__, __LINE__,
616 "verify_gdbarch: the following are invalid ...%s",
618 do_cleanups (cleanups);
622 /* Print out the details of the current architecture. */
624 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
625 just happens to match the global variable ``current_gdbarch''. That
626 way macros refering to that variable get the local and not the global
627 version - ulgh. Once everything is parameterised with gdbarch, this
631 gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
633 const char *gdb_xm_file = "<not-defined>";
634 const char *gdb_nm_file = "<not-defined>";
635 const char *gdb_tm_file = "<not-defined>";
636 #if defined (GDB_XM_FILE)
637 gdb_xm_file = GDB_XM_FILE;
639 fprintf_unfiltered (file,
640 "gdbarch_dump: GDB_XM_FILE = %s\n",
642 #if defined (GDB_NM_FILE)
643 gdb_nm_file = GDB_NM_FILE;
645 fprintf_unfiltered (file,
646 "gdbarch_dump: GDB_NM_FILE = %s\n",
648 #if defined (GDB_TM_FILE)
649 gdb_tm_file = GDB_TM_FILE;
651 fprintf_unfiltered (file,
652 "gdbarch_dump: GDB_TM_FILE = %s\n",
654 #ifdef TARGET_ADDR_BIT
655 fprintf_unfiltered (file,
656 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
657 XSTRING (TARGET_ADDR_BIT));
659 fprintf_unfiltered (file,
660 "gdbarch_dump: addr_bit = %s\n",
661 paddr_d (current_gdbarch->addr_bit));
662 #ifdef ADDR_BITS_REMOVE
663 fprintf_unfiltered (file,
664 "gdbarch_dump: %s # %s\n",
665 "ADDR_BITS_REMOVE(addr)",
666 XSTRING (ADDR_BITS_REMOVE (addr)));
668 fprintf_unfiltered (file,
669 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
670 (long) current_gdbarch->addr_bits_remove);
671 fprintf_unfiltered (file,
672 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
673 gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
674 fprintf_unfiltered (file,
675 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
676 (long) current_gdbarch->address_class_name_to_type_flags);
677 #ifdef ADDRESS_CLASS_TYPE_FLAGS_P
678 fprintf_unfiltered (file,
679 "gdbarch_dump: %s # %s\n",
680 "ADDRESS_CLASS_TYPE_FLAGS_P()",
681 XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ()));
683 fprintf_unfiltered (file,
684 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
685 gdbarch_address_class_type_flags_p (current_gdbarch));
686 #ifdef ADDRESS_CLASS_TYPE_FLAGS
687 fprintf_unfiltered (file,
688 "gdbarch_dump: %s # %s\n",
689 "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
690 XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class)));
692 fprintf_unfiltered (file,
693 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
694 (long) current_gdbarch->address_class_type_flags);
695 fprintf_unfiltered (file,
696 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
697 gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
698 fprintf_unfiltered (file,
699 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
700 (long) current_gdbarch->address_class_type_flags_to_name);
701 #ifdef ADDRESS_TO_POINTER
702 fprintf_unfiltered (file,
703 "gdbarch_dump: %s # %s\n",
704 "ADDRESS_TO_POINTER(type, buf, addr)",
705 XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
707 fprintf_unfiltered (file,
708 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
709 (long) current_gdbarch->address_to_pointer);
710 fprintf_unfiltered (file,
711 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
712 gdbarch_adjust_breakpoint_address_p (current_gdbarch));
713 fprintf_unfiltered (file,
714 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
715 (long) current_gdbarch->adjust_breakpoint_address);
716 #ifdef BELIEVE_PCC_PROMOTION
717 fprintf_unfiltered (file,
718 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
719 XSTRING (BELIEVE_PCC_PROMOTION));
721 fprintf_unfiltered (file,
722 "gdbarch_dump: believe_pcc_promotion = %s\n",
723 paddr_d (current_gdbarch->believe_pcc_promotion));
724 #ifdef TARGET_ARCHITECTURE
725 fprintf_unfiltered (file,
726 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
727 XSTRING (TARGET_ARCHITECTURE));
729 fprintf_unfiltered (file,
730 "gdbarch_dump: bfd_arch_info = %s\n",
731 TARGET_ARCHITECTURE->printable_name);
732 #ifdef TARGET_BFD_VMA_BIT
733 fprintf_unfiltered (file,
734 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
735 XSTRING (TARGET_BFD_VMA_BIT));
737 fprintf_unfiltered (file,
738 "gdbarch_dump: bfd_vma_bit = %s\n",
739 paddr_d (current_gdbarch->bfd_vma_bit));
740 #ifdef BREAKPOINT_FROM_PC
741 fprintf_unfiltered (file,
742 "gdbarch_dump: %s # %s\n",
743 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
744 XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
746 fprintf_unfiltered (file,
747 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
748 (long) current_gdbarch->breakpoint_from_pc);
749 #ifdef TARGET_BYTE_ORDER
750 fprintf_unfiltered (file,
751 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
752 XSTRING (TARGET_BYTE_ORDER));
754 fprintf_unfiltered (file,
755 "gdbarch_dump: byte_order = %s\n",
756 paddr_d (current_gdbarch->byte_order));
757 #ifdef CALL_DUMMY_LOCATION
758 fprintf_unfiltered (file,
759 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
760 XSTRING (CALL_DUMMY_LOCATION));
762 fprintf_unfiltered (file,
763 "gdbarch_dump: call_dummy_location = %s\n",
764 paddr_d (current_gdbarch->call_dummy_location));
765 #ifdef CANNOT_FETCH_REGISTER
766 fprintf_unfiltered (file,
767 "gdbarch_dump: %s # %s\n",
768 "CANNOT_FETCH_REGISTER(regnum)",
769 XSTRING (CANNOT_FETCH_REGISTER (regnum)));
771 fprintf_unfiltered (file,
772 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
773 (long) current_gdbarch->cannot_fetch_register);
774 #ifdef CANNOT_STEP_BREAKPOINT
775 fprintf_unfiltered (file,
776 "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
777 XSTRING (CANNOT_STEP_BREAKPOINT));
779 fprintf_unfiltered (file,
780 "gdbarch_dump: cannot_step_breakpoint = %s\n",
781 paddr_d (current_gdbarch->cannot_step_breakpoint));
782 #ifdef CANNOT_STORE_REGISTER
783 fprintf_unfiltered (file,
784 "gdbarch_dump: %s # %s\n",
785 "CANNOT_STORE_REGISTER(regnum)",
786 XSTRING (CANNOT_STORE_REGISTER (regnum)));
788 fprintf_unfiltered (file,
789 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
790 (long) current_gdbarch->cannot_store_register);
791 #ifdef TARGET_CHAR_SIGNED
792 fprintf_unfiltered (file,
793 "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
794 XSTRING (TARGET_CHAR_SIGNED));
796 fprintf_unfiltered (file,
797 "gdbarch_dump: char_signed = %s\n",
798 paddr_d (current_gdbarch->char_signed));
799 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
800 fprintf_unfiltered (file,
801 "gdbarch_dump: %s # %s\n",
802 "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
803 XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
805 fprintf_unfiltered (file,
806 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
807 (long) current_gdbarch->coff_make_msymbol_special);
808 fprintf_unfiltered (file,
809 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
810 (long) current_gdbarch->construct_inferior_arguments);
811 fprintf_unfiltered (file,
812 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
813 (long) current_gdbarch->convert_from_func_ptr_addr);
814 #ifdef CONVERT_REGISTER_P
815 fprintf_unfiltered (file,
816 "gdbarch_dump: %s # %s\n",
817 "CONVERT_REGISTER_P(regnum, type)",
818 XSTRING (CONVERT_REGISTER_P (regnum, type)));
820 fprintf_unfiltered (file,
821 "gdbarch_dump: convert_register_p = <0x%lx>\n",
822 (long) current_gdbarch->convert_register_p);
823 #ifdef DECR_PC_AFTER_BREAK
824 fprintf_unfiltered (file,
825 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
826 XSTRING (DECR_PC_AFTER_BREAK));
828 fprintf_unfiltered (file,
829 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
830 paddr_nz (current_gdbarch->decr_pc_after_break));
831 #ifdef DEPRECATED_EXTRACT_RETURN_VALUE
832 fprintf_unfiltered (file,
833 "gdbarch_dump: %s # %s\n",
834 "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
835 XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
837 fprintf_unfiltered (file,
838 "gdbarch_dump: deprecated_extract_return_value = <0x%lx>\n",
839 (long) current_gdbarch->deprecated_extract_return_value);
840 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
841 fprintf_unfiltered (file,
842 "gdbarch_dump: %s # %s\n",
843 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
844 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
846 fprintf_unfiltered (file,
847 "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
848 gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch));
849 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
850 fprintf_unfiltered (file,
851 "gdbarch_dump: %s # %s\n",
852 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
853 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
855 fprintf_unfiltered (file,
856 "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
857 (long) current_gdbarch->deprecated_extract_struct_value_address);
858 #ifdef DEPRECATED_FP_REGNUM
859 fprintf_unfiltered (file,
860 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
861 XSTRING (DEPRECATED_FP_REGNUM));
863 fprintf_unfiltered (file,
864 "gdbarch_dump: deprecated_fp_regnum = %s\n",
865 paddr_d (current_gdbarch->deprecated_fp_regnum));
866 #ifdef DEPRECATED_FUNCTION_START_OFFSET
867 fprintf_unfiltered (file,
868 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
869 XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
871 fprintf_unfiltered (file,
872 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
873 paddr_nz (current_gdbarch->deprecated_function_start_offset));
874 #ifdef DEPRECATED_PUSH_ARGUMENTS_P
875 fprintf_unfiltered (file,
876 "gdbarch_dump: %s # %s\n",
877 "DEPRECATED_PUSH_ARGUMENTS_P()",
878 XSTRING (DEPRECATED_PUSH_ARGUMENTS_P ()));
880 fprintf_unfiltered (file,
881 "gdbarch_dump: gdbarch_deprecated_push_arguments_p() = %d\n",
882 gdbarch_deprecated_push_arguments_p (current_gdbarch));
883 #ifdef DEPRECATED_PUSH_ARGUMENTS
884 fprintf_unfiltered (file,
885 "gdbarch_dump: %s # %s\n",
886 "DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
887 XSTRING (DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
889 fprintf_unfiltered (file,
890 "gdbarch_dump: deprecated_push_arguments = <0x%lx>\n",
891 (long) current_gdbarch->deprecated_push_arguments);
892 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
893 fprintf_unfiltered (file,
894 "gdbarch_dump: %s # %s\n",
895 "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
896 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
898 fprintf_unfiltered (file,
899 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
900 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch));
901 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
902 fprintf_unfiltered (file,
903 "gdbarch_dump: %s # %s\n",
904 "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
905 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
907 fprintf_unfiltered (file,
908 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
909 (long) current_gdbarch->deprecated_reg_struct_has_addr);
910 #ifdef DEPRECATED_REGISTER_BYTE_P
911 fprintf_unfiltered (file,
912 "gdbarch_dump: %s # %s\n",
913 "DEPRECATED_REGISTER_BYTE_P()",
914 XSTRING (DEPRECATED_REGISTER_BYTE_P ()));
916 fprintf_unfiltered (file,
917 "gdbarch_dump: gdbarch_deprecated_register_byte_p() = %d\n",
918 gdbarch_deprecated_register_byte_p (current_gdbarch));
919 #ifdef DEPRECATED_REGISTER_BYTE
920 fprintf_unfiltered (file,
921 "gdbarch_dump: %s # %s\n",
922 "DEPRECATED_REGISTER_BYTE(reg_nr)",
923 XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr)));
925 fprintf_unfiltered (file,
926 "gdbarch_dump: deprecated_register_byte = <0x%lx>\n",
927 (long) current_gdbarch->deprecated_register_byte);
928 #ifdef DEPRECATED_REGISTER_SIZE
929 fprintf_unfiltered (file,
930 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
931 XSTRING (DEPRECATED_REGISTER_SIZE));
933 fprintf_unfiltered (file,
934 "gdbarch_dump: deprecated_register_size = %s\n",
935 paddr_d (current_gdbarch->deprecated_register_size));
936 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P
937 fprintf_unfiltered (file,
938 "gdbarch_dump: %s # %s\n",
939 "DEPRECATED_SAVED_PC_AFTER_CALL_P()",
940 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL_P ()));
942 fprintf_unfiltered (file,
943 "gdbarch_dump: gdbarch_deprecated_saved_pc_after_call_p() = %d\n",
944 gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch));
945 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL
946 fprintf_unfiltered (file,
947 "gdbarch_dump: %s # %s\n",
948 "DEPRECATED_SAVED_PC_AFTER_CALL(frame)",
949 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL (frame)));
951 fprintf_unfiltered (file,
952 "gdbarch_dump: deprecated_saved_pc_after_call = <0x%lx>\n",
953 (long) current_gdbarch->deprecated_saved_pc_after_call);
954 #ifdef DEPRECATED_STACK_ALIGN_P
955 fprintf_unfiltered (file,
956 "gdbarch_dump: %s # %s\n",
957 "DEPRECATED_STACK_ALIGN_P()",
958 XSTRING (DEPRECATED_STACK_ALIGN_P ()));
960 fprintf_unfiltered (file,
961 "gdbarch_dump: gdbarch_deprecated_stack_align_p() = %d\n",
962 gdbarch_deprecated_stack_align_p (current_gdbarch));
963 #ifdef DEPRECATED_STACK_ALIGN
964 fprintf_unfiltered (file,
965 "gdbarch_dump: %s # %s\n",
966 "DEPRECATED_STACK_ALIGN(sp)",
967 XSTRING (DEPRECATED_STACK_ALIGN (sp)));
969 fprintf_unfiltered (file,
970 "gdbarch_dump: deprecated_stack_align = <0x%lx>\n",
971 (long) current_gdbarch->deprecated_stack_align);
972 #ifdef DEPRECATED_STORE_RETURN_VALUE
973 fprintf_unfiltered (file,
974 "gdbarch_dump: %s # %s\n",
975 "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
976 XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf)));
978 fprintf_unfiltered (file,
979 "gdbarch_dump: deprecated_store_return_value = <0x%lx>\n",
980 (long) current_gdbarch->deprecated_store_return_value);
981 #ifdef DEPRECATED_STORE_STRUCT_RETURN_P
982 fprintf_unfiltered (file,
983 "gdbarch_dump: %s # %s\n",
984 "DEPRECATED_STORE_STRUCT_RETURN_P()",
985 XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ()));
987 fprintf_unfiltered (file,
988 "gdbarch_dump: gdbarch_deprecated_store_struct_return_p() = %d\n",
989 gdbarch_deprecated_store_struct_return_p (current_gdbarch));
990 #ifdef DEPRECATED_STORE_STRUCT_RETURN
991 fprintf_unfiltered (file,
992 "gdbarch_dump: %s # %s\n",
993 "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)",
994 XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr, sp)));
996 fprintf_unfiltered (file,
997 "gdbarch_dump: deprecated_store_struct_return = <0x%lx>\n",
998 (long) current_gdbarch->deprecated_store_struct_return);
999 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
1000 fprintf_unfiltered (file,
1001 "gdbarch_dump: %s # %s\n",
1002 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
1003 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type)));
1005 fprintf_unfiltered (file,
1006 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
1007 (long) current_gdbarch->deprecated_use_struct_convention);
1008 #ifdef TARGET_DOUBLE_BIT
1009 fprintf_unfiltered (file,
1010 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
1011 XSTRING (TARGET_DOUBLE_BIT));
1013 fprintf_unfiltered (file,
1014 "gdbarch_dump: double_bit = %s\n",
1015 paddr_d (current_gdbarch->double_bit));
1016 #ifdef TARGET_DOUBLE_FORMAT
1017 fprintf_unfiltered (file,
1018 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
1019 XSTRING (TARGET_DOUBLE_FORMAT));
1021 fprintf_unfiltered (file,
1022 "gdbarch_dump: double_format = %s\n",
1023 pformat (current_gdbarch->double_format));
1024 #ifdef DWARF2_REG_TO_REGNUM
1025 fprintf_unfiltered (file,
1026 "gdbarch_dump: %s # %s\n",
1027 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
1028 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
1030 fprintf_unfiltered (file,
1031 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
1032 (long) current_gdbarch->dwarf2_reg_to_regnum);
1033 #ifdef DWARF_REG_TO_REGNUM
1034 fprintf_unfiltered (file,
1035 "gdbarch_dump: %s # %s\n",
1036 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1037 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
1039 fprintf_unfiltered (file,
1040 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
1041 (long) current_gdbarch->dwarf_reg_to_regnum);
1042 #ifdef ECOFF_REG_TO_REGNUM
1043 fprintf_unfiltered (file,
1044 "gdbarch_dump: %s # %s\n",
1045 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1046 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
1048 fprintf_unfiltered (file,
1049 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
1050 (long) current_gdbarch->ecoff_reg_to_regnum);
1051 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
1052 fprintf_unfiltered (file,
1053 "gdbarch_dump: %s # %s\n",
1054 "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1055 XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
1057 fprintf_unfiltered (file,
1058 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
1059 (long) current_gdbarch->elf_make_msymbol_special);
1060 #ifdef EXTRACT_RETURN_VALUE
1061 fprintf_unfiltered (file,
1062 "gdbarch_dump: %s # %s\n",
1063 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1064 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
1066 fprintf_unfiltered (file,
1067 "gdbarch_dump: extract_return_value = <0x%lx>\n",
1068 (long) current_gdbarch->extract_return_value);
1069 #ifdef FETCH_POINTER_ARGUMENT_P
1070 fprintf_unfiltered (file,
1071 "gdbarch_dump: %s # %s\n",
1072 "FETCH_POINTER_ARGUMENT_P()",
1073 XSTRING (FETCH_POINTER_ARGUMENT_P ()));
1075 fprintf_unfiltered (file,
1076 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
1077 gdbarch_fetch_pointer_argument_p (current_gdbarch));
1078 #ifdef FETCH_POINTER_ARGUMENT
1079 fprintf_unfiltered (file,
1080 "gdbarch_dump: %s # %s\n",
1081 "FETCH_POINTER_ARGUMENT(frame, argi, type)",
1082 XSTRING (FETCH_POINTER_ARGUMENT (frame, argi, type)));
1084 fprintf_unfiltered (file,
1085 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
1086 (long) current_gdbarch->fetch_pointer_argument);
1087 #ifdef TARGET_FLOAT_BIT
1088 fprintf_unfiltered (file,
1089 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
1090 XSTRING (TARGET_FLOAT_BIT));
1092 fprintf_unfiltered (file,
1093 "gdbarch_dump: float_bit = %s\n",
1094 paddr_d (current_gdbarch->float_bit));
1095 #ifdef TARGET_FLOAT_FORMAT
1096 fprintf_unfiltered (file,
1097 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1098 XSTRING (TARGET_FLOAT_FORMAT));
1100 fprintf_unfiltered (file,
1101 "gdbarch_dump: float_format = %s\n",
1102 pformat (current_gdbarch->float_format));
1104 fprintf_unfiltered (file,
1105 "gdbarch_dump: FP0_REGNUM # %s\n",
1106 XSTRING (FP0_REGNUM));
1108 fprintf_unfiltered (file,
1109 "gdbarch_dump: fp0_regnum = %s\n",
1110 paddr_d (current_gdbarch->fp0_regnum));
1111 fprintf_unfiltered (file,
1112 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
1113 gdbarch_frame_align_p (current_gdbarch));
1114 fprintf_unfiltered (file,
1115 "gdbarch_dump: frame_align = <0x%lx>\n",
1116 (long) current_gdbarch->frame_align);
1117 #ifdef FRAME_ARGS_SKIP
1118 fprintf_unfiltered (file,
1119 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1120 XSTRING (FRAME_ARGS_SKIP));
1122 fprintf_unfiltered (file,
1123 "gdbarch_dump: frame_args_skip = 0x%s\n",
1124 paddr_nz (current_gdbarch->frame_args_skip));
1125 #ifdef FRAME_NUM_ARGS_P
1126 fprintf_unfiltered (file,
1127 "gdbarch_dump: %s # %s\n",
1128 "FRAME_NUM_ARGS_P()",
1129 XSTRING (FRAME_NUM_ARGS_P ()));
1131 fprintf_unfiltered (file,
1132 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
1133 gdbarch_frame_num_args_p (current_gdbarch));
1134 #ifdef FRAME_NUM_ARGS
1135 fprintf_unfiltered (file,
1136 "gdbarch_dump: %s # %s\n",
1137 "FRAME_NUM_ARGS(frame)",
1138 XSTRING (FRAME_NUM_ARGS (frame)));
1140 fprintf_unfiltered (file,
1141 "gdbarch_dump: frame_num_args = <0x%lx>\n",
1142 (long) current_gdbarch->frame_num_args);
1143 #ifdef FRAME_RED_ZONE_SIZE
1144 fprintf_unfiltered (file,
1145 "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
1146 XSTRING (FRAME_RED_ZONE_SIZE));
1148 fprintf_unfiltered (file,
1149 "gdbarch_dump: frame_red_zone_size = %s\n",
1150 paddr_d (current_gdbarch->frame_red_zone_size));
1151 #ifdef GET_LONGJMP_TARGET_P
1152 fprintf_unfiltered (file,
1153 "gdbarch_dump: %s # %s\n",
1154 "GET_LONGJMP_TARGET_P()",
1155 XSTRING (GET_LONGJMP_TARGET_P ()));
1157 fprintf_unfiltered (file,
1158 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1159 gdbarch_get_longjmp_target_p (current_gdbarch));
1160 #ifdef GET_LONGJMP_TARGET
1161 fprintf_unfiltered (file,
1162 "gdbarch_dump: %s # %s\n",
1163 "GET_LONGJMP_TARGET(pc)",
1164 XSTRING (GET_LONGJMP_TARGET (pc)));
1166 fprintf_unfiltered (file,
1167 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
1168 (long) current_gdbarch->get_longjmp_target);
1169 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
1170 fprintf_unfiltered (file,
1171 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1172 XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
1174 fprintf_unfiltered (file,
1175 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1176 paddr_d (current_gdbarch->have_nonsteppable_watchpoint));
1177 fprintf_unfiltered (file,
1178 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
1179 (long) current_gdbarch->in_function_epilogue_p);
1180 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1181 fprintf_unfiltered (file,
1182 "gdbarch_dump: %s # %s\n",
1183 "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1184 XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
1186 fprintf_unfiltered (file,
1187 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
1188 (long) current_gdbarch->in_solib_return_trampoline);
1190 fprintf_unfiltered (file,
1191 "gdbarch_dump: %s # %s\n",
1192 "INNER_THAN(lhs, rhs)",
1193 XSTRING (INNER_THAN (lhs, rhs)));
1195 fprintf_unfiltered (file,
1196 "gdbarch_dump: inner_than = <0x%lx>\n",
1197 (long) current_gdbarch->inner_than);
1198 #ifdef TARGET_INT_BIT
1199 fprintf_unfiltered (file,
1200 "gdbarch_dump: TARGET_INT_BIT # %s\n",
1201 XSTRING (TARGET_INT_BIT));
1203 fprintf_unfiltered (file,
1204 "gdbarch_dump: int_bit = %s\n",
1205 paddr_d (current_gdbarch->int_bit));
1206 fprintf_unfiltered (file,
1207 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1208 gdbarch_integer_to_address_p (current_gdbarch));
1209 fprintf_unfiltered (file,
1210 "gdbarch_dump: integer_to_address = <0x%lx>\n",
1211 (long) current_gdbarch->integer_to_address);
1212 #ifdef TARGET_LONG_BIT
1213 fprintf_unfiltered (file,
1214 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
1215 XSTRING (TARGET_LONG_BIT));
1217 fprintf_unfiltered (file,
1218 "gdbarch_dump: long_bit = %s\n",
1219 paddr_d (current_gdbarch->long_bit));
1220 #ifdef TARGET_LONG_DOUBLE_BIT
1221 fprintf_unfiltered (file,
1222 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
1223 XSTRING (TARGET_LONG_DOUBLE_BIT));
1225 fprintf_unfiltered (file,
1226 "gdbarch_dump: long_double_bit = %s\n",
1227 paddr_d (current_gdbarch->long_double_bit));
1228 #ifdef TARGET_LONG_DOUBLE_FORMAT
1229 fprintf_unfiltered (file,
1230 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1231 XSTRING (TARGET_LONG_DOUBLE_FORMAT));
1233 fprintf_unfiltered (file,
1234 "gdbarch_dump: long_double_format = %s\n",
1235 pformat (current_gdbarch->long_double_format));
1236 #ifdef TARGET_LONG_LONG_BIT
1237 fprintf_unfiltered (file,
1238 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
1239 XSTRING (TARGET_LONG_LONG_BIT));
1241 fprintf_unfiltered (file,
1242 "gdbarch_dump: long_long_bit = %s\n",
1243 paddr_d (current_gdbarch->long_long_bit));
1244 #ifdef MEMORY_INSERT_BREAKPOINT
1245 fprintf_unfiltered (file,
1246 "gdbarch_dump: %s # %s\n",
1247 "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1248 XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
1250 fprintf_unfiltered (file,
1251 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
1252 (long) current_gdbarch->memory_insert_breakpoint);
1253 #ifdef MEMORY_REMOVE_BREAKPOINT
1254 fprintf_unfiltered (file,
1255 "gdbarch_dump: %s # %s\n",
1256 "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1257 XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
1259 fprintf_unfiltered (file,
1260 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
1261 (long) current_gdbarch->memory_remove_breakpoint);
1262 #ifdef NAME_OF_MALLOC
1263 fprintf_unfiltered (file,
1264 "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1265 XSTRING (NAME_OF_MALLOC));
1267 fprintf_unfiltered (file,
1268 "gdbarch_dump: name_of_malloc = %s\n",
1270 #ifdef NUM_PSEUDO_REGS
1271 fprintf_unfiltered (file,
1272 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1273 XSTRING (NUM_PSEUDO_REGS));
1275 fprintf_unfiltered (file,
1276 "gdbarch_dump: num_pseudo_regs = %s\n",
1277 paddr_d (current_gdbarch->num_pseudo_regs));
1279 fprintf_unfiltered (file,
1280 "gdbarch_dump: NUM_REGS # %s\n",
1281 XSTRING (NUM_REGS));
1283 fprintf_unfiltered (file,
1284 "gdbarch_dump: num_regs = %s\n",
1285 paddr_d (current_gdbarch->num_regs));
1287 fprintf_unfiltered (file,
1288 "gdbarch_dump: TARGET_OSABI # %s\n",
1289 XSTRING (TARGET_OSABI));
1291 fprintf_unfiltered (file,
1292 "gdbarch_dump: osabi = %s\n",
1293 paddr_d (current_gdbarch->osabi));
1295 fprintf_unfiltered (file,
1296 "gdbarch_dump: PC_REGNUM # %s\n",
1297 XSTRING (PC_REGNUM));
1299 fprintf_unfiltered (file,
1300 "gdbarch_dump: pc_regnum = %s\n",
1301 paddr_d (current_gdbarch->pc_regnum));
1302 #ifdef POINTER_TO_ADDRESS
1303 fprintf_unfiltered (file,
1304 "gdbarch_dump: %s # %s\n",
1305 "POINTER_TO_ADDRESS(type, buf)",
1306 XSTRING (POINTER_TO_ADDRESS (type, buf)));
1308 fprintf_unfiltered (file,
1309 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
1310 (long) current_gdbarch->pointer_to_address);
1311 fprintf_unfiltered (file,
1312 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1313 gdbarch_print_float_info_p (current_gdbarch));
1314 fprintf_unfiltered (file,
1315 "gdbarch_dump: print_float_info = <0x%lx>\n",
1316 (long) current_gdbarch->print_float_info);
1317 #ifdef TARGET_PRINT_INSN
1318 fprintf_unfiltered (file,
1319 "gdbarch_dump: %s # %s\n",
1320 "TARGET_PRINT_INSN(vma, info)",
1321 XSTRING (TARGET_PRINT_INSN (vma, info)));
1323 fprintf_unfiltered (file,
1324 "gdbarch_dump: print_insn = <0x%lx>\n",
1325 (long) current_gdbarch->print_insn);
1326 fprintf_unfiltered (file,
1327 "gdbarch_dump: print_registers_info = <0x%lx>\n",
1328 (long) current_gdbarch->print_registers_info);
1329 fprintf_unfiltered (file,
1330 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1331 gdbarch_print_vector_info_p (current_gdbarch));
1332 fprintf_unfiltered (file,
1333 "gdbarch_dump: print_vector_info = <0x%lx>\n",
1334 (long) current_gdbarch->print_vector_info);
1336 fprintf_unfiltered (file,
1337 "gdbarch_dump: PS_REGNUM # %s\n",
1338 XSTRING (PS_REGNUM));
1340 fprintf_unfiltered (file,
1341 "gdbarch_dump: ps_regnum = %s\n",
1342 paddr_d (current_gdbarch->ps_regnum));
1343 fprintf_unfiltered (file,
1344 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1345 gdbarch_pseudo_register_read_p (current_gdbarch));
1346 fprintf_unfiltered (file,
1347 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
1348 (long) current_gdbarch->pseudo_register_read);
1349 fprintf_unfiltered (file,
1350 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1351 gdbarch_pseudo_register_write_p (current_gdbarch));
1352 fprintf_unfiltered (file,
1353 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
1354 (long) current_gdbarch->pseudo_register_write);
1355 #ifdef TARGET_PTR_BIT
1356 fprintf_unfiltered (file,
1357 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
1358 XSTRING (TARGET_PTR_BIT));
1360 fprintf_unfiltered (file,
1361 "gdbarch_dump: ptr_bit = %s\n",
1362 paddr_d (current_gdbarch->ptr_bit));
1363 fprintf_unfiltered (file,
1364 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1365 gdbarch_push_dummy_call_p (current_gdbarch));
1366 fprintf_unfiltered (file,
1367 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
1368 (long) current_gdbarch->push_dummy_call);
1369 fprintf_unfiltered (file,
1370 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1371 gdbarch_push_dummy_code_p (current_gdbarch));
1372 fprintf_unfiltered (file,
1373 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
1374 (long) current_gdbarch->push_dummy_code);
1375 #ifdef TARGET_READ_PC_P
1376 fprintf_unfiltered (file,
1377 "gdbarch_dump: %s # %s\n",
1378 "TARGET_READ_PC_P()",
1379 XSTRING (TARGET_READ_PC_P ()));
1381 fprintf_unfiltered (file,
1382 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1383 gdbarch_read_pc_p (current_gdbarch));
1384 #ifdef TARGET_READ_PC
1385 fprintf_unfiltered (file,
1386 "gdbarch_dump: %s # %s\n",
1387 "TARGET_READ_PC(ptid)",
1388 XSTRING (TARGET_READ_PC (ptid)));
1390 fprintf_unfiltered (file,
1391 "gdbarch_dump: read_pc = <0x%lx>\n",
1392 (long) current_gdbarch->read_pc);
1393 #ifdef TARGET_READ_SP_P
1394 fprintf_unfiltered (file,
1395 "gdbarch_dump: %s # %s\n",
1396 "TARGET_READ_SP_P()",
1397 XSTRING (TARGET_READ_SP_P ()));
1399 fprintf_unfiltered (file,
1400 "gdbarch_dump: gdbarch_read_sp_p() = %d\n",
1401 gdbarch_read_sp_p (current_gdbarch));
1402 #ifdef TARGET_READ_SP
1403 fprintf_unfiltered (file,
1404 "gdbarch_dump: %s # %s\n",
1406 XSTRING (TARGET_READ_SP ()));
1408 fprintf_unfiltered (file,
1409 "gdbarch_dump: read_sp = <0x%lx>\n",
1410 (long) current_gdbarch->read_sp);
1411 #ifdef REGISTER_BYTES_OK_P
1412 fprintf_unfiltered (file,
1413 "gdbarch_dump: %s # %s\n",
1414 "REGISTER_BYTES_OK_P()",
1415 XSTRING (REGISTER_BYTES_OK_P ()));
1417 fprintf_unfiltered (file,
1418 "gdbarch_dump: gdbarch_register_bytes_ok_p() = %d\n",
1419 gdbarch_register_bytes_ok_p (current_gdbarch));
1420 #ifdef REGISTER_BYTES_OK
1421 fprintf_unfiltered (file,
1422 "gdbarch_dump: %s # %s\n",
1423 "REGISTER_BYTES_OK(nr_bytes)",
1424 XSTRING (REGISTER_BYTES_OK (nr_bytes)));
1426 fprintf_unfiltered (file,
1427 "gdbarch_dump: register_bytes_ok = <0x%lx>\n",
1428 (long) current_gdbarch->register_bytes_ok);
1429 #ifdef REGISTER_NAME
1430 fprintf_unfiltered (file,
1431 "gdbarch_dump: %s # %s\n",
1432 "REGISTER_NAME(regnr)",
1433 XSTRING (REGISTER_NAME (regnr)));
1435 fprintf_unfiltered (file,
1436 "gdbarch_dump: register_name = <0x%lx>\n",
1437 (long) current_gdbarch->register_name);
1438 fprintf_unfiltered (file,
1439 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
1440 (long) current_gdbarch->register_reggroup_p);
1441 #ifdef REGISTER_SIM_REGNO
1442 fprintf_unfiltered (file,
1443 "gdbarch_dump: %s # %s\n",
1444 "REGISTER_SIM_REGNO(reg_nr)",
1445 XSTRING (REGISTER_SIM_REGNO (reg_nr)));
1447 fprintf_unfiltered (file,
1448 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
1449 (long) current_gdbarch->register_sim_regno);
1450 #ifdef REGISTER_TO_VALUE
1451 fprintf_unfiltered (file,
1452 "gdbarch_dump: %s # %s\n",
1453 "REGISTER_TO_VALUE(frame, regnum, type, buf)",
1454 XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf)));
1456 fprintf_unfiltered (file,
1457 "gdbarch_dump: register_to_value = <0x%lx>\n",
1458 (long) current_gdbarch->register_to_value);
1459 fprintf_unfiltered (file,
1460 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1461 gdbarch_register_type_p (current_gdbarch));
1462 fprintf_unfiltered (file,
1463 "gdbarch_dump: register_type = <0x%lx>\n",
1464 (long) current_gdbarch->register_type);
1465 fprintf_unfiltered (file,
1466 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1467 gdbarch_regset_from_core_section_p (current_gdbarch));
1468 fprintf_unfiltered (file,
1469 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
1470 (long) current_gdbarch->regset_from_core_section);
1471 fprintf_unfiltered (file,
1472 "gdbarch_dump: remote_translate_xfer_address = <0x%lx>\n",
1473 (long) current_gdbarch->remote_translate_xfer_address);
1474 fprintf_unfiltered (file,
1475 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1476 gdbarch_return_value_p (current_gdbarch));
1477 fprintf_unfiltered (file,
1478 "gdbarch_dump: return_value = <0x%lx>\n",
1479 (long) current_gdbarch->return_value);
1480 #ifdef SDB_REG_TO_REGNUM
1481 fprintf_unfiltered (file,
1482 "gdbarch_dump: %s # %s\n",
1483 "SDB_REG_TO_REGNUM(sdb_regnr)",
1484 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
1486 fprintf_unfiltered (file,
1487 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1488 (long) current_gdbarch->sdb_reg_to_regnum);
1489 #ifdef TARGET_SHORT_BIT
1490 fprintf_unfiltered (file,
1491 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
1492 XSTRING (TARGET_SHORT_BIT));
1494 fprintf_unfiltered (file,
1495 "gdbarch_dump: short_bit = %s\n",
1496 paddr_d (current_gdbarch->short_bit));
1497 fprintf_unfiltered (file,
1498 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1499 gdbarch_single_step_through_delay_p (current_gdbarch));
1500 fprintf_unfiltered (file,
1501 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
1502 (long) current_gdbarch->single_step_through_delay);
1503 #ifdef SKIP_PROLOGUE
1504 fprintf_unfiltered (file,
1505 "gdbarch_dump: %s # %s\n",
1506 "SKIP_PROLOGUE(ip)",
1507 XSTRING (SKIP_PROLOGUE (ip)));
1509 fprintf_unfiltered (file,
1510 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1511 (long) current_gdbarch->skip_prologue);
1512 fprintf_unfiltered (file,
1513 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1514 (long) current_gdbarch->skip_solib_resolver);
1515 #ifdef SKIP_TRAMPOLINE_CODE
1516 fprintf_unfiltered (file,
1517 "gdbarch_dump: %s # %s\n",
1518 "SKIP_TRAMPOLINE_CODE(pc)",
1519 XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
1521 fprintf_unfiltered (file,
1522 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1523 (long) current_gdbarch->skip_trampoline_code);
1524 #ifdef SMASH_TEXT_ADDRESS
1525 fprintf_unfiltered (file,
1526 "gdbarch_dump: %s # %s\n",
1527 "SMASH_TEXT_ADDRESS(addr)",
1528 XSTRING (SMASH_TEXT_ADDRESS (addr)));
1530 fprintf_unfiltered (file,
1531 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1532 (long) current_gdbarch->smash_text_address);
1533 #ifdef SOFTWARE_SINGLE_STEP_P
1534 fprintf_unfiltered (file,
1535 "gdbarch_dump: %s # %s\n",
1536 "SOFTWARE_SINGLE_STEP_P()",
1537 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1539 fprintf_unfiltered (file,
1540 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1541 gdbarch_software_single_step_p (current_gdbarch));
1542 #ifdef SOFTWARE_SINGLE_STEP
1543 fprintf_unfiltered (file,
1544 "gdbarch_dump: %s # %s\n",
1545 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
1546 XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
1548 fprintf_unfiltered (file,
1549 "gdbarch_dump: software_single_step = <0x%lx>\n",
1550 (long) current_gdbarch->software_single_step);
1552 fprintf_unfiltered (file,
1553 "gdbarch_dump: SP_REGNUM # %s\n",
1554 XSTRING (SP_REGNUM));
1556 fprintf_unfiltered (file,
1557 "gdbarch_dump: sp_regnum = %s\n",
1558 paddr_d (current_gdbarch->sp_regnum));
1559 #ifdef STAB_REG_TO_REGNUM
1560 fprintf_unfiltered (file,
1561 "gdbarch_dump: %s # %s\n",
1562 "STAB_REG_TO_REGNUM(stab_regnr)",
1563 XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
1565 fprintf_unfiltered (file,
1566 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1567 (long) current_gdbarch->stab_reg_to_regnum);
1568 fprintf_unfiltered (file,
1569 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1570 (long) current_gdbarch->stabs_argument_has_addr);
1571 #ifdef STORE_RETURN_VALUE
1572 fprintf_unfiltered (file,
1573 "gdbarch_dump: %s # %s\n",
1574 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1575 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
1577 fprintf_unfiltered (file,
1578 "gdbarch_dump: store_return_value = <0x%lx>\n",
1579 (long) current_gdbarch->store_return_value);
1580 fprintf_unfiltered (file,
1581 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1582 gdbarch_unwind_dummy_id_p (current_gdbarch));
1583 fprintf_unfiltered (file,
1584 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1585 (long) current_gdbarch->unwind_dummy_id);
1586 fprintf_unfiltered (file,
1587 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1588 gdbarch_unwind_pc_p (current_gdbarch));
1589 fprintf_unfiltered (file,
1590 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1591 (long) current_gdbarch->unwind_pc);
1592 fprintf_unfiltered (file,
1593 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1594 gdbarch_unwind_sp_p (current_gdbarch));
1595 fprintf_unfiltered (file,
1596 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1597 (long) current_gdbarch->unwind_sp);
1598 #ifdef VALUE_TO_REGISTER
1599 fprintf_unfiltered (file,
1600 "gdbarch_dump: %s # %s\n",
1601 "VALUE_TO_REGISTER(frame, regnum, type, buf)",
1602 XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf)));
1604 fprintf_unfiltered (file,
1605 "gdbarch_dump: value_to_register = <0x%lx>\n",
1606 (long) current_gdbarch->value_to_register);
1607 #ifdef TARGET_VIRTUAL_FRAME_POINTER
1608 fprintf_unfiltered (file,
1609 "gdbarch_dump: %s # %s\n",
1610 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
1611 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
1613 fprintf_unfiltered (file,
1614 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1615 (long) current_gdbarch->virtual_frame_pointer);
1616 #ifdef TARGET_WRITE_PC
1617 fprintf_unfiltered (file,
1618 "gdbarch_dump: %s # %s\n",
1619 "TARGET_WRITE_PC(val, ptid)",
1620 XSTRING (TARGET_WRITE_PC (val, ptid)));
1622 fprintf_unfiltered (file,
1623 "gdbarch_dump: write_pc = <0x%lx>\n",
1624 (long) current_gdbarch->write_pc);
1625 if (current_gdbarch->dump_tdep != NULL)
1626 current_gdbarch->dump_tdep (current_gdbarch, file);
1629 struct gdbarch_tdep *
1630 gdbarch_tdep (struct gdbarch *gdbarch)
1632 if (gdbarch_debug >= 2)
1633 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1634 return gdbarch->tdep;
1638 const struct bfd_arch_info *
1639 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1641 gdb_assert (gdbarch != NULL);
1642 if (gdbarch_debug >= 2)
1643 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1644 return gdbarch->bfd_arch_info;
1648 gdbarch_byte_order (struct gdbarch *gdbarch)
1650 gdb_assert (gdbarch != NULL);
1651 if (gdbarch_debug >= 2)
1652 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1653 return gdbarch->byte_order;
1657 gdbarch_osabi (struct gdbarch *gdbarch)
1659 gdb_assert (gdbarch != NULL);
1660 if (gdbarch_debug >= 2)
1661 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1662 return gdbarch->osabi;
1666 gdbarch_short_bit (struct gdbarch *gdbarch)
1668 gdb_assert (gdbarch != NULL);
1669 /* Skip verify of short_bit, invalid_p == 0 */
1670 if (gdbarch_debug >= 2)
1671 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1672 return gdbarch->short_bit;
1676 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1679 gdbarch->short_bit = short_bit;
1683 gdbarch_int_bit (struct gdbarch *gdbarch)
1685 gdb_assert (gdbarch != NULL);
1686 /* Skip verify of int_bit, invalid_p == 0 */
1687 if (gdbarch_debug >= 2)
1688 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1689 return gdbarch->int_bit;
1693 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1696 gdbarch->int_bit = int_bit;
1700 gdbarch_long_bit (struct gdbarch *gdbarch)
1702 gdb_assert (gdbarch != NULL);
1703 /* Skip verify of long_bit, invalid_p == 0 */
1704 if (gdbarch_debug >= 2)
1705 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1706 return gdbarch->long_bit;
1710 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1713 gdbarch->long_bit = long_bit;
1717 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1719 gdb_assert (gdbarch != NULL);
1720 /* Skip verify of long_long_bit, invalid_p == 0 */
1721 if (gdbarch_debug >= 2)
1722 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1723 return gdbarch->long_long_bit;
1727 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1730 gdbarch->long_long_bit = long_long_bit;
1734 gdbarch_float_bit (struct gdbarch *gdbarch)
1736 gdb_assert (gdbarch != NULL);
1737 /* Skip verify of float_bit, invalid_p == 0 */
1738 if (gdbarch_debug >= 2)
1739 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1740 return gdbarch->float_bit;
1744 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1747 gdbarch->float_bit = float_bit;
1750 const struct floatformat *
1751 gdbarch_float_format (struct gdbarch *gdbarch)
1753 gdb_assert (gdbarch != NULL);
1754 if (gdbarch_debug >= 2)
1755 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1756 return gdbarch->float_format;
1760 set_gdbarch_float_format (struct gdbarch *gdbarch,
1761 const struct floatformat * float_format)
1763 gdbarch->float_format = float_format;
1767 gdbarch_double_bit (struct gdbarch *gdbarch)
1769 gdb_assert (gdbarch != NULL);
1770 /* Skip verify of double_bit, invalid_p == 0 */
1771 if (gdbarch_debug >= 2)
1772 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1773 return gdbarch->double_bit;
1777 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1780 gdbarch->double_bit = double_bit;
1783 const struct floatformat *
1784 gdbarch_double_format (struct gdbarch *gdbarch)
1786 gdb_assert (gdbarch != NULL);
1787 if (gdbarch_debug >= 2)
1788 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1789 return gdbarch->double_format;
1793 set_gdbarch_double_format (struct gdbarch *gdbarch,
1794 const struct floatformat * double_format)
1796 gdbarch->double_format = double_format;
1800 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1802 gdb_assert (gdbarch != NULL);
1803 /* Skip verify of long_double_bit, invalid_p == 0 */
1804 if (gdbarch_debug >= 2)
1805 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1806 return gdbarch->long_double_bit;
1810 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1811 int long_double_bit)
1813 gdbarch->long_double_bit = long_double_bit;
1816 const struct floatformat *
1817 gdbarch_long_double_format (struct gdbarch *gdbarch)
1819 gdb_assert (gdbarch != NULL);
1820 if (gdbarch_debug >= 2)
1821 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1822 return gdbarch->long_double_format;
1826 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1827 const struct floatformat * long_double_format)
1829 gdbarch->long_double_format = long_double_format;
1833 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1835 gdb_assert (gdbarch != NULL);
1836 /* Skip verify of ptr_bit, invalid_p == 0 */
1837 if (gdbarch_debug >= 2)
1838 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1839 return gdbarch->ptr_bit;
1843 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1846 gdbarch->ptr_bit = ptr_bit;
1850 gdbarch_addr_bit (struct gdbarch *gdbarch)
1852 gdb_assert (gdbarch != NULL);
1853 /* Check variable changed from pre-default. */
1854 gdb_assert (gdbarch->addr_bit != 0);
1855 if (gdbarch_debug >= 2)
1856 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1857 return gdbarch->addr_bit;
1861 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1864 gdbarch->addr_bit = addr_bit;
1868 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
1870 gdb_assert (gdbarch != NULL);
1871 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1872 if (gdbarch_debug >= 2)
1873 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
1874 return gdbarch->bfd_vma_bit;
1878 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
1881 gdbarch->bfd_vma_bit = bfd_vma_bit;
1885 gdbarch_char_signed (struct gdbarch *gdbarch)
1887 gdb_assert (gdbarch != NULL);
1888 /* Check variable changed from pre-default. */
1889 gdb_assert (gdbarch->char_signed != -1);
1890 if (gdbarch_debug >= 2)
1891 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1892 return gdbarch->char_signed;
1896 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1899 gdbarch->char_signed = char_signed;
1903 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1905 gdb_assert (gdbarch != NULL);
1906 return gdbarch->read_pc != NULL;
1910 gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
1912 gdb_assert (gdbarch != NULL);
1913 gdb_assert (gdbarch->read_pc != NULL);
1914 if (gdbarch_debug >= 2)
1915 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1916 return gdbarch->read_pc (ptid);
1920 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1921 gdbarch_read_pc_ftype read_pc)
1923 gdbarch->read_pc = read_pc;
1927 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
1929 gdb_assert (gdbarch != NULL);
1930 gdb_assert (gdbarch->write_pc != NULL);
1931 if (gdbarch_debug >= 2)
1932 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1933 gdbarch->write_pc (val, ptid);
1937 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1938 gdbarch_write_pc_ftype write_pc)
1940 gdbarch->write_pc = write_pc;
1944 gdbarch_read_sp_p (struct gdbarch *gdbarch)
1946 gdb_assert (gdbarch != NULL);
1947 return gdbarch->read_sp != NULL;
1951 gdbarch_read_sp (struct gdbarch *gdbarch)
1953 gdb_assert (gdbarch != NULL);
1954 gdb_assert (gdbarch->read_sp != NULL);
1955 if (gdbarch_debug >= 2)
1956 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
1957 return gdbarch->read_sp ();
1961 set_gdbarch_read_sp (struct gdbarch *gdbarch,
1962 gdbarch_read_sp_ftype read_sp)
1964 gdbarch->read_sp = read_sp;
1968 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1970 gdb_assert (gdbarch != NULL);
1971 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1972 if (gdbarch_debug >= 2)
1973 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1974 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
1978 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1979 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1981 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1985 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1987 gdb_assert (gdbarch != NULL);
1988 return gdbarch->pseudo_register_read != NULL;
1992 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf)
1994 gdb_assert (gdbarch != NULL);
1995 gdb_assert (gdbarch->pseudo_register_read != NULL);
1996 if (gdbarch_debug >= 2)
1997 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1998 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
2002 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
2003 gdbarch_pseudo_register_read_ftype pseudo_register_read)
2005 gdbarch->pseudo_register_read = pseudo_register_read;
2009 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
2011 gdb_assert (gdbarch != NULL);
2012 return gdbarch->pseudo_register_write != NULL;
2016 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf)
2018 gdb_assert (gdbarch != NULL);
2019 gdb_assert (gdbarch->pseudo_register_write != NULL);
2020 if (gdbarch_debug >= 2)
2021 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
2022 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
2026 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
2027 gdbarch_pseudo_register_write_ftype pseudo_register_write)
2029 gdbarch->pseudo_register_write = pseudo_register_write;
2033 gdbarch_num_regs (struct gdbarch *gdbarch)
2035 gdb_assert (gdbarch != NULL);
2036 /* Check variable changed from pre-default. */
2037 gdb_assert (gdbarch->num_regs != -1);
2038 if (gdbarch_debug >= 2)
2039 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
2040 return gdbarch->num_regs;
2044 set_gdbarch_num_regs (struct gdbarch *gdbarch,
2047 gdbarch->num_regs = num_regs;
2051 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
2053 gdb_assert (gdbarch != NULL);
2054 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2055 if (gdbarch_debug >= 2)
2056 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
2057 return gdbarch->num_pseudo_regs;
2061 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
2062 int num_pseudo_regs)
2064 gdbarch->num_pseudo_regs = num_pseudo_regs;
2068 gdbarch_sp_regnum (struct gdbarch *gdbarch)
2070 gdb_assert (gdbarch != NULL);
2071 /* Skip verify of sp_regnum, invalid_p == 0 */
2072 if (gdbarch_debug >= 2)
2073 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2074 return gdbarch->sp_regnum;
2078 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2081 gdbarch->sp_regnum = sp_regnum;
2085 gdbarch_pc_regnum (struct gdbarch *gdbarch)
2087 gdb_assert (gdbarch != NULL);
2088 /* Skip verify of pc_regnum, invalid_p == 0 */
2089 if (gdbarch_debug >= 2)
2090 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2091 return gdbarch->pc_regnum;
2095 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2098 gdbarch->pc_regnum = pc_regnum;
2102 gdbarch_ps_regnum (struct gdbarch *gdbarch)
2104 gdb_assert (gdbarch != NULL);
2105 /* Skip verify of ps_regnum, invalid_p == 0 */
2106 if (gdbarch_debug >= 2)
2107 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
2108 return gdbarch->ps_regnum;
2112 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
2115 gdbarch->ps_regnum = ps_regnum;
2119 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2121 gdb_assert (gdbarch != NULL);
2122 /* Skip verify of fp0_regnum, invalid_p == 0 */
2123 if (gdbarch_debug >= 2)
2124 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2125 return gdbarch->fp0_regnum;
2129 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2132 gdbarch->fp0_regnum = fp0_regnum;
2136 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
2138 gdb_assert (gdbarch != NULL);
2139 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
2140 if (gdbarch_debug >= 2)
2141 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
2142 return gdbarch->stab_reg_to_regnum (stab_regnr);
2146 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
2147 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
2149 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
2153 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
2155 gdb_assert (gdbarch != NULL);
2156 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
2157 if (gdbarch_debug >= 2)
2158 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
2159 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
2163 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
2164 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
2166 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
2170 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
2172 gdb_assert (gdbarch != NULL);
2173 gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
2174 if (gdbarch_debug >= 2)
2175 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
2176 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
2180 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
2181 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
2183 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
2187 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
2189 gdb_assert (gdbarch != NULL);
2190 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
2191 if (gdbarch_debug >= 2)
2192 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
2193 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
2197 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2198 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2200 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2204 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2206 gdb_assert (gdbarch != NULL);
2207 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
2208 if (gdbarch_debug >= 2)
2209 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
2210 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
2214 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2215 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2217 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2221 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2223 gdb_assert (gdbarch != NULL);
2224 gdb_assert (gdbarch->register_name != NULL);
2225 if (gdbarch_debug >= 2)
2226 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2227 return gdbarch->register_name (regnr);
2231 set_gdbarch_register_name (struct gdbarch *gdbarch,
2232 gdbarch_register_name_ftype register_name)
2234 gdbarch->register_name = register_name;
2238 gdbarch_register_type_p (struct gdbarch *gdbarch)
2240 gdb_assert (gdbarch != NULL);
2241 return gdbarch->register_type != NULL;
2245 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
2247 gdb_assert (gdbarch != NULL);
2248 gdb_assert (gdbarch->register_type != NULL);
2249 if (gdbarch_debug >= 2)
2250 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
2251 return gdbarch->register_type (gdbarch, reg_nr);
2255 set_gdbarch_register_type (struct gdbarch *gdbarch,
2256 gdbarch_register_type_ftype register_type)
2258 gdbarch->register_type = register_type;
2262 gdbarch_deprecated_register_byte_p (struct gdbarch *gdbarch)
2264 gdb_assert (gdbarch != NULL);
2265 return gdbarch->deprecated_register_byte != generic_register_byte;
2269 gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, int reg_nr)
2271 gdb_assert (gdbarch != NULL);
2272 gdb_assert (gdbarch->deprecated_register_byte != NULL);
2273 /* Do not check predicate: gdbarch->deprecated_register_byte != generic_register_byte, allow call. */
2274 if (gdbarch_debug >= 2)
2275 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_byte called\n");
2276 return gdbarch->deprecated_register_byte (reg_nr);
2280 set_gdbarch_deprecated_register_byte (struct gdbarch *gdbarch,
2281 gdbarch_deprecated_register_byte_ftype deprecated_register_byte)
2283 gdbarch->deprecated_register_byte = deprecated_register_byte;
2287 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
2289 gdb_assert (gdbarch != NULL);
2290 return gdbarch->unwind_dummy_id != NULL;
2294 gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
2296 gdb_assert (gdbarch != NULL);
2297 gdb_assert (gdbarch->unwind_dummy_id != NULL);
2298 if (gdbarch_debug >= 2)
2299 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
2300 return gdbarch->unwind_dummy_id (gdbarch, info);
2304 set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
2305 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
2307 gdbarch->unwind_dummy_id = unwind_dummy_id;
2311 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
2313 gdb_assert (gdbarch != NULL);
2314 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2315 if (gdbarch_debug >= 2)
2316 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
2317 return gdbarch->deprecated_fp_regnum;
2321 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
2322 int deprecated_fp_regnum)
2324 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
2328 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
2330 gdb_assert (gdbarch != NULL);
2331 return gdbarch->push_dummy_call != NULL;
2335 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)
2337 gdb_assert (gdbarch != NULL);
2338 gdb_assert (gdbarch->push_dummy_call != NULL);
2339 if (gdbarch_debug >= 2)
2340 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
2341 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
2345 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
2346 gdbarch_push_dummy_call_ftype push_dummy_call)
2348 gdbarch->push_dummy_call = push_dummy_call;
2352 gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch)
2354 gdb_assert (gdbarch != NULL);
2355 return gdbarch->deprecated_push_arguments != NULL;
2359 gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
2361 gdb_assert (gdbarch != NULL);
2362 gdb_assert (gdbarch->deprecated_push_arguments != NULL);
2363 if (gdbarch_debug >= 2)
2364 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_arguments called\n");
2365 return gdbarch->deprecated_push_arguments (nargs, args, sp, struct_return, struct_addr);
2369 set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch,
2370 gdbarch_deprecated_push_arguments_ftype deprecated_push_arguments)
2372 gdbarch->deprecated_push_arguments = deprecated_push_arguments;
2376 gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
2378 gdb_assert (gdbarch != NULL);
2379 if (gdbarch_debug >= 2)
2380 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
2381 return gdbarch->deprecated_register_size;
2385 set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
2386 int deprecated_register_size)
2388 gdbarch->deprecated_register_size = deprecated_register_size;
2392 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
2394 gdb_assert (gdbarch != NULL);
2395 /* Skip verify of call_dummy_location, invalid_p == 0 */
2396 if (gdbarch_debug >= 2)
2397 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
2398 return gdbarch->call_dummy_location;
2402 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
2403 int call_dummy_location)
2405 gdbarch->call_dummy_location = call_dummy_location;
2409 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
2411 gdb_assert (gdbarch != NULL);
2412 return gdbarch->push_dummy_code != NULL;
2416 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)
2418 gdb_assert (gdbarch != NULL);
2419 gdb_assert (gdbarch->push_dummy_code != NULL);
2420 if (gdbarch_debug >= 2)
2421 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
2422 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr);
2426 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
2427 gdbarch_push_dummy_code_ftype push_dummy_code)
2429 gdbarch->push_dummy_code = push_dummy_code;
2433 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
2435 gdb_assert (gdbarch != NULL);
2436 gdb_assert (gdbarch->print_registers_info != NULL);
2437 if (gdbarch_debug >= 2)
2438 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
2439 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
2443 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
2444 gdbarch_print_registers_info_ftype print_registers_info)
2446 gdbarch->print_registers_info = print_registers_info;
2450 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
2452 gdb_assert (gdbarch != NULL);
2453 return gdbarch->print_float_info != NULL;
2457 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2459 gdb_assert (gdbarch != NULL);
2460 gdb_assert (gdbarch->print_float_info != NULL);
2461 if (gdbarch_debug >= 2)
2462 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
2463 gdbarch->print_float_info (gdbarch, file, frame, args);
2467 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
2468 gdbarch_print_float_info_ftype print_float_info)
2470 gdbarch->print_float_info = print_float_info;
2474 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
2476 gdb_assert (gdbarch != NULL);
2477 return gdbarch->print_vector_info != NULL;
2481 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2483 gdb_assert (gdbarch != NULL);
2484 gdb_assert (gdbarch->print_vector_info != NULL);
2485 if (gdbarch_debug >= 2)
2486 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
2487 gdbarch->print_vector_info (gdbarch, file, frame, args);
2491 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
2492 gdbarch_print_vector_info_ftype print_vector_info)
2494 gdbarch->print_vector_info = print_vector_info;
2498 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
2500 gdb_assert (gdbarch != NULL);
2501 gdb_assert (gdbarch->register_sim_regno != NULL);
2502 if (gdbarch_debug >= 2)
2503 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
2504 return gdbarch->register_sim_regno (reg_nr);
2508 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
2509 gdbarch_register_sim_regno_ftype register_sim_regno)
2511 gdbarch->register_sim_regno = register_sim_regno;
2515 gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
2517 gdb_assert (gdbarch != NULL);
2518 return gdbarch->register_bytes_ok != NULL;
2522 gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
2524 gdb_assert (gdbarch != NULL);
2525 gdb_assert (gdbarch->register_bytes_ok != NULL);
2526 if (gdbarch_debug >= 2)
2527 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
2528 return gdbarch->register_bytes_ok (nr_bytes);
2532 set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
2533 gdbarch_register_bytes_ok_ftype register_bytes_ok)
2535 gdbarch->register_bytes_ok = register_bytes_ok;
2539 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
2541 gdb_assert (gdbarch != NULL);
2542 gdb_assert (gdbarch->cannot_fetch_register != NULL);
2543 if (gdbarch_debug >= 2)
2544 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
2545 return gdbarch->cannot_fetch_register (regnum);
2549 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
2550 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
2552 gdbarch->cannot_fetch_register = cannot_fetch_register;
2556 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
2558 gdb_assert (gdbarch != NULL);
2559 gdb_assert (gdbarch->cannot_store_register != NULL);
2560 if (gdbarch_debug >= 2)
2561 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
2562 return gdbarch->cannot_store_register (regnum);
2566 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
2567 gdbarch_cannot_store_register_ftype cannot_store_register)
2569 gdbarch->cannot_store_register = cannot_store_register;
2573 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
2575 gdb_assert (gdbarch != NULL);
2576 return gdbarch->get_longjmp_target != NULL;
2580 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
2582 gdb_assert (gdbarch != NULL);
2583 gdb_assert (gdbarch->get_longjmp_target != NULL);
2584 if (gdbarch_debug >= 2)
2585 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
2586 return gdbarch->get_longjmp_target (pc);
2590 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2591 gdbarch_get_longjmp_target_ftype get_longjmp_target)
2593 gdbarch->get_longjmp_target = get_longjmp_target;
2597 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2599 gdb_assert (gdbarch != NULL);
2600 if (gdbarch_debug >= 2)
2601 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2602 return gdbarch->believe_pcc_promotion;
2606 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2607 int believe_pcc_promotion)
2609 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2613 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
2615 gdb_assert (gdbarch != NULL);
2616 gdb_assert (gdbarch->convert_register_p != NULL);
2617 if (gdbarch_debug >= 2)
2618 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
2619 return gdbarch->convert_register_p (regnum, type);
2623 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2624 gdbarch_convert_register_p_ftype convert_register_p)
2626 gdbarch->convert_register_p = convert_register_p;
2630 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, void *buf)
2632 gdb_assert (gdbarch != NULL);
2633 gdb_assert (gdbarch->register_to_value != NULL);
2634 if (gdbarch_debug >= 2)
2635 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2636 gdbarch->register_to_value (frame, regnum, type, buf);
2640 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2641 gdbarch_register_to_value_ftype register_to_value)
2643 gdbarch->register_to_value = register_to_value;
2647 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const void *buf)
2649 gdb_assert (gdbarch != NULL);
2650 gdb_assert (gdbarch->value_to_register != NULL);
2651 if (gdbarch_debug >= 2)
2652 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2653 gdbarch->value_to_register (frame, regnum, type, buf);
2657 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2658 gdbarch_value_to_register_ftype value_to_register)
2660 gdbarch->value_to_register = value_to_register;
2664 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf)
2666 gdb_assert (gdbarch != NULL);
2667 gdb_assert (gdbarch->pointer_to_address != NULL);
2668 if (gdbarch_debug >= 2)
2669 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2670 return gdbarch->pointer_to_address (type, buf);
2674 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2675 gdbarch_pointer_to_address_ftype pointer_to_address)
2677 gdbarch->pointer_to_address = pointer_to_address;
2681 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
2683 gdb_assert (gdbarch != NULL);
2684 gdb_assert (gdbarch->address_to_pointer != NULL);
2685 if (gdbarch_debug >= 2)
2686 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2687 gdbarch->address_to_pointer (type, buf, addr);
2691 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2692 gdbarch_address_to_pointer_ftype address_to_pointer)
2694 gdbarch->address_to_pointer = address_to_pointer;
2698 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2700 gdb_assert (gdbarch != NULL);
2701 return gdbarch->integer_to_address != NULL;
2705 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const bfd_byte *buf)
2707 gdb_assert (gdbarch != NULL);
2708 gdb_assert (gdbarch->integer_to_address != NULL);
2709 if (gdbarch_debug >= 2)
2710 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2711 return gdbarch->integer_to_address (gdbarch, type, buf);
2715 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2716 gdbarch_integer_to_address_ftype integer_to_address)
2718 gdbarch->integer_to_address = integer_to_address;
2722 gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch)
2724 gdb_assert (gdbarch != NULL);
2725 return gdbarch->deprecated_store_struct_return != NULL;
2729 gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
2731 gdb_assert (gdbarch != NULL);
2732 gdb_assert (gdbarch->deprecated_store_struct_return != NULL);
2733 if (gdbarch_debug >= 2)
2734 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_struct_return called\n");
2735 gdbarch->deprecated_store_struct_return (addr, sp);
2739 set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch,
2740 gdbarch_deprecated_store_struct_return_ftype deprecated_store_struct_return)
2742 gdbarch->deprecated_store_struct_return = deprecated_store_struct_return;
2746 gdbarch_return_value_p (struct gdbarch *gdbarch)
2748 gdb_assert (gdbarch != NULL);
2749 return gdbarch->return_value != legacy_return_value;
2752 enum return_value_convention
2753 gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf)
2755 gdb_assert (gdbarch != NULL);
2756 gdb_assert (gdbarch->return_value != NULL);
2757 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2758 if (gdbarch_debug >= 2)
2759 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2760 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
2764 set_gdbarch_return_value (struct gdbarch *gdbarch,
2765 gdbarch_return_value_ftype return_value)
2767 gdbarch->return_value = return_value;
2771 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf)
2773 gdb_assert (gdbarch != NULL);
2774 gdb_assert (gdbarch->extract_return_value != NULL);
2775 if (gdbarch_debug >= 2)
2776 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
2777 gdbarch->extract_return_value (type, regcache, valbuf);
2781 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
2782 gdbarch_extract_return_value_ftype extract_return_value)
2784 gdbarch->extract_return_value = extract_return_value;
2788 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf)
2790 gdb_assert (gdbarch != NULL);
2791 gdb_assert (gdbarch->store_return_value != NULL);
2792 if (gdbarch_debug >= 2)
2793 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
2794 gdbarch->store_return_value (type, regcache, valbuf);
2798 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
2799 gdbarch_store_return_value_ftype store_return_value)
2801 gdbarch->store_return_value = store_return_value;
2805 gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
2807 gdb_assert (gdbarch != NULL);
2808 gdb_assert (gdbarch->deprecated_extract_return_value != NULL);
2809 if (gdbarch_debug >= 2)
2810 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n");
2811 gdbarch->deprecated_extract_return_value (type, regbuf, valbuf);
2815 set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch,
2816 gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value)
2818 gdbarch->deprecated_extract_return_value = deprecated_extract_return_value;
2822 gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
2824 gdb_assert (gdbarch != NULL);
2825 gdb_assert (gdbarch->deprecated_store_return_value != NULL);
2826 if (gdbarch_debug >= 2)
2827 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n");
2828 gdbarch->deprecated_store_return_value (type, valbuf);
2832 set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch,
2833 gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value)
2835 gdbarch->deprecated_store_return_value = deprecated_store_return_value;
2839 gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
2841 gdb_assert (gdbarch != NULL);
2842 gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
2843 if (gdbarch_debug >= 2)
2844 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
2845 return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
2849 set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
2850 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
2852 gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
2856 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
2858 gdb_assert (gdbarch != NULL);
2859 return gdbarch->deprecated_extract_struct_value_address != NULL;
2863 gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
2865 gdb_assert (gdbarch != NULL);
2866 gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL);
2867 if (gdbarch_debug >= 2)
2868 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
2869 return gdbarch->deprecated_extract_struct_value_address (regcache);
2873 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
2874 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
2876 gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
2880 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2882 gdb_assert (gdbarch != NULL);
2883 gdb_assert (gdbarch->skip_prologue != NULL);
2884 if (gdbarch_debug >= 2)
2885 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2886 return gdbarch->skip_prologue (ip);
2890 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2891 gdbarch_skip_prologue_ftype skip_prologue)
2893 gdbarch->skip_prologue = skip_prologue;
2897 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2899 gdb_assert (gdbarch != NULL);
2900 gdb_assert (gdbarch->inner_than != NULL);
2901 if (gdbarch_debug >= 2)
2902 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2903 return gdbarch->inner_than (lhs, rhs);
2907 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2908 gdbarch_inner_than_ftype inner_than)
2910 gdbarch->inner_than = inner_than;
2913 const unsigned char *
2914 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2916 gdb_assert (gdbarch != NULL);
2917 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2918 if (gdbarch_debug >= 2)
2919 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2920 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
2924 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2925 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2927 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2931 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2933 gdb_assert (gdbarch != NULL);
2934 return gdbarch->adjust_breakpoint_address != NULL;
2938 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2940 gdb_assert (gdbarch != NULL);
2941 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2942 if (gdbarch_debug >= 2)
2943 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2944 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2948 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2949 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2951 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2955 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
2957 gdb_assert (gdbarch != NULL);
2958 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2959 if (gdbarch_debug >= 2)
2960 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2961 return gdbarch->memory_insert_breakpoint (addr, contents_cache);
2965 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2966 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2968 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2972 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
2974 gdb_assert (gdbarch != NULL);
2975 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2976 if (gdbarch_debug >= 2)
2977 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2978 return gdbarch->memory_remove_breakpoint (addr, contents_cache);
2982 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2983 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2985 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2989 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2991 gdb_assert (gdbarch != NULL);
2992 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2993 if (gdbarch_debug >= 2)
2994 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2995 return gdbarch->decr_pc_after_break;
2999 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
3000 CORE_ADDR decr_pc_after_break)
3002 gdbarch->decr_pc_after_break = decr_pc_after_break;
3006 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
3008 gdb_assert (gdbarch != NULL);
3009 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
3010 if (gdbarch_debug >= 2)
3011 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
3012 return gdbarch->deprecated_function_start_offset;
3016 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
3017 CORE_ADDR deprecated_function_start_offset)
3019 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
3023 gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
3025 gdb_assert (gdbarch != NULL);
3026 gdb_assert (gdbarch->remote_translate_xfer_address != NULL);
3027 if (gdbarch_debug >= 2)
3028 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
3029 gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len);
3033 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
3034 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
3036 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
3040 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
3042 gdb_assert (gdbarch != NULL);
3043 /* Skip verify of frame_args_skip, invalid_p == 0 */
3044 if (gdbarch_debug >= 2)
3045 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
3046 return gdbarch->frame_args_skip;
3050 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
3051 CORE_ADDR frame_args_skip)
3053 gdbarch->frame_args_skip = frame_args_skip;
3057 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
3059 gdb_assert (gdbarch != NULL);
3060 return gdbarch->unwind_pc != NULL;
3064 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
3066 gdb_assert (gdbarch != NULL);
3067 gdb_assert (gdbarch->unwind_pc != NULL);
3068 if (gdbarch_debug >= 2)
3069 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
3070 return gdbarch->unwind_pc (gdbarch, next_frame);
3074 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
3075 gdbarch_unwind_pc_ftype unwind_pc)
3077 gdbarch->unwind_pc = unwind_pc;
3081 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
3083 gdb_assert (gdbarch != NULL);
3084 return gdbarch->unwind_sp != NULL;
3088 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
3090 gdb_assert (gdbarch != NULL);
3091 gdb_assert (gdbarch->unwind_sp != NULL);
3092 if (gdbarch_debug >= 2)
3093 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
3094 return gdbarch->unwind_sp (gdbarch, next_frame);
3098 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
3099 gdbarch_unwind_sp_ftype unwind_sp)
3101 gdbarch->unwind_sp = unwind_sp;
3105 gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch)
3107 gdb_assert (gdbarch != NULL);
3108 return gdbarch->deprecated_saved_pc_after_call != NULL;
3112 gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
3114 gdb_assert (gdbarch != NULL);
3115 gdb_assert (gdbarch->deprecated_saved_pc_after_call != NULL);
3116 if (gdbarch_debug >= 2)
3117 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_saved_pc_after_call called\n");
3118 return gdbarch->deprecated_saved_pc_after_call (frame);
3122 set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch,
3123 gdbarch_deprecated_saved_pc_after_call_ftype deprecated_saved_pc_after_call)
3125 gdbarch->deprecated_saved_pc_after_call = deprecated_saved_pc_after_call;
3129 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
3131 gdb_assert (gdbarch != NULL);
3132 return gdbarch->frame_num_args != NULL;
3136 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
3138 gdb_assert (gdbarch != NULL);
3139 gdb_assert (gdbarch->frame_num_args != NULL);
3140 if (gdbarch_debug >= 2)
3141 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
3142 return gdbarch->frame_num_args (frame);
3146 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
3147 gdbarch_frame_num_args_ftype frame_num_args)
3149 gdbarch->frame_num_args = frame_num_args;
3153 gdbarch_deprecated_stack_align_p (struct gdbarch *gdbarch)
3155 gdb_assert (gdbarch != NULL);
3156 return gdbarch->deprecated_stack_align != NULL;
3160 gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
3162 gdb_assert (gdbarch != NULL);
3163 gdb_assert (gdbarch->deprecated_stack_align != NULL);
3164 if (gdbarch_debug >= 2)
3165 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_stack_align called\n");
3166 return gdbarch->deprecated_stack_align (sp);
3170 set_gdbarch_deprecated_stack_align (struct gdbarch *gdbarch,
3171 gdbarch_deprecated_stack_align_ftype deprecated_stack_align)
3173 gdbarch->deprecated_stack_align = deprecated_stack_align;
3177 gdbarch_frame_align_p (struct gdbarch *gdbarch)
3179 gdb_assert (gdbarch != NULL);
3180 return gdbarch->frame_align != NULL;
3184 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
3186 gdb_assert (gdbarch != NULL);
3187 gdb_assert (gdbarch->frame_align != NULL);
3188 if (gdbarch_debug >= 2)
3189 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
3190 return gdbarch->frame_align (gdbarch, address);
3194 set_gdbarch_frame_align (struct gdbarch *gdbarch,
3195 gdbarch_frame_align_ftype frame_align)
3197 gdbarch->frame_align = frame_align;
3201 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
3203 gdb_assert (gdbarch != NULL);
3204 return gdbarch->deprecated_reg_struct_has_addr != NULL;
3208 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
3210 gdb_assert (gdbarch != NULL);
3211 gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
3212 if (gdbarch_debug >= 2)
3213 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
3214 return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
3218 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
3219 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
3221 gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
3225 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
3227 gdb_assert (gdbarch != NULL);
3228 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
3229 if (gdbarch_debug >= 2)
3230 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
3231 return gdbarch->stabs_argument_has_addr (gdbarch, type);
3235 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
3236 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
3238 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
3242 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
3244 gdb_assert (gdbarch != NULL);
3245 if (gdbarch_debug >= 2)
3246 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
3247 return gdbarch->frame_red_zone_size;
3251 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
3252 int frame_red_zone_size)
3254 gdbarch->frame_red_zone_size = frame_red_zone_size;
3258 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
3260 gdb_assert (gdbarch != NULL);
3261 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
3262 if (gdbarch_debug >= 2)
3263 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
3264 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
3268 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
3269 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
3271 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
3275 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
3277 gdb_assert (gdbarch != NULL);
3278 gdb_assert (gdbarch->addr_bits_remove != NULL);
3279 if (gdbarch_debug >= 2)
3280 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
3281 return gdbarch->addr_bits_remove (addr);
3285 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
3286 gdbarch_addr_bits_remove_ftype addr_bits_remove)
3288 gdbarch->addr_bits_remove = addr_bits_remove;
3292 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
3294 gdb_assert (gdbarch != NULL);
3295 gdb_assert (gdbarch->smash_text_address != NULL);
3296 if (gdbarch_debug >= 2)
3297 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
3298 return gdbarch->smash_text_address (addr);
3302 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
3303 gdbarch_smash_text_address_ftype smash_text_address)
3305 gdbarch->smash_text_address = smash_text_address;
3309 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
3311 gdb_assert (gdbarch != NULL);
3312 return gdbarch->software_single_step != NULL;
3316 gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
3318 gdb_assert (gdbarch != NULL);
3319 gdb_assert (gdbarch->software_single_step != NULL);
3320 if (gdbarch_debug >= 2)
3321 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
3322 gdbarch->software_single_step (sig, insert_breakpoints_p);
3326 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
3327 gdbarch_software_single_step_ftype software_single_step)
3329 gdbarch->software_single_step = software_single_step;
3333 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
3335 gdb_assert (gdbarch != NULL);
3336 return gdbarch->single_step_through_delay != NULL;
3340 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
3342 gdb_assert (gdbarch != NULL);
3343 gdb_assert (gdbarch->single_step_through_delay != NULL);
3344 if (gdbarch_debug >= 2)
3345 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
3346 return gdbarch->single_step_through_delay (gdbarch, frame);
3350 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
3351 gdbarch_single_step_through_delay_ftype single_step_through_delay)
3353 gdbarch->single_step_through_delay = single_step_through_delay;
3357 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
3359 gdb_assert (gdbarch != NULL);
3360 gdb_assert (gdbarch->print_insn != NULL);
3361 if (gdbarch_debug >= 2)
3362 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
3363 return gdbarch->print_insn (vma, info);
3367 set_gdbarch_print_insn (struct gdbarch *gdbarch,
3368 gdbarch_print_insn_ftype print_insn)
3370 gdbarch->print_insn = print_insn;
3374 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
3376 gdb_assert (gdbarch != NULL);
3377 gdb_assert (gdbarch->skip_trampoline_code != NULL);
3378 if (gdbarch_debug >= 2)
3379 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
3380 return gdbarch->skip_trampoline_code (pc);
3384 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
3385 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
3387 gdbarch->skip_trampoline_code = skip_trampoline_code;
3391 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
3393 gdb_assert (gdbarch != NULL);
3394 gdb_assert (gdbarch->skip_solib_resolver != NULL);
3395 if (gdbarch_debug >= 2)
3396 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
3397 return gdbarch->skip_solib_resolver (gdbarch, pc);
3401 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
3402 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
3404 gdbarch->skip_solib_resolver = skip_solib_resolver;
3408 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
3410 gdb_assert (gdbarch != NULL);
3411 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
3412 if (gdbarch_debug >= 2)
3413 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
3414 return gdbarch->in_solib_return_trampoline (pc, name);
3418 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
3419 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
3421 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
3425 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
3427 gdb_assert (gdbarch != NULL);
3428 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
3429 if (gdbarch_debug >= 2)
3430 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
3431 return gdbarch->in_function_epilogue_p (gdbarch, addr);
3435 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
3436 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
3438 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
3442 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
3444 gdb_assert (gdbarch != NULL);
3445 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
3446 if (gdbarch_debug >= 2)
3447 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
3448 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
3452 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
3453 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
3455 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
3459 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
3461 gdb_assert (gdbarch != NULL);
3462 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
3463 if (gdbarch_debug >= 2)
3464 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
3465 gdbarch->elf_make_msymbol_special (sym, msym);
3469 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
3470 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
3472 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
3476 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
3478 gdb_assert (gdbarch != NULL);
3479 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
3480 if (gdbarch_debug >= 2)
3481 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
3482 gdbarch->coff_make_msymbol_special (val, msym);
3486 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
3487 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
3489 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
3493 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
3495 gdb_assert (gdbarch != NULL);
3496 /* Skip verify of name_of_malloc, invalid_p == 0 */
3497 if (gdbarch_debug >= 2)
3498 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
3499 return gdbarch->name_of_malloc;
3503 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
3504 const char * name_of_malloc)
3506 gdbarch->name_of_malloc = name_of_malloc;
3510 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
3512 gdb_assert (gdbarch != NULL);
3513 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3514 if (gdbarch_debug >= 2)
3515 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
3516 return gdbarch->cannot_step_breakpoint;
3520 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
3521 int cannot_step_breakpoint)
3523 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
3527 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
3529 gdb_assert (gdbarch != NULL);
3530 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3531 if (gdbarch_debug >= 2)
3532 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
3533 return gdbarch->have_nonsteppable_watchpoint;
3537 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
3538 int have_nonsteppable_watchpoint)
3540 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
3544 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
3546 gdb_assert (gdbarch != NULL);
3547 return gdbarch->address_class_type_flags != NULL;
3551 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
3553 gdb_assert (gdbarch != NULL);
3554 gdb_assert (gdbarch->address_class_type_flags != NULL);
3555 if (gdbarch_debug >= 2)
3556 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
3557 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
3561 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
3562 gdbarch_address_class_type_flags_ftype address_class_type_flags)
3564 gdbarch->address_class_type_flags = address_class_type_flags;
3568 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
3570 gdb_assert (gdbarch != NULL);
3571 return gdbarch->address_class_type_flags_to_name != NULL;
3575 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
3577 gdb_assert (gdbarch != NULL);
3578 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
3579 if (gdbarch_debug >= 2)
3580 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
3581 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
3585 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
3586 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
3588 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
3592 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
3594 gdb_assert (gdbarch != NULL);
3595 return gdbarch->address_class_name_to_type_flags != NULL;
3599 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
3601 gdb_assert (gdbarch != NULL);
3602 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
3603 if (gdbarch_debug >= 2)
3604 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
3605 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
3609 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
3610 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
3612 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
3616 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
3618 gdb_assert (gdbarch != NULL);
3619 gdb_assert (gdbarch->register_reggroup_p != NULL);
3620 if (gdbarch_debug >= 2)
3621 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
3622 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
3626 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
3627 gdbarch_register_reggroup_p_ftype register_reggroup_p)
3629 gdbarch->register_reggroup_p = register_reggroup_p;
3633 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
3635 gdb_assert (gdbarch != NULL);
3636 return gdbarch->fetch_pointer_argument != NULL;
3640 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
3642 gdb_assert (gdbarch != NULL);
3643 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
3644 if (gdbarch_debug >= 2)
3645 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
3646 return gdbarch->fetch_pointer_argument (frame, argi, type);
3650 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
3651 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
3653 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
3657 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
3659 gdb_assert (gdbarch != NULL);
3660 return gdbarch->regset_from_core_section != NULL;
3663 const struct regset *
3664 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
3666 gdb_assert (gdbarch != NULL);
3667 gdb_assert (gdbarch->regset_from_core_section != NULL);
3668 if (gdbarch_debug >= 2)
3669 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
3670 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
3674 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
3675 gdbarch_regset_from_core_section_ftype regset_from_core_section)
3677 gdbarch->regset_from_core_section = regset_from_core_section;
3681 /* Keep a registry of per-architecture data-pointers required by GDB
3688 gdbarch_data_pre_init_ftype *pre_init;
3689 gdbarch_data_post_init_ftype *post_init;
3692 struct gdbarch_data_registration
3694 struct gdbarch_data *data;
3695 struct gdbarch_data_registration *next;
3698 struct gdbarch_data_registry
3701 struct gdbarch_data_registration *registrations;
3704 struct gdbarch_data_registry gdbarch_data_registry =
3709 static struct gdbarch_data *
3710 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3711 gdbarch_data_post_init_ftype *post_init)
3713 struct gdbarch_data_registration **curr;
3714 /* Append the new registraration. */
3715 for (curr = &gdbarch_data_registry.registrations;
3717 curr = &(*curr)->next);
3718 (*curr) = XMALLOC (struct gdbarch_data_registration);
3719 (*curr)->next = NULL;
3720 (*curr)->data = XMALLOC (struct gdbarch_data);
3721 (*curr)->data->index = gdbarch_data_registry.nr++;
3722 (*curr)->data->pre_init = pre_init;
3723 (*curr)->data->post_init = post_init;
3724 (*curr)->data->init_p = 1;
3725 return (*curr)->data;
3728 struct gdbarch_data *
3729 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3731 return gdbarch_data_register (pre_init, NULL);
3734 struct gdbarch_data *
3735 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3737 return gdbarch_data_register (NULL, post_init);
3740 /* Create/delete the gdbarch data vector. */
3743 alloc_gdbarch_data (struct gdbarch *gdbarch)
3745 gdb_assert (gdbarch->data == NULL);
3746 gdbarch->nr_data = gdbarch_data_registry.nr;
3747 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3750 /* Initialize the current value of the specified per-architecture
3754 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3755 struct gdbarch_data *data,
3758 gdb_assert (data->index < gdbarch->nr_data);
3759 gdb_assert (gdbarch->data[data->index] == NULL);
3760 gdb_assert (data->pre_init == NULL);
3761 gdbarch->data[data->index] = pointer;
3764 /* Return the current value of the specified per-architecture
3768 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3770 gdb_assert (data->index < gdbarch->nr_data);
3771 if (gdbarch->data[data->index] == NULL)
3773 /* The data-pointer isn't initialized, call init() to get a
3775 if (data->pre_init != NULL)
3776 /* Mid architecture creation: pass just the obstack, and not
3777 the entire architecture, as that way it isn't possible for
3778 pre-init code to refer to undefined architecture
3780 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3781 else if (gdbarch->initialized_p
3782 && data->post_init != NULL)
3783 /* Post architecture creation: pass the entire architecture
3784 (as all fields are valid), but be careful to also detect
3785 recursive references. */
3787 gdb_assert (data->init_p);
3789 gdbarch->data[data->index] = data->post_init (gdbarch);
3793 /* The architecture initialization hasn't completed - punt -
3794 hope that the caller knows what they are doing. Once
3795 deprecated_set_gdbarch_data has been initialized, this can be
3796 changed to an internal error. */
3798 gdb_assert (gdbarch->data[data->index] != NULL);
3800 return gdbarch->data[data->index];
3805 /* Keep a registry of swapped data required by GDB modules. */
3810 struct gdbarch_swap_registration *source;
3811 struct gdbarch_swap *next;
3814 struct gdbarch_swap_registration
3817 unsigned long sizeof_data;
3818 gdbarch_swap_ftype *init;
3819 struct gdbarch_swap_registration *next;
3822 struct gdbarch_swap_registry
3825 struct gdbarch_swap_registration *registrations;
3828 struct gdbarch_swap_registry gdbarch_swap_registry =
3834 deprecated_register_gdbarch_swap (void *data,
3835 unsigned long sizeof_data,
3836 gdbarch_swap_ftype *init)
3838 struct gdbarch_swap_registration **rego;
3839 for (rego = &gdbarch_swap_registry.registrations;
3841 rego = &(*rego)->next);
3842 (*rego) = XMALLOC (struct gdbarch_swap_registration);
3843 (*rego)->next = NULL;
3844 (*rego)->init = init;
3845 (*rego)->data = data;
3846 (*rego)->sizeof_data = sizeof_data;
3850 current_gdbarch_swap_init_hack (void)
3852 struct gdbarch_swap_registration *rego;
3853 struct gdbarch_swap **curr = ¤t_gdbarch->swap;
3854 for (rego = gdbarch_swap_registry.registrations;
3858 if (rego->data != NULL)
3860 (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch,
3861 struct gdbarch_swap);
3862 (*curr)->source = rego;
3863 (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch,
3865 (*curr)->next = NULL;
3866 curr = &(*curr)->next;
3868 if (rego->init != NULL)
3873 static struct gdbarch *
3874 current_gdbarch_swap_out_hack (void)
3876 struct gdbarch *old_gdbarch = current_gdbarch;
3877 struct gdbarch_swap *curr;
3879 gdb_assert (old_gdbarch != NULL);
3880 for (curr = old_gdbarch->swap;
3884 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
3885 memset (curr->source->data, 0, curr->source->sizeof_data);
3887 current_gdbarch = NULL;
3892 current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch)
3894 struct gdbarch_swap *curr;
3896 gdb_assert (current_gdbarch == NULL);
3897 for (curr = new_gdbarch->swap;
3900 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
3901 current_gdbarch = new_gdbarch;
3905 /* Keep a registry of the architectures known by GDB. */
3907 struct gdbarch_registration
3909 enum bfd_architecture bfd_architecture;
3910 gdbarch_init_ftype *init;
3911 gdbarch_dump_tdep_ftype *dump_tdep;
3912 struct gdbarch_list *arches;
3913 struct gdbarch_registration *next;
3916 static struct gdbarch_registration *gdbarch_registry = NULL;
3919 append_name (const char ***buf, int *nr, const char *name)
3921 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3927 gdbarch_printable_names (void)
3929 /* Accumulate a list of names based on the registed list of
3931 enum bfd_architecture a;
3933 const char **arches = NULL;
3934 struct gdbarch_registration *rego;
3935 for (rego = gdbarch_registry;
3939 const struct bfd_arch_info *ap;
3940 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3942 internal_error (__FILE__, __LINE__,
3943 "gdbarch_architecture_names: multi-arch unknown");
3946 append_name (&arches, &nr_arches, ap->printable_name);
3951 append_name (&arches, &nr_arches, NULL);
3957 gdbarch_register (enum bfd_architecture bfd_architecture,
3958 gdbarch_init_ftype *init,
3959 gdbarch_dump_tdep_ftype *dump_tdep)
3961 struct gdbarch_registration **curr;
3962 const struct bfd_arch_info *bfd_arch_info;
3963 /* Check that BFD recognizes this architecture */
3964 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3965 if (bfd_arch_info == NULL)
3967 internal_error (__FILE__, __LINE__,
3968 "gdbarch: Attempt to register unknown architecture (%d)",
3971 /* Check that we haven't seen this architecture before */
3972 for (curr = &gdbarch_registry;
3974 curr = &(*curr)->next)
3976 if (bfd_architecture == (*curr)->bfd_architecture)
3977 internal_error (__FILE__, __LINE__,
3978 "gdbarch: Duplicate registraration of architecture (%s)",
3979 bfd_arch_info->printable_name);
3983 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
3984 bfd_arch_info->printable_name,
3987 (*curr) = XMALLOC (struct gdbarch_registration);
3988 (*curr)->bfd_architecture = bfd_architecture;
3989 (*curr)->init = init;
3990 (*curr)->dump_tdep = dump_tdep;
3991 (*curr)->arches = NULL;
3992 (*curr)->next = NULL;
3996 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3997 gdbarch_init_ftype *init)
3999 gdbarch_register (bfd_architecture, init, NULL);
4003 /* Look for an architecture using gdbarch_info. Base search on only
4004 BFD_ARCH_INFO and BYTE_ORDER. */
4006 struct gdbarch_list *
4007 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
4008 const struct gdbarch_info *info)
4010 for (; arches != NULL; arches = arches->next)
4012 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
4014 if (info->byte_order != arches->gdbarch->byte_order)
4016 if (info->osabi != arches->gdbarch->osabi)
4024 /* Find an architecture that matches the specified INFO. Create a new
4025 architecture if needed. Return that new architecture. Assumes
4026 that there is no current architecture. */
4028 static struct gdbarch *
4029 find_arch_by_info (struct gdbarch *old_gdbarch, struct gdbarch_info info)
4031 struct gdbarch *new_gdbarch;
4032 struct gdbarch_registration *rego;
4034 /* The existing architecture has been swapped out - all this code
4035 works from a clean slate. */
4036 gdb_assert (current_gdbarch == NULL);
4038 /* Fill in missing parts of the INFO struct using a number of
4039 sources: "set ..."; INFOabfd supplied; and the existing
4041 gdbarch_info_fill (old_gdbarch, &info);
4043 /* Must have found some sort of architecture. */
4044 gdb_assert (info.bfd_arch_info != NULL);
4048 fprintf_unfiltered (gdb_stdlog,
4049 "find_arch_by_info: info.bfd_arch_info %s\n",
4050 (info.bfd_arch_info != NULL
4051 ? info.bfd_arch_info->printable_name
4053 fprintf_unfiltered (gdb_stdlog,
4054 "find_arch_by_info: info.byte_order %d (%s)\n",
4056 (info.byte_order == BFD_ENDIAN_BIG ? "big"
4057 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
4059 fprintf_unfiltered (gdb_stdlog,
4060 "find_arch_by_info: info.osabi %d (%s)\n",
4061 info.osabi, gdbarch_osabi_name (info.osabi));
4062 fprintf_unfiltered (gdb_stdlog,
4063 "find_arch_by_info: info.abfd 0x%lx\n",
4065 fprintf_unfiltered (gdb_stdlog,
4066 "find_arch_by_info: info.tdep_info 0x%lx\n",
4067 (long) info.tdep_info);
4070 /* Find the tdep code that knows about this architecture. */
4071 for (rego = gdbarch_registry;
4074 if (rego->bfd_architecture == info.bfd_arch_info->arch)
4079 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4080 "No matching architecture\n");
4084 /* Ask the tdep code for an architecture that matches "info". */
4085 new_gdbarch = rego->init (info, rego->arches);
4087 /* Did the tdep code like it? No. Reject the change and revert to
4088 the old architecture. */
4089 if (new_gdbarch == NULL)
4092 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4093 "Target rejected architecture\n");
4097 /* Is this a pre-existing architecture (as determined by already
4098 being initialized)? Move it to the front of the architecture
4099 list (keeping the list sorted Most Recently Used). */
4100 if (new_gdbarch->initialized_p)
4102 struct gdbarch_list **list;
4103 struct gdbarch_list *this;
4105 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4106 "Previous architecture 0x%08lx (%s) selected\n",
4108 new_gdbarch->bfd_arch_info->printable_name);
4109 /* Find the existing arch in the list. */
4110 for (list = ®o->arches;
4111 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
4112 list = &(*list)->next);
4113 /* It had better be in the list of architectures. */
4114 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
4117 (*list) = this->next;
4118 /* Insert THIS at the front. */
4119 this->next = rego->arches;
4120 rego->arches = this;
4125 /* It's a new architecture. */
4127 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4128 "New architecture 0x%08lx (%s) selected\n",
4130 new_gdbarch->bfd_arch_info->printable_name);
4132 /* Insert the new architecture into the front of the architecture
4133 list (keep the list sorted Most Recently Used). */
4135 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
4136 this->next = rego->arches;
4137 this->gdbarch = new_gdbarch;
4138 rego->arches = this;
4141 /* Check that the newly installed architecture is valid. Plug in
4142 any post init values. */
4143 new_gdbarch->dump_tdep = rego->dump_tdep;
4144 verify_gdbarch (new_gdbarch);
4145 new_gdbarch->initialized_p = 1;
4147 /* Initialize any per-architecture swap areas. This phase requires
4148 a valid global CURRENT_GDBARCH. Set it momentarially, and then
4149 swap the entire architecture out. */
4150 current_gdbarch = new_gdbarch;
4151 current_gdbarch_swap_init_hack ();
4152 current_gdbarch_swap_out_hack ();
4155 gdbarch_dump (new_gdbarch, gdb_stdlog);
4161 gdbarch_find_by_info (struct gdbarch_info info)
4163 /* Save the previously selected architecture, setting the global to
4164 NULL. This stops things like gdbarch->init() trying to use the
4165 previous architecture's configuration. The previous architecture
4166 may not even be of the same architecture family. The most recent
4167 architecture of the same family is found at the head of the
4168 rego->arches list. */
4169 struct gdbarch *old_gdbarch = current_gdbarch_swap_out_hack ();
4171 /* Find the specified architecture. */
4172 struct gdbarch *new_gdbarch = find_arch_by_info (old_gdbarch, info);
4174 /* Restore the existing architecture. */
4175 gdb_assert (current_gdbarch == NULL);
4176 current_gdbarch_swap_in_hack (old_gdbarch);
4181 /* Make the specified architecture current, swapping the existing one
4185 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
4187 gdb_assert (new_gdbarch != NULL);
4188 gdb_assert (current_gdbarch != NULL);
4189 gdb_assert (new_gdbarch->initialized_p);
4190 current_gdbarch_swap_out_hack ();
4191 current_gdbarch_swap_in_hack (new_gdbarch);
4192 architecture_changed_event ();
4195 extern void _initialize_gdbarch (void);
4198 _initialize_gdbarch (void)
4200 struct cmd_list_element *c;
4202 deprecated_add_show_from_set
4203 (add_set_cmd ("arch",
4206 (char *)&gdbarch_debug,
4207 "Set architecture debugging.\n\
4208 When non-zero, architecture debugging is enabled.", &setdebuglist),
4210 c = add_set_cmd ("archdebug",
4213 (char *)&gdbarch_debug,
4214 "Set architecture debugging.\n\
4215 When non-zero, architecture debugging is enabled.", &setlist);
4217 deprecate_cmd (c, "set debug arch");
4218 deprecate_cmd (deprecated_add_show_from_set (c, &showlist), "show debug arch");