1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
5 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 Boston, MA 02110-1301, USA. */
25 /* This file was created with the aid of ``gdbarch.sh''.
27 The Bourne shell script ``gdbarch.sh'' creates the files
28 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
29 against the existing ``gdbarch.[hc]''. Any differences found
32 If editing this file, please also run gdbarch.sh and merge any
33 changes into that script. Conversely, when making sweeping changes
34 to this file, modifying gdbarch.sh and using its output may prove
39 #include "arch-utils.h"
45 #include "floatformat.h"
47 #include "gdb_assert.h"
48 #include "gdb_string.h"
49 #include "gdb-events.h"
50 #include "reggroups.h"
52 #include "gdb_obstack.h"
54 /* Static function declarations */
56 static void alloc_gdbarch_data (struct gdbarch
*);
58 /* Non-zero if we want to trace architecture code. */
61 #define GDBARCH_DEBUG 0
63 int gdbarch_debug
= GDBARCH_DEBUG
;
65 show_gdbarch_debug (struct ui_file
*file
, int from_tty
,
66 struct cmd_list_element
*c
, const char *value
)
68 fprintf_filtered (file
, _("Architecture debugging is %s.\n"), value
);
72 pformat (const struct floatformat
**format
)
77 /* Just print out one of them - this is only for diagnostics. */
78 return format
[0]->name
;
82 /* Maintain the struct gdbarch object */
86 /* Has this architecture been fully initialized? */
89 /* An obstack bound to the lifetime of the architecture. */
90 struct obstack
*obstack
;
92 /* basic architectural information */
93 const struct bfd_arch_info
* bfd_arch_info
;
96 const struct target_desc
* target_desc
;
98 /* target specific vector. */
99 struct gdbarch_tdep
*tdep
;
100 gdbarch_dump_tdep_ftype
*dump_tdep
;
102 /* per-architecture data-pointers */
106 /* per-architecture swap-regions */
107 struct gdbarch_swap
*swap
;
109 /* Multi-arch values.
111 When extending this structure you must:
115 Declare set/get functions and define the corresponding
118 gdbarch_alloc(): If zero/NULL is not a suitable default,
119 initialize the new field.
121 verify_gdbarch(): Confirm that the target updated the field
124 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
127 ``startup_gdbarch()'': Append an initial value to the static
128 variable (base values on the host's c-type system).
130 get_gdbarch(): Implement the set/get functions (probably using
131 the macro's as shortcuts).
140 const struct floatformat
** float_format
;
142 const struct floatformat
** double_format
;
144 const struct floatformat
** long_double_format
;
148 gdbarch_read_pc_ftype
*read_pc
;
149 gdbarch_write_pc_ftype
*write_pc
;
150 gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
;
151 gdbarch_pseudo_register_read_ftype
*pseudo_register_read
;
152 gdbarch_pseudo_register_write_ftype
*pseudo_register_write
;
159 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
160 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
161 gdbarch_dwarf_reg_to_regnum_ftype
*dwarf_reg_to_regnum
;
162 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
163 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
164 gdbarch_register_name_ftype
*register_name
;
165 gdbarch_register_type_ftype
*register_type
;
166 gdbarch_unwind_dummy_id_ftype
*unwind_dummy_id
;
167 int deprecated_fp_regnum
;
168 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
169 int deprecated_register_size
;
170 int call_dummy_location
;
171 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
172 gdbarch_print_registers_info_ftype
*print_registers_info
;
173 gdbarch_print_float_info_ftype
*print_float_info
;
174 gdbarch_print_vector_info_ftype
*print_vector_info
;
175 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
176 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
177 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
178 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
179 int believe_pcc_promotion
;
180 gdbarch_convert_register_p_ftype
*convert_register_p
;
181 gdbarch_register_to_value_ftype
*register_to_value
;
182 gdbarch_value_to_register_ftype
*value_to_register
;
183 gdbarch_value_from_register_ftype
*value_from_register
;
184 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
185 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
186 gdbarch_integer_to_address_ftype
*integer_to_address
;
187 gdbarch_return_value_ftype
*return_value
;
188 gdbarch_extract_return_value_ftype
*extract_return_value
;
189 gdbarch_store_return_value_ftype
*store_return_value
;
190 gdbarch_deprecated_use_struct_convention_ftype
*deprecated_use_struct_convention
;
191 gdbarch_skip_prologue_ftype
*skip_prologue
;
192 gdbarch_inner_than_ftype
*inner_than
;
193 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
194 gdbarch_adjust_breakpoint_address_ftype
*adjust_breakpoint_address
;
195 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
196 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
197 CORE_ADDR decr_pc_after_break
;
198 CORE_ADDR deprecated_function_start_offset
;
199 gdbarch_remote_register_number_ftype
*remote_register_number
;
200 gdbarch_fetch_tls_load_module_address_ftype
*fetch_tls_load_module_address
;
201 CORE_ADDR frame_args_skip
;
202 gdbarch_unwind_pc_ftype
*unwind_pc
;
203 gdbarch_unwind_sp_ftype
*unwind_sp
;
204 gdbarch_frame_num_args_ftype
*frame_num_args
;
205 gdbarch_frame_align_ftype
*frame_align
;
206 gdbarch_deprecated_reg_struct_has_addr_ftype
*deprecated_reg_struct_has_addr
;
207 gdbarch_stabs_argument_has_addr_ftype
*stabs_argument_has_addr
;
208 int frame_red_zone_size
;
209 gdbarch_convert_from_func_ptr_addr_ftype
*convert_from_func_ptr_addr
;
210 gdbarch_addr_bits_remove_ftype
*addr_bits_remove
;
211 gdbarch_smash_text_address_ftype
*smash_text_address
;
212 gdbarch_software_single_step_ftype
*software_single_step
;
213 gdbarch_single_step_through_delay_ftype
*single_step_through_delay
;
214 gdbarch_print_insn_ftype
*print_insn
;
215 gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
;
216 gdbarch_skip_solib_resolver_ftype
*skip_solib_resolver
;
217 gdbarch_in_solib_return_trampoline_ftype
*in_solib_return_trampoline
;
218 gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
;
219 gdbarch_construct_inferior_arguments_ftype
*construct_inferior_arguments
;
220 gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
;
221 gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
;
222 const char * name_of_malloc
;
223 int cannot_step_breakpoint
;
224 int have_nonsteppable_watchpoint
;
225 gdbarch_address_class_type_flags_ftype
*address_class_type_flags
;
226 gdbarch_address_class_type_flags_to_name_ftype
*address_class_type_flags_to_name
;
227 gdbarch_address_class_name_to_type_flags_ftype
*address_class_name_to_type_flags
;
228 gdbarch_register_reggroup_p_ftype
*register_reggroup_p
;
229 gdbarch_fetch_pointer_argument_ftype
*fetch_pointer_argument
;
230 gdbarch_regset_from_core_section_ftype
*regset_from_core_section
;
231 int vtable_function_descriptors
;
233 gdbarch_skip_permanent_breakpoint_ftype
*skip_permanent_breakpoint
;
234 gdbarch_overlay_update_ftype
*overlay_update
;
238 /* The default architecture uses host values (for want of a better
241 extern const struct bfd_arch_info bfd_default_arch_struct
;
243 struct gdbarch startup_gdbarch
=
245 1, /* Always initialized. */
246 NULL
, /* The obstack. */
247 /* basic architecture information */
248 &bfd_default_arch_struct
, /* bfd_arch_info */
249 BFD_ENDIAN_BIG
, /* byte_order */
250 GDB_OSABI_UNKNOWN
, /* osabi */
252 /* target specific vector and its dump routine */
254 /*per-architecture data-pointers and swap regions */
256 /* Multi-arch values */
257 8 * sizeof (short), /* short_bit */
258 8 * sizeof (int), /* int_bit */
259 8 * sizeof (long), /* long_bit */
260 8 * sizeof (LONGEST
), /* long_long_bit */
261 8 * sizeof (float), /* float_bit */
262 0, /* float_format */
263 8 * sizeof (double), /* double_bit */
264 0, /* double_format */
265 8 * sizeof (long double), /* long_double_bit */
266 0, /* long_double_format */
267 8 * sizeof (void*), /* ptr_bit */
268 8 * sizeof (void*), /* addr_bit */
272 0, /* virtual_frame_pointer */
273 0, /* pseudo_register_read */
274 0, /* pseudo_register_write */
276 0, /* num_pseudo_regs */
281 0, /* stab_reg_to_regnum */
282 0, /* ecoff_reg_to_regnum */
283 0, /* dwarf_reg_to_regnum */
284 0, /* sdb_reg_to_regnum */
285 0, /* dwarf2_reg_to_regnum */
286 0, /* register_name */
287 0, /* register_type */
288 0, /* unwind_dummy_id */
289 -1, /* deprecated_fp_regnum */
290 0, /* push_dummy_call */
291 0, /* deprecated_register_size */
292 0, /* call_dummy_location */
293 0, /* push_dummy_code */
294 default_print_registers_info
, /* print_registers_info */
295 0, /* print_float_info */
296 0, /* print_vector_info */
297 0, /* register_sim_regno */
298 0, /* cannot_fetch_register */
299 0, /* cannot_store_register */
300 0, /* get_longjmp_target */
301 0, /* believe_pcc_promotion */
302 0, /* convert_register_p */
303 0, /* register_to_value */
304 0, /* value_to_register */
305 0, /* value_from_register */
306 0, /* pointer_to_address */
307 0, /* address_to_pointer */
308 0, /* integer_to_address */
309 0, /* return_value */
310 0, /* extract_return_value */
311 0, /* store_return_value */
312 0, /* deprecated_use_struct_convention */
313 0, /* skip_prologue */
315 0, /* breakpoint_from_pc */
316 0, /* adjust_breakpoint_address */
317 0, /* memory_insert_breakpoint */
318 0, /* memory_remove_breakpoint */
319 0, /* decr_pc_after_break */
320 0, /* deprecated_function_start_offset */
321 default_remote_register_number
, /* remote_register_number */
322 0, /* fetch_tls_load_module_address */
323 0, /* frame_args_skip */
326 0, /* frame_num_args */
328 0, /* deprecated_reg_struct_has_addr */
329 default_stabs_argument_has_addr
, /* stabs_argument_has_addr */
330 0, /* frame_red_zone_size */
331 convert_from_func_ptr_addr_identity
, /* convert_from_func_ptr_addr */
332 0, /* addr_bits_remove */
333 0, /* smash_text_address */
334 0, /* software_single_step */
335 0, /* single_step_through_delay */
337 0, /* skip_trampoline_code */
338 generic_skip_solib_resolver
, /* skip_solib_resolver */
339 0, /* in_solib_return_trampoline */
340 generic_in_function_epilogue_p
, /* in_function_epilogue_p */
341 construct_inferior_arguments
, /* construct_inferior_arguments */
342 0, /* elf_make_msymbol_special */
343 0, /* coff_make_msymbol_special */
344 "malloc", /* name_of_malloc */
345 0, /* cannot_step_breakpoint */
346 0, /* have_nonsteppable_watchpoint */
347 0, /* address_class_type_flags */
348 0, /* address_class_type_flags_to_name */
349 0, /* address_class_name_to_type_flags */
350 default_register_reggroup_p
, /* register_reggroup_p */
351 0, /* fetch_pointer_argument */
352 0, /* regset_from_core_section */
353 0, /* vtable_function_descriptors */
354 0, /* vbit_in_delta */
355 0, /* skip_permanent_breakpoint */
356 0, /* overlay_update */
357 /* startup_gdbarch() */
360 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
362 /* Create a new ``struct gdbarch'' based on information provided by
363 ``struct gdbarch_info''. */
366 gdbarch_alloc (const struct gdbarch_info
*info
,
367 struct gdbarch_tdep
*tdep
)
369 /* NOTE: The new architecture variable is named ``current_gdbarch''
370 so that macros such as TARGET_ARCHITECTURE, when expanded, refer to
371 the current local architecture and not the previous global
372 architecture. This ensures that the new architectures initial
373 values are not influenced by the previous architecture. Once
374 everything is parameterised with gdbarch, this will go away. */
375 struct gdbarch
*current_gdbarch
;
377 /* Create an obstack for allocating all the per-architecture memory,
378 then use that to allocate the architecture vector. */
379 struct obstack
*obstack
= XMALLOC (struct obstack
);
380 obstack_init (obstack
);
381 current_gdbarch
= obstack_alloc (obstack
, sizeof (*current_gdbarch
));
382 memset (current_gdbarch
, 0, sizeof (*current_gdbarch
));
383 current_gdbarch
->obstack
= obstack
;
385 alloc_gdbarch_data (current_gdbarch
);
387 current_gdbarch
->tdep
= tdep
;
389 current_gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
390 current_gdbarch
->byte_order
= info
->byte_order
;
391 current_gdbarch
->osabi
= info
->osabi
;
392 current_gdbarch
->target_desc
= info
->target_desc
;
394 /* Force the explicit initialization of these. */
395 current_gdbarch
->short_bit
= 2*TARGET_CHAR_BIT
;
396 current_gdbarch
->int_bit
= 4*TARGET_CHAR_BIT
;
397 current_gdbarch
->long_bit
= 4*TARGET_CHAR_BIT
;
398 current_gdbarch
->long_long_bit
= 2*current_gdbarch
->long_bit
;
399 current_gdbarch
->float_bit
= 4*TARGET_CHAR_BIT
;
400 current_gdbarch
->double_bit
= 8*TARGET_CHAR_BIT
;
401 current_gdbarch
->long_double_bit
= 8*TARGET_CHAR_BIT
;
402 current_gdbarch
->ptr_bit
= current_gdbarch
->int_bit
;
403 current_gdbarch
->char_signed
= -1;
404 current_gdbarch
->virtual_frame_pointer
= legacy_virtual_frame_pointer
;
405 current_gdbarch
->num_regs
= -1;
406 current_gdbarch
->sp_regnum
= -1;
407 current_gdbarch
->pc_regnum
= -1;
408 current_gdbarch
->ps_regnum
= -1;
409 current_gdbarch
->fp0_regnum
= -1;
410 current_gdbarch
->stab_reg_to_regnum
= no_op_reg_to_regnum
;
411 current_gdbarch
->ecoff_reg_to_regnum
= no_op_reg_to_regnum
;
412 current_gdbarch
->dwarf_reg_to_regnum
= no_op_reg_to_regnum
;
413 current_gdbarch
->sdb_reg_to_regnum
= no_op_reg_to_regnum
;
414 current_gdbarch
->dwarf2_reg_to_regnum
= no_op_reg_to_regnum
;
415 current_gdbarch
->deprecated_fp_regnum
= -1;
416 current_gdbarch
->call_dummy_location
= AT_ENTRY_POINT
;
417 current_gdbarch
->print_registers_info
= default_print_registers_info
;
418 current_gdbarch
->register_sim_regno
= legacy_register_sim_regno
;
419 current_gdbarch
->cannot_fetch_register
= cannot_register_not
;
420 current_gdbarch
->cannot_store_register
= cannot_register_not
;
421 current_gdbarch
->convert_register_p
= generic_convert_register_p
;
422 current_gdbarch
->value_from_register
= default_value_from_register
;
423 current_gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
424 current_gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
425 current_gdbarch
->return_value
= legacy_return_value
;
426 current_gdbarch
->deprecated_use_struct_convention
= generic_use_struct_convention
;
427 current_gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
428 current_gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
429 current_gdbarch
->remote_register_number
= default_remote_register_number
;
430 current_gdbarch
->stabs_argument_has_addr
= default_stabs_argument_has_addr
;
431 current_gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr_identity
;
432 current_gdbarch
->addr_bits_remove
= core_addr_identity
;
433 current_gdbarch
->smash_text_address
= core_addr_identity
;
434 current_gdbarch
->skip_trampoline_code
= generic_skip_trampoline_code
;
435 current_gdbarch
->skip_solib_resolver
= generic_skip_solib_resolver
;
436 current_gdbarch
->in_solib_return_trampoline
= generic_in_solib_return_trampoline
;
437 current_gdbarch
->in_function_epilogue_p
= generic_in_function_epilogue_p
;
438 current_gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
439 current_gdbarch
->elf_make_msymbol_special
= default_elf_make_msymbol_special
;
440 current_gdbarch
->coff_make_msymbol_special
= default_coff_make_msymbol_special
;
441 current_gdbarch
->name_of_malloc
= "malloc";
442 current_gdbarch
->register_reggroup_p
= default_register_reggroup_p
;
443 /* gdbarch_alloc() */
445 return current_gdbarch
;
449 /* Allocate extra space using the per-architecture obstack. */
452 gdbarch_obstack_zalloc (struct gdbarch
*arch
, long size
)
454 void *data
= obstack_alloc (arch
->obstack
, size
);
455 memset (data
, 0, size
);
460 /* Free a gdbarch struct. This should never happen in normal
461 operation --- once you've created a gdbarch, you keep it around.
462 However, if an architecture's init function encounters an error
463 building the structure, it may need to clean up a partially
464 constructed gdbarch. */
467 gdbarch_free (struct gdbarch
*arch
)
469 struct obstack
*obstack
;
470 gdb_assert (arch
!= NULL
);
471 gdb_assert (!arch
->initialized_p
);
472 obstack
= arch
->obstack
;
473 obstack_free (obstack
, 0); /* Includes the ARCH. */
478 /* Ensure that all values in a GDBARCH are reasonable. */
480 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
481 just happens to match the global variable ``current_gdbarch''. That
482 way macros refering to that variable get the local and not the global
483 version - ulgh. Once everything is parameterised with gdbarch, this
487 verify_gdbarch (struct gdbarch
*current_gdbarch
)
490 struct cleanup
*cleanups
;
493 log
= mem_fileopen ();
494 cleanups
= make_cleanup_ui_file_delete (log
);
496 if (current_gdbarch
->byte_order
== BFD_ENDIAN_UNKNOWN
)
497 fprintf_unfiltered (log
, "\n\tbyte-order");
498 if (current_gdbarch
->bfd_arch_info
== NULL
)
499 fprintf_unfiltered (log
, "\n\tbfd_arch_info");
500 /* Check those that need to be defined for the given multi-arch level. */
501 /* Skip verify of short_bit, invalid_p == 0 */
502 /* Skip verify of int_bit, invalid_p == 0 */
503 /* Skip verify of long_bit, invalid_p == 0 */
504 /* Skip verify of long_long_bit, invalid_p == 0 */
505 /* Skip verify of float_bit, invalid_p == 0 */
506 if (current_gdbarch
->float_format
== 0)
507 current_gdbarch
->float_format
= floatformats_ieee_single
;
508 /* Skip verify of double_bit, invalid_p == 0 */
509 if (current_gdbarch
->double_format
== 0)
510 current_gdbarch
->double_format
= floatformats_ieee_double
;
511 /* Skip verify of long_double_bit, invalid_p == 0 */
512 if (current_gdbarch
->long_double_format
== 0)
513 current_gdbarch
->long_double_format
= floatformats_ieee_double
;
514 /* Skip verify of ptr_bit, invalid_p == 0 */
515 if (current_gdbarch
->addr_bit
== 0)
516 current_gdbarch
->addr_bit
= gdbarch_ptr_bit (current_gdbarch
);
517 if (current_gdbarch
->char_signed
== -1)
518 current_gdbarch
->char_signed
= 1;
519 /* Skip verify of read_pc, has predicate */
520 /* Skip verify of write_pc, has predicate */
521 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
522 /* Skip verify of pseudo_register_read, has predicate */
523 /* Skip verify of pseudo_register_write, has predicate */
524 if (current_gdbarch
->num_regs
== -1)
525 fprintf_unfiltered (log
, "\n\tnum_regs");
526 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
527 /* Skip verify of sp_regnum, invalid_p == 0 */
528 /* Skip verify of pc_regnum, invalid_p == 0 */
529 /* Skip verify of ps_regnum, invalid_p == 0 */
530 /* Skip verify of fp0_regnum, invalid_p == 0 */
531 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
532 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
533 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
534 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
535 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
536 /* Skip verify of register_type, has predicate */
537 /* Skip verify of unwind_dummy_id, has predicate */
538 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
539 /* Skip verify of push_dummy_call, has predicate */
540 /* Skip verify of call_dummy_location, invalid_p == 0 */
541 /* Skip verify of push_dummy_code, has predicate */
542 /* Skip verify of print_registers_info, invalid_p == 0 */
543 /* Skip verify of print_float_info, has predicate */
544 /* Skip verify of print_vector_info, has predicate */
545 /* Skip verify of register_sim_regno, invalid_p == 0 */
546 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
547 /* Skip verify of cannot_store_register, invalid_p == 0 */
548 /* Skip verify of get_longjmp_target, has predicate */
549 /* Skip verify of convert_register_p, invalid_p == 0 */
550 /* Skip verify of value_from_register, invalid_p == 0 */
551 /* Skip verify of pointer_to_address, invalid_p == 0 */
552 /* Skip verify of address_to_pointer, invalid_p == 0 */
553 /* Skip verify of integer_to_address, has predicate */
554 /* Skip verify of return_value, has predicate */
555 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
556 if (current_gdbarch
->skip_prologue
== 0)
557 fprintf_unfiltered (log
, "\n\tskip_prologue");
558 if (current_gdbarch
->inner_than
== 0)
559 fprintf_unfiltered (log
, "\n\tinner_than");
560 if (current_gdbarch
->breakpoint_from_pc
== 0)
561 fprintf_unfiltered (log
, "\n\tbreakpoint_from_pc");
562 /* Skip verify of adjust_breakpoint_address, has predicate */
563 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
564 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
565 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
566 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
567 /* Skip verify of remote_register_number, invalid_p == 0 */
568 /* Skip verify of fetch_tls_load_module_address, has predicate */
569 /* Skip verify of frame_args_skip, invalid_p == 0 */
570 /* Skip verify of unwind_pc, has predicate */
571 /* Skip verify of unwind_sp, has predicate */
572 /* Skip verify of frame_num_args, has predicate */
573 /* Skip verify of frame_align, has predicate */
574 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
575 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
576 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
577 /* Skip verify of addr_bits_remove, invalid_p == 0 */
578 /* Skip verify of smash_text_address, invalid_p == 0 */
579 /* Skip verify of software_single_step, has predicate */
580 /* Skip verify of single_step_through_delay, has predicate */
581 if (current_gdbarch
->print_insn
== 0)
582 fprintf_unfiltered (log
, "\n\tprint_insn");
583 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
584 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
585 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
586 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
587 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
588 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
589 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
590 /* Skip verify of name_of_malloc, invalid_p == 0 */
591 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
592 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
593 /* Skip verify of address_class_type_flags, has predicate */
594 /* Skip verify of address_class_type_flags_to_name, has predicate */
595 /* Skip verify of address_class_name_to_type_flags, has predicate */
596 /* Skip verify of register_reggroup_p, invalid_p == 0 */
597 /* Skip verify of fetch_pointer_argument, has predicate */
598 /* Skip verify of regset_from_core_section, has predicate */
599 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
600 /* Skip verify of vbit_in_delta, invalid_p == 0 */
601 /* Skip verify of skip_permanent_breakpoint, has predicate */
602 /* Skip verify of overlay_update, has predicate */
603 buf
= ui_file_xstrdup (log
, &dummy
);
604 make_cleanup (xfree
, buf
);
605 if (strlen (buf
) > 0)
606 internal_error (__FILE__
, __LINE__
,
607 _("verify_gdbarch: the following are invalid ...%s"),
609 do_cleanups (cleanups
);
613 /* Print out the details of the current architecture. */
615 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
616 just happens to match the global variable ``current_gdbarch''. That
617 way macros refering to that variable get the local and not the global
618 version - ulgh. Once everything is parameterised with gdbarch, this
622 gdbarch_dump (struct gdbarch
*current_gdbarch
, struct ui_file
*file
)
624 const char *gdb_xm_file
= "<not-defined>";
625 const char *gdb_nm_file
= "<not-defined>";
626 const char *gdb_tm_file
= "<not-defined>";
627 #if defined (GDB_XM_FILE)
628 gdb_xm_file
= GDB_XM_FILE
;
630 fprintf_unfiltered (file
,
631 "gdbarch_dump: GDB_XM_FILE = %s\n",
633 #if defined (GDB_NM_FILE)
634 gdb_nm_file
= GDB_NM_FILE
;
636 fprintf_unfiltered (file
,
637 "gdbarch_dump: GDB_NM_FILE = %s\n",
639 #if defined (GDB_TM_FILE)
640 gdb_tm_file
= GDB_TM_FILE
;
642 fprintf_unfiltered (file
,
643 "gdbarch_dump: GDB_TM_FILE = %s\n",
645 fprintf_unfiltered (file
,
646 "gdbarch_dump: addr_bit = %s\n",
647 paddr_d (current_gdbarch
->addr_bit
));
648 fprintf_unfiltered (file
,
649 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
650 (long) current_gdbarch
->addr_bits_remove
);
651 fprintf_unfiltered (file
,
652 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
653 gdbarch_address_class_name_to_type_flags_p (current_gdbarch
));
654 fprintf_unfiltered (file
,
655 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
656 (long) current_gdbarch
->address_class_name_to_type_flags
);
657 fprintf_unfiltered (file
,
658 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
659 gdbarch_address_class_type_flags_p (current_gdbarch
));
660 fprintf_unfiltered (file
,
661 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
662 (long) current_gdbarch
->address_class_type_flags
);
663 fprintf_unfiltered (file
,
664 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
665 gdbarch_address_class_type_flags_to_name_p (current_gdbarch
));
666 fprintf_unfiltered (file
,
667 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
668 (long) current_gdbarch
->address_class_type_flags_to_name
);
669 fprintf_unfiltered (file
,
670 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
671 (long) current_gdbarch
->address_to_pointer
);
672 fprintf_unfiltered (file
,
673 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
674 gdbarch_adjust_breakpoint_address_p (current_gdbarch
));
675 fprintf_unfiltered (file
,
676 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
677 (long) current_gdbarch
->adjust_breakpoint_address
);
678 #ifdef BELIEVE_PCC_PROMOTION
679 fprintf_unfiltered (file
,
680 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
681 XSTRING (BELIEVE_PCC_PROMOTION
));
683 fprintf_unfiltered (file
,
684 "gdbarch_dump: believe_pcc_promotion = %s\n",
685 paddr_d (current_gdbarch
->believe_pcc_promotion
));
686 fprintf_unfiltered (file
,
687 "gdbarch_dump: bfd_arch_info = %s\n",
688 gdbarch_bfd_arch_info (current_gdbarch
)->printable_name
);
689 fprintf_unfiltered (file
,
690 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
691 (long) current_gdbarch
->breakpoint_from_pc
);
692 fprintf_unfiltered (file
,
693 "gdbarch_dump: byte_order = %s\n",
694 paddr_d (current_gdbarch
->byte_order
));
695 fprintf_unfiltered (file
,
696 "gdbarch_dump: call_dummy_location = %s\n",
697 paddr_d (current_gdbarch
->call_dummy_location
));
698 fprintf_unfiltered (file
,
699 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
700 (long) current_gdbarch
->cannot_fetch_register
);
701 fprintf_unfiltered (file
,
702 "gdbarch_dump: cannot_step_breakpoint = %s\n",
703 paddr_d (current_gdbarch
->cannot_step_breakpoint
));
704 fprintf_unfiltered (file
,
705 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
706 (long) current_gdbarch
->cannot_store_register
);
707 fprintf_unfiltered (file
,
708 "gdbarch_dump: char_signed = %s\n",
709 paddr_d (current_gdbarch
->char_signed
));
710 fprintf_unfiltered (file
,
711 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
712 (long) current_gdbarch
->coff_make_msymbol_special
);
713 fprintf_unfiltered (file
,
714 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
715 (long) current_gdbarch
->construct_inferior_arguments
);
716 fprintf_unfiltered (file
,
717 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
718 (long) current_gdbarch
->convert_from_func_ptr_addr
);
719 fprintf_unfiltered (file
,
720 "gdbarch_dump: convert_register_p = <0x%lx>\n",
721 (long) current_gdbarch
->convert_register_p
);
722 fprintf_unfiltered (file
,
723 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
724 paddr_nz (current_gdbarch
->decr_pc_after_break
));
725 #ifdef DEPRECATED_FP_REGNUM
726 fprintf_unfiltered (file
,
727 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
728 XSTRING (DEPRECATED_FP_REGNUM
));
730 fprintf_unfiltered (file
,
731 "gdbarch_dump: deprecated_fp_regnum = %s\n",
732 paddr_d (current_gdbarch
->deprecated_fp_regnum
));
733 fprintf_unfiltered (file
,
734 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
735 paddr_nz (current_gdbarch
->deprecated_function_start_offset
));
736 fprintf_unfiltered (file
,
737 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
738 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch
));
739 fprintf_unfiltered (file
,
740 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
741 (long) current_gdbarch
->deprecated_reg_struct_has_addr
);
742 #ifdef DEPRECATED_REGISTER_SIZE
743 fprintf_unfiltered (file
,
744 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
745 XSTRING (DEPRECATED_REGISTER_SIZE
));
747 fprintf_unfiltered (file
,
748 "gdbarch_dump: deprecated_register_size = %s\n",
749 paddr_d (current_gdbarch
->deprecated_register_size
));
750 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
751 fprintf_unfiltered (file
,
752 "gdbarch_dump: %s # %s\n",
753 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
754 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p
, value_type
)));
756 fprintf_unfiltered (file
,
757 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
758 (long) current_gdbarch
->deprecated_use_struct_convention
);
759 fprintf_unfiltered (file
,
760 "gdbarch_dump: double_bit = %s\n",
761 paddr_d (current_gdbarch
->double_bit
));
762 fprintf_unfiltered (file
,
763 "gdbarch_dump: double_format = %s\n",
764 pformat (current_gdbarch
->double_format
));
765 fprintf_unfiltered (file
,
766 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
767 (long) current_gdbarch
->dwarf2_reg_to_regnum
);
768 fprintf_unfiltered (file
,
769 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
770 (long) current_gdbarch
->dwarf_reg_to_regnum
);
771 fprintf_unfiltered (file
,
772 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
773 (long) current_gdbarch
->ecoff_reg_to_regnum
);
774 fprintf_unfiltered (file
,
775 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
776 (long) current_gdbarch
->elf_make_msymbol_special
);
777 #ifdef EXTRACT_RETURN_VALUE
778 fprintf_unfiltered (file
,
779 "gdbarch_dump: %s # %s\n",
780 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
781 XSTRING (EXTRACT_RETURN_VALUE (type
, regcache
, valbuf
)));
783 fprintf_unfiltered (file
,
784 "gdbarch_dump: extract_return_value = <0x%lx>\n",
785 (long) current_gdbarch
->extract_return_value
);
786 fprintf_unfiltered (file
,
787 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
788 gdbarch_fetch_pointer_argument_p (current_gdbarch
));
789 fprintf_unfiltered (file
,
790 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
791 (long) current_gdbarch
->fetch_pointer_argument
);
792 fprintf_unfiltered (file
,
793 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
794 gdbarch_fetch_tls_load_module_address_p (current_gdbarch
));
795 fprintf_unfiltered (file
,
796 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
797 (long) current_gdbarch
->fetch_tls_load_module_address
);
798 fprintf_unfiltered (file
,
799 "gdbarch_dump: float_bit = %s\n",
800 paddr_d (current_gdbarch
->float_bit
));
801 fprintf_unfiltered (file
,
802 "gdbarch_dump: float_format = %s\n",
803 pformat (current_gdbarch
->float_format
));
804 fprintf_unfiltered (file
,
805 "gdbarch_dump: fp0_regnum = %s\n",
806 paddr_d (current_gdbarch
->fp0_regnum
));
807 fprintf_unfiltered (file
,
808 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
809 gdbarch_frame_align_p (current_gdbarch
));
810 fprintf_unfiltered (file
,
811 "gdbarch_dump: frame_align = <0x%lx>\n",
812 (long) current_gdbarch
->frame_align
);
813 fprintf_unfiltered (file
,
814 "gdbarch_dump: frame_args_skip = 0x%s\n",
815 paddr_nz (current_gdbarch
->frame_args_skip
));
816 fprintf_unfiltered (file
,
817 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
818 gdbarch_frame_num_args_p (current_gdbarch
));
819 fprintf_unfiltered (file
,
820 "gdbarch_dump: frame_num_args = <0x%lx>\n",
821 (long) current_gdbarch
->frame_num_args
);
822 fprintf_unfiltered (file
,
823 "gdbarch_dump: frame_red_zone_size = %s\n",
824 paddr_d (current_gdbarch
->frame_red_zone_size
));
825 fprintf_unfiltered (file
,
826 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
827 gdbarch_get_longjmp_target_p (current_gdbarch
));
828 fprintf_unfiltered (file
,
829 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
830 (long) current_gdbarch
->get_longjmp_target
);
831 fprintf_unfiltered (file
,
832 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
833 paddr_d (current_gdbarch
->have_nonsteppable_watchpoint
));
834 fprintf_unfiltered (file
,
835 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
836 (long) current_gdbarch
->in_function_epilogue_p
);
837 fprintf_unfiltered (file
,
838 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
839 (long) current_gdbarch
->in_solib_return_trampoline
);
840 fprintf_unfiltered (file
,
841 "gdbarch_dump: inner_than = <0x%lx>\n",
842 (long) current_gdbarch
->inner_than
);
843 fprintf_unfiltered (file
,
844 "gdbarch_dump: int_bit = %s\n",
845 paddr_d (current_gdbarch
->int_bit
));
846 fprintf_unfiltered (file
,
847 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
848 gdbarch_integer_to_address_p (current_gdbarch
));
849 fprintf_unfiltered (file
,
850 "gdbarch_dump: integer_to_address = <0x%lx>\n",
851 (long) current_gdbarch
->integer_to_address
);
852 fprintf_unfiltered (file
,
853 "gdbarch_dump: long_bit = %s\n",
854 paddr_d (current_gdbarch
->long_bit
));
855 fprintf_unfiltered (file
,
856 "gdbarch_dump: long_double_bit = %s\n",
857 paddr_d (current_gdbarch
->long_double_bit
));
858 fprintf_unfiltered (file
,
859 "gdbarch_dump: long_double_format = %s\n",
860 pformat (current_gdbarch
->long_double_format
));
861 fprintf_unfiltered (file
,
862 "gdbarch_dump: long_long_bit = %s\n",
863 paddr_d (current_gdbarch
->long_long_bit
));
864 fprintf_unfiltered (file
,
865 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
866 (long) current_gdbarch
->memory_insert_breakpoint
);
867 fprintf_unfiltered (file
,
868 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
869 (long) current_gdbarch
->memory_remove_breakpoint
);
870 fprintf_unfiltered (file
,
871 "gdbarch_dump: name_of_malloc = %s\n",
872 current_gdbarch
->name_of_malloc
);
873 fprintf_unfiltered (file
,
874 "gdbarch_dump: num_pseudo_regs = %s\n",
875 paddr_d (current_gdbarch
->num_pseudo_regs
));
876 fprintf_unfiltered (file
,
877 "gdbarch_dump: num_regs = %s\n",
878 paddr_d (current_gdbarch
->num_regs
));
879 fprintf_unfiltered (file
,
880 "gdbarch_dump: osabi = %s\n",
881 paddr_d (current_gdbarch
->osabi
));
882 fprintf_unfiltered (file
,
883 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
884 gdbarch_overlay_update_p (current_gdbarch
));
885 fprintf_unfiltered (file
,
886 "gdbarch_dump: overlay_update = <0x%lx>\n",
887 (long) current_gdbarch
->overlay_update
);
888 fprintf_unfiltered (file
,
889 "gdbarch_dump: pc_regnum = %s\n",
890 paddr_d (current_gdbarch
->pc_regnum
));
891 fprintf_unfiltered (file
,
892 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
893 (long) current_gdbarch
->pointer_to_address
);
894 fprintf_unfiltered (file
,
895 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
896 gdbarch_print_float_info_p (current_gdbarch
));
897 fprintf_unfiltered (file
,
898 "gdbarch_dump: print_float_info = <0x%lx>\n",
899 (long) current_gdbarch
->print_float_info
);
900 #ifdef TARGET_PRINT_INSN
901 fprintf_unfiltered (file
,
902 "gdbarch_dump: %s # %s\n",
903 "TARGET_PRINT_INSN(vma, info)",
904 XSTRING (TARGET_PRINT_INSN (vma
, info
)));
906 fprintf_unfiltered (file
,
907 "gdbarch_dump: print_insn = <0x%lx>\n",
908 (long) current_gdbarch
->print_insn
);
909 fprintf_unfiltered (file
,
910 "gdbarch_dump: print_registers_info = <0x%lx>\n",
911 (long) current_gdbarch
->print_registers_info
);
912 fprintf_unfiltered (file
,
913 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
914 gdbarch_print_vector_info_p (current_gdbarch
));
915 fprintf_unfiltered (file
,
916 "gdbarch_dump: print_vector_info = <0x%lx>\n",
917 (long) current_gdbarch
->print_vector_info
);
918 fprintf_unfiltered (file
,
919 "gdbarch_dump: ps_regnum = %s\n",
920 paddr_d (current_gdbarch
->ps_regnum
));
921 fprintf_unfiltered (file
,
922 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
923 gdbarch_pseudo_register_read_p (current_gdbarch
));
924 fprintf_unfiltered (file
,
925 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
926 (long) current_gdbarch
->pseudo_register_read
);
927 fprintf_unfiltered (file
,
928 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
929 gdbarch_pseudo_register_write_p (current_gdbarch
));
930 fprintf_unfiltered (file
,
931 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
932 (long) current_gdbarch
->pseudo_register_write
);
933 fprintf_unfiltered (file
,
934 "gdbarch_dump: ptr_bit = %s\n",
935 paddr_d (current_gdbarch
->ptr_bit
));
936 fprintf_unfiltered (file
,
937 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
938 gdbarch_push_dummy_call_p (current_gdbarch
));
939 fprintf_unfiltered (file
,
940 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
941 (long) current_gdbarch
->push_dummy_call
);
942 fprintf_unfiltered (file
,
943 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
944 gdbarch_push_dummy_code_p (current_gdbarch
));
945 fprintf_unfiltered (file
,
946 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
947 (long) current_gdbarch
->push_dummy_code
);
948 fprintf_unfiltered (file
,
949 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
950 gdbarch_read_pc_p (current_gdbarch
));
951 fprintf_unfiltered (file
,
952 "gdbarch_dump: read_pc = <0x%lx>\n",
953 (long) current_gdbarch
->read_pc
);
954 fprintf_unfiltered (file
,
955 "gdbarch_dump: register_name = <0x%lx>\n",
956 (long) current_gdbarch
->register_name
);
957 fprintf_unfiltered (file
,
958 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
959 (long) current_gdbarch
->register_reggroup_p
);
960 fprintf_unfiltered (file
,
961 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
962 (long) current_gdbarch
->register_sim_regno
);
963 fprintf_unfiltered (file
,
964 "gdbarch_dump: register_to_value = <0x%lx>\n",
965 (long) current_gdbarch
->register_to_value
);
966 fprintf_unfiltered (file
,
967 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
968 gdbarch_register_type_p (current_gdbarch
));
969 fprintf_unfiltered (file
,
970 "gdbarch_dump: register_type = <0x%lx>\n",
971 (long) current_gdbarch
->register_type
);
972 fprintf_unfiltered (file
,
973 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
974 gdbarch_regset_from_core_section_p (current_gdbarch
));
975 fprintf_unfiltered (file
,
976 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
977 (long) current_gdbarch
->regset_from_core_section
);
978 fprintf_unfiltered (file
,
979 "gdbarch_dump: remote_register_number = <0x%lx>\n",
980 (long) current_gdbarch
->remote_register_number
);
981 fprintf_unfiltered (file
,
982 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
983 gdbarch_return_value_p (current_gdbarch
));
984 fprintf_unfiltered (file
,
985 "gdbarch_dump: return_value = <0x%lx>\n",
986 (long) current_gdbarch
->return_value
);
987 fprintf_unfiltered (file
,
988 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
989 (long) current_gdbarch
->sdb_reg_to_regnum
);
990 fprintf_unfiltered (file
,
991 "gdbarch_dump: short_bit = %s\n",
992 paddr_d (current_gdbarch
->short_bit
));
993 fprintf_unfiltered (file
,
994 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
995 gdbarch_single_step_through_delay_p (current_gdbarch
));
996 fprintf_unfiltered (file
,
997 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
998 (long) current_gdbarch
->single_step_through_delay
);
999 fprintf_unfiltered (file
,
1000 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1001 gdbarch_skip_permanent_breakpoint_p (current_gdbarch
));
1002 fprintf_unfiltered (file
,
1003 "gdbarch_dump: skip_permanent_breakpoint = <0x%lx>\n",
1004 (long) current_gdbarch
->skip_permanent_breakpoint
);
1005 fprintf_unfiltered (file
,
1006 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1007 (long) current_gdbarch
->skip_prologue
);
1008 fprintf_unfiltered (file
,
1009 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1010 (long) current_gdbarch
->skip_solib_resolver
);
1011 fprintf_unfiltered (file
,
1012 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1013 (long) current_gdbarch
->skip_trampoline_code
);
1014 fprintf_unfiltered (file
,
1015 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1016 (long) current_gdbarch
->smash_text_address
);
1017 #ifdef SOFTWARE_SINGLE_STEP_P
1018 fprintf_unfiltered (file
,
1019 "gdbarch_dump: %s # %s\n",
1020 "SOFTWARE_SINGLE_STEP_P()",
1021 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1023 fprintf_unfiltered (file
,
1024 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1025 gdbarch_software_single_step_p (current_gdbarch
));
1026 #ifdef SOFTWARE_SINGLE_STEP
1027 fprintf_unfiltered (file
,
1028 "gdbarch_dump: %s # %s\n",
1029 "SOFTWARE_SINGLE_STEP(frame)",
1030 XSTRING (SOFTWARE_SINGLE_STEP (frame
)));
1032 fprintf_unfiltered (file
,
1033 "gdbarch_dump: software_single_step = <0x%lx>\n",
1034 (long) current_gdbarch
->software_single_step
);
1035 fprintf_unfiltered (file
,
1036 "gdbarch_dump: sp_regnum = %s\n",
1037 paddr_d (current_gdbarch
->sp_regnum
));
1038 fprintf_unfiltered (file
,
1039 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1040 (long) current_gdbarch
->stab_reg_to_regnum
);
1041 fprintf_unfiltered (file
,
1042 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1043 (long) current_gdbarch
->stabs_argument_has_addr
);
1044 #ifdef STORE_RETURN_VALUE
1045 fprintf_unfiltered (file
,
1046 "gdbarch_dump: %s # %s\n",
1047 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1048 XSTRING (STORE_RETURN_VALUE (type
, regcache
, valbuf
)));
1050 fprintf_unfiltered (file
,
1051 "gdbarch_dump: store_return_value = <0x%lx>\n",
1052 (long) current_gdbarch
->store_return_value
);
1053 fprintf_unfiltered (file
,
1054 "gdbarch_dump: target_desc = %s\n",
1055 paddr_d ((long) current_gdbarch
->target_desc
));
1056 fprintf_unfiltered (file
,
1057 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1058 gdbarch_unwind_dummy_id_p (current_gdbarch
));
1059 fprintf_unfiltered (file
,
1060 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1061 (long) current_gdbarch
->unwind_dummy_id
);
1062 fprintf_unfiltered (file
,
1063 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1064 gdbarch_unwind_pc_p (current_gdbarch
));
1065 fprintf_unfiltered (file
,
1066 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1067 (long) current_gdbarch
->unwind_pc
);
1068 fprintf_unfiltered (file
,
1069 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1070 gdbarch_unwind_sp_p (current_gdbarch
));
1071 fprintf_unfiltered (file
,
1072 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1073 (long) current_gdbarch
->unwind_sp
);
1074 fprintf_unfiltered (file
,
1075 "gdbarch_dump: value_from_register = <0x%lx>\n",
1076 (long) current_gdbarch
->value_from_register
);
1077 fprintf_unfiltered (file
,
1078 "gdbarch_dump: value_to_register = <0x%lx>\n",
1079 (long) current_gdbarch
->value_to_register
);
1080 fprintf_unfiltered (file
,
1081 "gdbarch_dump: vbit_in_delta = %s\n",
1082 paddr_d (current_gdbarch
->vbit_in_delta
));
1083 fprintf_unfiltered (file
,
1084 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1085 (long) current_gdbarch
->virtual_frame_pointer
);
1086 fprintf_unfiltered (file
,
1087 "gdbarch_dump: vtable_function_descriptors = %s\n",
1088 paddr_d (current_gdbarch
->vtable_function_descriptors
));
1089 fprintf_unfiltered (file
,
1090 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1091 gdbarch_write_pc_p (current_gdbarch
));
1092 fprintf_unfiltered (file
,
1093 "gdbarch_dump: write_pc = <0x%lx>\n",
1094 (long) current_gdbarch
->write_pc
);
1095 if (current_gdbarch
->dump_tdep
!= NULL
)
1096 current_gdbarch
->dump_tdep (current_gdbarch
, file
);
1099 struct gdbarch_tdep
*
1100 gdbarch_tdep (struct gdbarch
*gdbarch
)
1102 if (gdbarch_debug
>= 2)
1103 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1104 return gdbarch
->tdep
;
1108 const struct bfd_arch_info
*
1109 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1111 gdb_assert (gdbarch
!= NULL
);
1112 if (gdbarch_debug
>= 2)
1113 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1114 return gdbarch
->bfd_arch_info
;
1118 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1120 gdb_assert (gdbarch
!= NULL
);
1121 if (gdbarch_debug
>= 2)
1122 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1123 return gdbarch
->byte_order
;
1127 gdbarch_osabi (struct gdbarch
*gdbarch
)
1129 gdb_assert (gdbarch
!= NULL
);
1130 if (gdbarch_debug
>= 2)
1131 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1132 return gdbarch
->osabi
;
1135 const struct target_desc
*
1136 gdbarch_target_desc (struct gdbarch
*gdbarch
)
1138 gdb_assert (gdbarch
!= NULL
);
1139 if (gdbarch_debug
>= 2)
1140 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_desc called\n");
1141 return gdbarch
->target_desc
;
1145 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1147 gdb_assert (gdbarch
!= NULL
);
1148 /* Skip verify of short_bit, invalid_p == 0 */
1149 if (gdbarch_debug
>= 2)
1150 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1151 return gdbarch
->short_bit
;
1155 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1158 gdbarch
->short_bit
= short_bit
;
1162 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1164 gdb_assert (gdbarch
!= NULL
);
1165 /* Skip verify of int_bit, invalid_p == 0 */
1166 if (gdbarch_debug
>= 2)
1167 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1168 return gdbarch
->int_bit
;
1172 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1175 gdbarch
->int_bit
= int_bit
;
1179 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1181 gdb_assert (gdbarch
!= NULL
);
1182 /* Skip verify of long_bit, invalid_p == 0 */
1183 if (gdbarch_debug
>= 2)
1184 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1185 return gdbarch
->long_bit
;
1189 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1192 gdbarch
->long_bit
= long_bit
;
1196 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1198 gdb_assert (gdbarch
!= NULL
);
1199 /* Skip verify of long_long_bit, invalid_p == 0 */
1200 if (gdbarch_debug
>= 2)
1201 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1202 return gdbarch
->long_long_bit
;
1206 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1209 gdbarch
->long_long_bit
= long_long_bit
;
1213 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1215 gdb_assert (gdbarch
!= NULL
);
1216 /* Skip verify of float_bit, invalid_p == 0 */
1217 if (gdbarch_debug
>= 2)
1218 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1219 return gdbarch
->float_bit
;
1223 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1226 gdbarch
->float_bit
= float_bit
;
1229 const struct floatformat
**
1230 gdbarch_float_format (struct gdbarch
*gdbarch
)
1232 gdb_assert (gdbarch
!= NULL
);
1233 if (gdbarch_debug
>= 2)
1234 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
1235 return gdbarch
->float_format
;
1239 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
1240 const struct floatformat
** float_format
)
1242 gdbarch
->float_format
= float_format
;
1246 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1248 gdb_assert (gdbarch
!= NULL
);
1249 /* Skip verify of double_bit, invalid_p == 0 */
1250 if (gdbarch_debug
>= 2)
1251 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1252 return gdbarch
->double_bit
;
1256 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1259 gdbarch
->double_bit
= double_bit
;
1262 const struct floatformat
**
1263 gdbarch_double_format (struct gdbarch
*gdbarch
)
1265 gdb_assert (gdbarch
!= NULL
);
1266 if (gdbarch_debug
>= 2)
1267 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
1268 return gdbarch
->double_format
;
1272 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
1273 const struct floatformat
** double_format
)
1275 gdbarch
->double_format
= double_format
;
1279 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1281 gdb_assert (gdbarch
!= NULL
);
1282 /* Skip verify of long_double_bit, invalid_p == 0 */
1283 if (gdbarch_debug
>= 2)
1284 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1285 return gdbarch
->long_double_bit
;
1289 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1290 int long_double_bit
)
1292 gdbarch
->long_double_bit
= long_double_bit
;
1295 const struct floatformat
**
1296 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
1298 gdb_assert (gdbarch
!= NULL
);
1299 if (gdbarch_debug
>= 2)
1300 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
1301 return gdbarch
->long_double_format
;
1305 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
1306 const struct floatformat
** long_double_format
)
1308 gdbarch
->long_double_format
= long_double_format
;
1312 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1314 gdb_assert (gdbarch
!= NULL
);
1315 /* Skip verify of ptr_bit, invalid_p == 0 */
1316 if (gdbarch_debug
>= 2)
1317 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1318 return gdbarch
->ptr_bit
;
1322 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1325 gdbarch
->ptr_bit
= ptr_bit
;
1329 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1331 gdb_assert (gdbarch
!= NULL
);
1332 /* Check variable changed from pre-default. */
1333 gdb_assert (gdbarch
->addr_bit
!= 0);
1334 if (gdbarch_debug
>= 2)
1335 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1336 return gdbarch
->addr_bit
;
1340 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1343 gdbarch
->addr_bit
= addr_bit
;
1347 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1349 gdb_assert (gdbarch
!= NULL
);
1350 /* Check variable changed from pre-default. */
1351 gdb_assert (gdbarch
->char_signed
!= -1);
1352 if (gdbarch_debug
>= 2)
1353 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1354 return gdbarch
->char_signed
;
1358 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1361 gdbarch
->char_signed
= char_signed
;
1365 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1367 gdb_assert (gdbarch
!= NULL
);
1368 return gdbarch
->read_pc
!= NULL
;
1372 gdbarch_read_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
1374 gdb_assert (gdbarch
!= NULL
);
1375 gdb_assert (gdbarch
->read_pc
!= NULL
);
1376 if (gdbarch_debug
>= 2)
1377 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1378 return gdbarch
->read_pc (regcache
);
1382 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1383 gdbarch_read_pc_ftype read_pc
)
1385 gdbarch
->read_pc
= read_pc
;
1389 gdbarch_write_pc_p (struct gdbarch
*gdbarch
)
1391 gdb_assert (gdbarch
!= NULL
);
1392 return gdbarch
->write_pc
!= NULL
;
1396 gdbarch_write_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR val
)
1398 gdb_assert (gdbarch
!= NULL
);
1399 gdb_assert (gdbarch
->write_pc
!= NULL
);
1400 if (gdbarch_debug
>= 2)
1401 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1402 gdbarch
->write_pc (regcache
, val
);
1406 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1407 gdbarch_write_pc_ftype write_pc
)
1409 gdbarch
->write_pc
= write_pc
;
1413 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1415 gdb_assert (gdbarch
!= NULL
);
1416 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1417 if (gdbarch_debug
>= 2)
1418 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1419 gdbarch
->virtual_frame_pointer (pc
, frame_regnum
, frame_offset
);
1423 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1424 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1426 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1430 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1432 gdb_assert (gdbarch
!= NULL
);
1433 return gdbarch
->pseudo_register_read
!= NULL
;
1437 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, gdb_byte
*buf
)
1439 gdb_assert (gdbarch
!= NULL
);
1440 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
1441 if (gdbarch_debug
>= 2)
1442 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
1443 gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
1447 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
1448 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
1450 gdbarch
->pseudo_register_read
= pseudo_register_read
;
1454 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
1456 gdb_assert (gdbarch
!= NULL
);
1457 return gdbarch
->pseudo_register_write
!= NULL
;
1461 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const gdb_byte
*buf
)
1463 gdb_assert (gdbarch
!= NULL
);
1464 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
1465 if (gdbarch_debug
>= 2)
1466 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
1467 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
1471 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
1472 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
1474 gdbarch
->pseudo_register_write
= pseudo_register_write
;
1478 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1480 gdb_assert (gdbarch
!= NULL
);
1481 /* Check variable changed from pre-default. */
1482 gdb_assert (gdbarch
->num_regs
!= -1);
1483 if (gdbarch_debug
>= 2)
1484 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1485 return gdbarch
->num_regs
;
1489 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1492 gdbarch
->num_regs
= num_regs
;
1496 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
1498 gdb_assert (gdbarch
!= NULL
);
1499 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1500 if (gdbarch_debug
>= 2)
1501 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
1502 return gdbarch
->num_pseudo_regs
;
1506 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
1507 int num_pseudo_regs
)
1509 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
1513 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1515 gdb_assert (gdbarch
!= NULL
);
1516 /* Skip verify of sp_regnum, invalid_p == 0 */
1517 if (gdbarch_debug
>= 2)
1518 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1519 return gdbarch
->sp_regnum
;
1523 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1526 gdbarch
->sp_regnum
= sp_regnum
;
1530 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1532 gdb_assert (gdbarch
!= NULL
);
1533 /* Skip verify of pc_regnum, invalid_p == 0 */
1534 if (gdbarch_debug
>= 2)
1535 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1536 return gdbarch
->pc_regnum
;
1540 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1543 gdbarch
->pc_regnum
= pc_regnum
;
1547 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
1549 gdb_assert (gdbarch
!= NULL
);
1550 /* Skip verify of ps_regnum, invalid_p == 0 */
1551 if (gdbarch_debug
>= 2)
1552 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
1553 return gdbarch
->ps_regnum
;
1557 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
1560 gdbarch
->ps_regnum
= ps_regnum
;
1564 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
1566 gdb_assert (gdbarch
!= NULL
);
1567 /* Skip verify of fp0_regnum, invalid_p == 0 */
1568 if (gdbarch_debug
>= 2)
1569 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
1570 return gdbarch
->fp0_regnum
;
1574 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
1577 gdbarch
->fp0_regnum
= fp0_regnum
;
1581 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
1583 gdb_assert (gdbarch
!= NULL
);
1584 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
1585 if (gdbarch_debug
>= 2)
1586 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
1587 return gdbarch
->stab_reg_to_regnum (stab_regnr
);
1591 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
1592 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
1594 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
1598 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
1600 gdb_assert (gdbarch
!= NULL
);
1601 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
1602 if (gdbarch_debug
>= 2)
1603 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
1604 return gdbarch
->ecoff_reg_to_regnum (ecoff_regnr
);
1608 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
1609 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
1611 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
1615 gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf_regnr
)
1617 gdb_assert (gdbarch
!= NULL
);
1618 gdb_assert (gdbarch
->dwarf_reg_to_regnum
!= NULL
);
1619 if (gdbarch_debug
>= 2)
1620 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf_reg_to_regnum called\n");
1621 return gdbarch
->dwarf_reg_to_regnum (dwarf_regnr
);
1625 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
,
1626 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum
)
1628 gdbarch
->dwarf_reg_to_regnum
= dwarf_reg_to_regnum
;
1632 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
1634 gdb_assert (gdbarch
!= NULL
);
1635 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
1636 if (gdbarch_debug
>= 2)
1637 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
1638 return gdbarch
->sdb_reg_to_regnum (sdb_regnr
);
1642 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
1643 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
1645 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
1649 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
1651 gdb_assert (gdbarch
!= NULL
);
1652 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
1653 if (gdbarch_debug
>= 2)
1654 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
1655 return gdbarch
->dwarf2_reg_to_regnum (dwarf2_regnr
);
1659 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
1660 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
1662 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
1666 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1668 gdb_assert (gdbarch
!= NULL
);
1669 gdb_assert (gdbarch
->register_name
!= NULL
);
1670 if (gdbarch_debug
>= 2)
1671 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1672 return gdbarch
->register_name (regnr
);
1676 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1677 gdbarch_register_name_ftype register_name
)
1679 gdbarch
->register_name
= register_name
;
1683 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
1685 gdb_assert (gdbarch
!= NULL
);
1686 return gdbarch
->register_type
!= NULL
;
1690 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
1692 gdb_assert (gdbarch
!= NULL
);
1693 gdb_assert (gdbarch
->register_type
!= NULL
);
1694 if (gdbarch_debug
>= 2)
1695 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
1696 return gdbarch
->register_type (gdbarch
, reg_nr
);
1700 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
1701 gdbarch_register_type_ftype register_type
)
1703 gdbarch
->register_type
= register_type
;
1707 gdbarch_unwind_dummy_id_p (struct gdbarch
*gdbarch
)
1709 gdb_assert (gdbarch
!= NULL
);
1710 return gdbarch
->unwind_dummy_id
!= NULL
;
1714 gdbarch_unwind_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*info
)
1716 gdb_assert (gdbarch
!= NULL
);
1717 gdb_assert (gdbarch
->unwind_dummy_id
!= NULL
);
1718 if (gdbarch_debug
>= 2)
1719 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_dummy_id called\n");
1720 return gdbarch
->unwind_dummy_id (gdbarch
, info
);
1724 set_gdbarch_unwind_dummy_id (struct gdbarch
*gdbarch
,
1725 gdbarch_unwind_dummy_id_ftype unwind_dummy_id
)
1727 gdbarch
->unwind_dummy_id
= unwind_dummy_id
;
1731 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
1733 gdb_assert (gdbarch
!= NULL
);
1734 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1735 if (gdbarch_debug
>= 2)
1736 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
1737 return gdbarch
->deprecated_fp_regnum
;
1741 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
1742 int deprecated_fp_regnum
)
1744 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
1748 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
1750 gdb_assert (gdbarch
!= NULL
);
1751 return gdbarch
->push_dummy_call
!= NULL
;
1755 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
)
1757 gdb_assert (gdbarch
!= NULL
);
1758 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
1759 if (gdbarch_debug
>= 2)
1760 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
1761 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
1765 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
1766 gdbarch_push_dummy_call_ftype push_dummy_call
)
1768 gdbarch
->push_dummy_call
= push_dummy_call
;
1772 gdbarch_deprecated_register_size (struct gdbarch
*gdbarch
)
1774 gdb_assert (gdbarch
!= NULL
);
1775 if (gdbarch_debug
>= 2)
1776 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_register_size called\n");
1777 return gdbarch
->deprecated_register_size
;
1781 set_gdbarch_deprecated_register_size (struct gdbarch
*gdbarch
,
1782 int deprecated_register_size
)
1784 gdbarch
->deprecated_register_size
= deprecated_register_size
;
1788 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1790 gdb_assert (gdbarch
!= NULL
);
1791 /* Skip verify of call_dummy_location, invalid_p == 0 */
1792 if (gdbarch_debug
>= 2)
1793 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1794 return gdbarch
->call_dummy_location
;
1798 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1799 int call_dummy_location
)
1801 gdbarch
->call_dummy_location
= call_dummy_location
;
1805 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
1807 gdb_assert (gdbarch
!= NULL
);
1808 return gdbarch
->push_dummy_code
!= NULL
;
1812 gdbarch_push_dummy_code (struct gdbarch
*gdbarch
, CORE_ADDR sp
, CORE_ADDR funaddr
, int using_gcc
, struct value
**args
, int nargs
, struct type
*value_type
, CORE_ADDR
*real_pc
, CORE_ADDR
*bp_addr
, struct regcache
*regcache
)
1814 gdb_assert (gdbarch
!= NULL
);
1815 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
1816 if (gdbarch_debug
>= 2)
1817 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
1818 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, using_gcc
, args
, nargs
, value_type
, real_pc
, bp_addr
, regcache
);
1822 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
1823 gdbarch_push_dummy_code_ftype push_dummy_code
)
1825 gdbarch
->push_dummy_code
= push_dummy_code
;
1829 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
1831 gdb_assert (gdbarch
!= NULL
);
1832 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
1833 if (gdbarch_debug
>= 2)
1834 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
1835 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
1839 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
1840 gdbarch_print_registers_info_ftype print_registers_info
)
1842 gdbarch
->print_registers_info
= print_registers_info
;
1846 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
1848 gdb_assert (gdbarch
!= NULL
);
1849 return gdbarch
->print_float_info
!= NULL
;
1853 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
1855 gdb_assert (gdbarch
!= NULL
);
1856 gdb_assert (gdbarch
->print_float_info
!= NULL
);
1857 if (gdbarch_debug
>= 2)
1858 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
1859 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
1863 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
1864 gdbarch_print_float_info_ftype print_float_info
)
1866 gdbarch
->print_float_info
= print_float_info
;
1870 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
1872 gdb_assert (gdbarch
!= NULL
);
1873 return gdbarch
->print_vector_info
!= NULL
;
1877 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
1879 gdb_assert (gdbarch
!= NULL
);
1880 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
1881 if (gdbarch_debug
>= 2)
1882 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
1883 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
1887 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
1888 gdbarch_print_vector_info_ftype print_vector_info
)
1890 gdbarch
->print_vector_info
= print_vector_info
;
1894 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
1896 gdb_assert (gdbarch
!= NULL
);
1897 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
1898 if (gdbarch_debug
>= 2)
1899 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
1900 return gdbarch
->register_sim_regno (reg_nr
);
1904 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
1905 gdbarch_register_sim_regno_ftype register_sim_regno
)
1907 gdbarch
->register_sim_regno
= register_sim_regno
;
1911 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
1913 gdb_assert (gdbarch
!= NULL
);
1914 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
1915 if (gdbarch_debug
>= 2)
1916 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
1917 return gdbarch
->cannot_fetch_register (regnum
);
1921 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
1922 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
1924 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
1928 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
1930 gdb_assert (gdbarch
!= NULL
);
1931 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
1932 if (gdbarch_debug
>= 2)
1933 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
1934 return gdbarch
->cannot_store_register (regnum
);
1938 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
1939 gdbarch_cannot_store_register_ftype cannot_store_register
)
1941 gdbarch
->cannot_store_register
= cannot_store_register
;
1945 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
1947 gdb_assert (gdbarch
!= NULL
);
1948 return gdbarch
->get_longjmp_target
!= NULL
;
1952 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR
*pc
)
1954 gdb_assert (gdbarch
!= NULL
);
1955 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
1956 if (gdbarch_debug
>= 2)
1957 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
1958 return gdbarch
->get_longjmp_target (frame
, pc
);
1962 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
1963 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
1965 gdbarch
->get_longjmp_target
= get_longjmp_target
;
1969 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
1971 gdb_assert (gdbarch
!= NULL
);
1972 if (gdbarch_debug
>= 2)
1973 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
1974 return gdbarch
->believe_pcc_promotion
;
1978 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
1979 int believe_pcc_promotion
)
1981 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
1985 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
1987 gdb_assert (gdbarch
!= NULL
);
1988 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
1989 if (gdbarch_debug
>= 2)
1990 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
1991 return gdbarch
->convert_register_p (regnum
, type
);
1995 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
1996 gdbarch_convert_register_p_ftype convert_register_p
)
1998 gdbarch
->convert_register_p
= convert_register_p
;
2002 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, gdb_byte
*buf
)
2004 gdb_assert (gdbarch
!= NULL
);
2005 gdb_assert (gdbarch
->register_to_value
!= NULL
);
2006 if (gdbarch_debug
>= 2)
2007 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2008 gdbarch
->register_to_value (frame
, regnum
, type
, buf
);
2012 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2013 gdbarch_register_to_value_ftype register_to_value
)
2015 gdbarch
->register_to_value
= register_to_value
;
2019 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const gdb_byte
*buf
)
2021 gdb_assert (gdbarch
!= NULL
);
2022 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2023 if (gdbarch_debug
>= 2)
2024 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2025 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2029 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2030 gdbarch_value_to_register_ftype value_to_register
)
2032 gdbarch
->value_to_register
= value_to_register
;
2036 gdbarch_value_from_register (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, struct frame_info
*frame
)
2038 gdb_assert (gdbarch
!= NULL
);
2039 gdb_assert (gdbarch
->value_from_register
!= NULL
);
2040 if (gdbarch_debug
>= 2)
2041 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_from_register called\n");
2042 return gdbarch
->value_from_register (type
, regnum
, frame
);
2046 set_gdbarch_value_from_register (struct gdbarch
*gdbarch
,
2047 gdbarch_value_from_register_ftype value_from_register
)
2049 gdbarch
->value_from_register
= value_from_register
;
2053 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2055 gdb_assert (gdbarch
!= NULL
);
2056 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2057 if (gdbarch_debug
>= 2)
2058 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2059 return gdbarch
->pointer_to_address (type
, buf
);
2063 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2064 gdbarch_pointer_to_address_ftype pointer_to_address
)
2066 gdbarch
->pointer_to_address
= pointer_to_address
;
2070 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*buf
, CORE_ADDR addr
)
2072 gdb_assert (gdbarch
!= NULL
);
2073 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2074 if (gdbarch_debug
>= 2)
2075 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2076 gdbarch
->address_to_pointer (type
, buf
, addr
);
2080 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2081 gdbarch_address_to_pointer_ftype address_to_pointer
)
2083 gdbarch
->address_to_pointer
= address_to_pointer
;
2087 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2089 gdb_assert (gdbarch
!= NULL
);
2090 return gdbarch
->integer_to_address
!= NULL
;
2094 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2096 gdb_assert (gdbarch
!= NULL
);
2097 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2098 if (gdbarch_debug
>= 2)
2099 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2100 return gdbarch
->integer_to_address (gdbarch
, type
, buf
);
2104 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2105 gdbarch_integer_to_address_ftype integer_to_address
)
2107 gdbarch
->integer_to_address
= integer_to_address
;
2111 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2113 gdb_assert (gdbarch
!= NULL
);
2114 return gdbarch
->return_value
!= legacy_return_value
;
2117 enum return_value_convention
2118 gdbarch_return_value (struct gdbarch
*gdbarch
, struct type
*valtype
, struct regcache
*regcache
, gdb_byte
*readbuf
, const gdb_byte
*writebuf
)
2120 gdb_assert (gdbarch
!= NULL
);
2121 gdb_assert (gdbarch
->return_value
!= NULL
);
2122 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2123 if (gdbarch_debug
>= 2)
2124 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2125 return gdbarch
->return_value (gdbarch
, valtype
, regcache
, readbuf
, writebuf
);
2129 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2130 gdbarch_return_value_ftype return_value
)
2132 gdbarch
->return_value
= return_value
;
2136 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, struct regcache
*regcache
, gdb_byte
*valbuf
)
2138 gdb_assert (gdbarch
!= NULL
);
2139 gdb_assert (gdbarch
->extract_return_value
!= NULL
);
2140 if (gdbarch_debug
>= 2)
2141 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
2142 gdbarch
->extract_return_value (type
, regcache
, valbuf
);
2146 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
2147 gdbarch_extract_return_value_ftype extract_return_value
)
2149 gdbarch
->extract_return_value
= extract_return_value
;
2153 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, struct regcache
*regcache
, const gdb_byte
*valbuf
)
2155 gdb_assert (gdbarch
!= NULL
);
2156 gdb_assert (gdbarch
->store_return_value
!= NULL
);
2157 if (gdbarch_debug
>= 2)
2158 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2159 gdbarch
->store_return_value (type
, regcache
, valbuf
);
2163 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2164 gdbarch_store_return_value_ftype store_return_value
)
2166 gdbarch
->store_return_value
= store_return_value
;
2170 gdbarch_deprecated_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2172 gdb_assert (gdbarch
!= NULL
);
2173 gdb_assert (gdbarch
->deprecated_use_struct_convention
!= NULL
);
2174 if (gdbarch_debug
>= 2)
2175 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_use_struct_convention called\n");
2176 return gdbarch
->deprecated_use_struct_convention (gcc_p
, value_type
);
2180 set_gdbarch_deprecated_use_struct_convention (struct gdbarch
*gdbarch
,
2181 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention
)
2183 gdbarch
->deprecated_use_struct_convention
= deprecated_use_struct_convention
;
2187 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2189 gdb_assert (gdbarch
!= NULL
);
2190 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2191 if (gdbarch_debug
>= 2)
2192 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2193 return gdbarch
->skip_prologue (ip
);
2197 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2198 gdbarch_skip_prologue_ftype skip_prologue
)
2200 gdbarch
->skip_prologue
= skip_prologue
;
2204 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2206 gdb_assert (gdbarch
!= NULL
);
2207 gdb_assert (gdbarch
->inner_than
!= NULL
);
2208 if (gdbarch_debug
>= 2)
2209 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2210 return gdbarch
->inner_than (lhs
, rhs
);
2214 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2215 gdbarch_inner_than_ftype inner_than
)
2217 gdbarch
->inner_than
= inner_than
;
2221 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2223 gdb_assert (gdbarch
!= NULL
);
2224 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2225 if (gdbarch_debug
>= 2)
2226 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2227 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2231 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2232 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2234 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2238 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2240 gdb_assert (gdbarch
!= NULL
);
2241 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2245 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2247 gdb_assert (gdbarch
!= NULL
);
2248 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2249 if (gdbarch_debug
>= 2)
2250 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2251 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2255 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2256 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2258 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2262 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2264 gdb_assert (gdbarch
!= NULL
);
2265 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2266 if (gdbarch_debug
>= 2)
2267 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2268 return gdbarch
->memory_insert_breakpoint (bp_tgt
);
2272 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2273 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2275 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2279 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2281 gdb_assert (gdbarch
!= NULL
);
2282 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2283 if (gdbarch_debug
>= 2)
2284 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2285 return gdbarch
->memory_remove_breakpoint (bp_tgt
);
2289 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2290 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2292 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2296 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2298 gdb_assert (gdbarch
!= NULL
);
2299 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2300 if (gdbarch_debug
>= 2)
2301 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2302 return gdbarch
->decr_pc_after_break
;
2306 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2307 CORE_ADDR decr_pc_after_break
)
2309 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2313 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
2315 gdb_assert (gdbarch
!= NULL
);
2316 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2317 if (gdbarch_debug
>= 2)
2318 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
2319 return gdbarch
->deprecated_function_start_offset
;
2323 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
2324 CORE_ADDR deprecated_function_start_offset
)
2326 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
2330 gdbarch_remote_register_number (struct gdbarch
*gdbarch
, int regno
)
2332 gdb_assert (gdbarch
!= NULL
);
2333 gdb_assert (gdbarch
->remote_register_number
!= NULL
);
2334 if (gdbarch_debug
>= 2)
2335 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_register_number called\n");
2336 return gdbarch
->remote_register_number (gdbarch
, regno
);
2340 set_gdbarch_remote_register_number (struct gdbarch
*gdbarch
,
2341 gdbarch_remote_register_number_ftype remote_register_number
)
2343 gdbarch
->remote_register_number
= remote_register_number
;
2347 gdbarch_fetch_tls_load_module_address_p (struct gdbarch
*gdbarch
)
2349 gdb_assert (gdbarch
!= NULL
);
2350 return gdbarch
->fetch_tls_load_module_address
!= NULL
;
2354 gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
, struct objfile
*objfile
)
2356 gdb_assert (gdbarch
!= NULL
);
2357 gdb_assert (gdbarch
->fetch_tls_load_module_address
!= NULL
);
2358 if (gdbarch_debug
>= 2)
2359 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_tls_load_module_address called\n");
2360 return gdbarch
->fetch_tls_load_module_address (objfile
);
2364 set_gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
,
2365 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address
)
2367 gdbarch
->fetch_tls_load_module_address
= fetch_tls_load_module_address
;
2371 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2373 gdb_assert (gdbarch
!= NULL
);
2374 /* Skip verify of frame_args_skip, invalid_p == 0 */
2375 if (gdbarch_debug
>= 2)
2376 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2377 return gdbarch
->frame_args_skip
;
2381 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2382 CORE_ADDR frame_args_skip
)
2384 gdbarch
->frame_args_skip
= frame_args_skip
;
2388 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
2390 gdb_assert (gdbarch
!= NULL
);
2391 return gdbarch
->unwind_pc
!= NULL
;
2395 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2397 gdb_assert (gdbarch
!= NULL
);
2398 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
2399 if (gdbarch_debug
>= 2)
2400 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
2401 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
2405 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
2406 gdbarch_unwind_pc_ftype unwind_pc
)
2408 gdbarch
->unwind_pc
= unwind_pc
;
2412 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
2414 gdb_assert (gdbarch
!= NULL
);
2415 return gdbarch
->unwind_sp
!= NULL
;
2419 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2421 gdb_assert (gdbarch
!= NULL
);
2422 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
2423 if (gdbarch_debug
>= 2)
2424 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
2425 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
2429 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
2430 gdbarch_unwind_sp_ftype unwind_sp
)
2432 gdbarch
->unwind_sp
= unwind_sp
;
2436 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
2438 gdb_assert (gdbarch
!= NULL
);
2439 return gdbarch
->frame_num_args
!= NULL
;
2443 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2445 gdb_assert (gdbarch
!= NULL
);
2446 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
2447 if (gdbarch_debug
>= 2)
2448 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2449 return gdbarch
->frame_num_args (frame
);
2453 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2454 gdbarch_frame_num_args_ftype frame_num_args
)
2456 gdbarch
->frame_num_args
= frame_num_args
;
2460 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
2462 gdb_assert (gdbarch
!= NULL
);
2463 return gdbarch
->frame_align
!= NULL
;
2467 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
2469 gdb_assert (gdbarch
!= NULL
);
2470 gdb_assert (gdbarch
->frame_align
!= NULL
);
2471 if (gdbarch_debug
>= 2)
2472 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
2473 return gdbarch
->frame_align (gdbarch
, address
);
2477 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
2478 gdbarch_frame_align_ftype frame_align
)
2480 gdbarch
->frame_align
= frame_align
;
2484 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch
*gdbarch
)
2486 gdb_assert (gdbarch
!= NULL
);
2487 return gdbarch
->deprecated_reg_struct_has_addr
!= NULL
;
2491 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*type
)
2493 gdb_assert (gdbarch
!= NULL
);
2494 gdb_assert (gdbarch
->deprecated_reg_struct_has_addr
!= NULL
);
2495 if (gdbarch_debug
>= 2)
2496 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_reg_struct_has_addr called\n");
2497 return gdbarch
->deprecated_reg_struct_has_addr (gcc_p
, type
);
2501 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch
*gdbarch
,
2502 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr
)
2504 gdbarch
->deprecated_reg_struct_has_addr
= deprecated_reg_struct_has_addr
;
2508 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
2510 gdb_assert (gdbarch
!= NULL
);
2511 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
2512 if (gdbarch_debug
>= 2)
2513 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
2514 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
2518 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
2519 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
2521 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
2525 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
2527 gdb_assert (gdbarch
!= NULL
);
2528 if (gdbarch_debug
>= 2)
2529 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
2530 return gdbarch
->frame_red_zone_size
;
2534 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
2535 int frame_red_zone_size
)
2537 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
2541 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
2543 gdb_assert (gdbarch
!= NULL
);
2544 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
2545 if (gdbarch_debug
>= 2)
2546 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
2547 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
2551 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
2552 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
2554 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
2558 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2560 gdb_assert (gdbarch
!= NULL
);
2561 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
2562 if (gdbarch_debug
>= 2)
2563 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
2564 return gdbarch
->addr_bits_remove (addr
);
2568 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
2569 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
2571 gdbarch
->addr_bits_remove
= addr_bits_remove
;
2575 gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2577 gdb_assert (gdbarch
!= NULL
);
2578 gdb_assert (gdbarch
->smash_text_address
!= NULL
);
2579 if (gdbarch_debug
>= 2)
2580 fprintf_unfiltered (gdb_stdlog
, "gdbarch_smash_text_address called\n");
2581 return gdbarch
->smash_text_address (addr
);
2585 set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
,
2586 gdbarch_smash_text_address_ftype smash_text_address
)
2588 gdbarch
->smash_text_address
= smash_text_address
;
2592 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
2594 gdb_assert (gdbarch
!= NULL
);
2595 return gdbarch
->software_single_step
!= NULL
;
2599 gdbarch_software_single_step (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2601 gdb_assert (gdbarch
!= NULL
);
2602 gdb_assert (gdbarch
->software_single_step
!= NULL
);
2603 if (gdbarch_debug
>= 2)
2604 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
2605 return gdbarch
->software_single_step (frame
);
2609 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
2610 gdbarch_software_single_step_ftype software_single_step
)
2612 gdbarch
->software_single_step
= software_single_step
;
2616 gdbarch_single_step_through_delay_p (struct gdbarch
*gdbarch
)
2618 gdb_assert (gdbarch
!= NULL
);
2619 return gdbarch
->single_step_through_delay
!= NULL
;
2623 gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2625 gdb_assert (gdbarch
!= NULL
);
2626 gdb_assert (gdbarch
->single_step_through_delay
!= NULL
);
2627 if (gdbarch_debug
>= 2)
2628 fprintf_unfiltered (gdb_stdlog
, "gdbarch_single_step_through_delay called\n");
2629 return gdbarch
->single_step_through_delay (gdbarch
, frame
);
2633 set_gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
,
2634 gdbarch_single_step_through_delay_ftype single_step_through_delay
)
2636 gdbarch
->single_step_through_delay
= single_step_through_delay
;
2640 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
2642 gdb_assert (gdbarch
!= NULL
);
2643 gdb_assert (gdbarch
->print_insn
!= NULL
);
2644 if (gdbarch_debug
>= 2)
2645 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
2646 return gdbarch
->print_insn (vma
, info
);
2650 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
2651 gdbarch_print_insn_ftype print_insn
)
2653 gdbarch
->print_insn
= print_insn
;
2657 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR pc
)
2659 gdb_assert (gdbarch
!= NULL
);
2660 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
2661 if (gdbarch_debug
>= 2)
2662 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
2663 return gdbarch
->skip_trampoline_code (frame
, pc
);
2667 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
2668 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
2670 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
2674 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
2676 gdb_assert (gdbarch
!= NULL
);
2677 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
2678 if (gdbarch_debug
>= 2)
2679 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
2680 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
2684 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
2685 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
2687 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
2691 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
)
2693 gdb_assert (gdbarch
!= NULL
);
2694 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
2695 if (gdbarch_debug
>= 2)
2696 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
2697 return gdbarch
->in_solib_return_trampoline (pc
, name
);
2701 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
2702 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
2704 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
2708 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2710 gdb_assert (gdbarch
!= NULL
);
2711 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
2712 if (gdbarch_debug
>= 2)
2713 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
2714 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
2718 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
2719 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
2721 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
2725 gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
, int argc
, char **argv
)
2727 gdb_assert (gdbarch
!= NULL
);
2728 gdb_assert (gdbarch
->construct_inferior_arguments
!= NULL
);
2729 if (gdbarch_debug
>= 2)
2730 fprintf_unfiltered (gdb_stdlog
, "gdbarch_construct_inferior_arguments called\n");
2731 return gdbarch
->construct_inferior_arguments (gdbarch
, argc
, argv
);
2735 set_gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
,
2736 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments
)
2738 gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
2742 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
2744 gdb_assert (gdbarch
!= NULL
);
2745 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
2746 if (gdbarch_debug
>= 2)
2747 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
2748 gdbarch
->elf_make_msymbol_special (sym
, msym
);
2752 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
2753 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
2755 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
2759 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
2761 gdb_assert (gdbarch
!= NULL
);
2762 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
2763 if (gdbarch_debug
>= 2)
2764 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
2765 gdbarch
->coff_make_msymbol_special (val
, msym
);
2769 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
2770 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
2772 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
2776 gdbarch_name_of_malloc (struct gdbarch
*gdbarch
)
2778 gdb_assert (gdbarch
!= NULL
);
2779 /* Skip verify of name_of_malloc, invalid_p == 0 */
2780 if (gdbarch_debug
>= 2)
2781 fprintf_unfiltered (gdb_stdlog
, "gdbarch_name_of_malloc called\n");
2782 return gdbarch
->name_of_malloc
;
2786 set_gdbarch_name_of_malloc (struct gdbarch
*gdbarch
,
2787 const char * name_of_malloc
)
2789 gdbarch
->name_of_malloc
= name_of_malloc
;
2793 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
2795 gdb_assert (gdbarch
!= NULL
);
2796 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2797 if (gdbarch_debug
>= 2)
2798 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
2799 return gdbarch
->cannot_step_breakpoint
;
2803 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
2804 int cannot_step_breakpoint
)
2806 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
2810 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
2812 gdb_assert (gdbarch
!= NULL
);
2813 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2814 if (gdbarch_debug
>= 2)
2815 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
2816 return gdbarch
->have_nonsteppable_watchpoint
;
2820 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
2821 int have_nonsteppable_watchpoint
)
2823 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
2827 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
2829 gdb_assert (gdbarch
!= NULL
);
2830 return gdbarch
->address_class_type_flags
!= NULL
;
2834 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
2836 gdb_assert (gdbarch
!= NULL
);
2837 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
2838 if (gdbarch_debug
>= 2)
2839 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
2840 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
2844 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
2845 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
2847 gdbarch
->address_class_type_flags
= address_class_type_flags
;
2851 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
2853 gdb_assert (gdbarch
!= NULL
);
2854 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
2858 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
2860 gdb_assert (gdbarch
!= NULL
);
2861 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
2862 if (gdbarch_debug
>= 2)
2863 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
2864 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
2868 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
2869 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
2871 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
2875 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
2877 gdb_assert (gdbarch
!= NULL
);
2878 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
2882 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
2884 gdb_assert (gdbarch
!= NULL
);
2885 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
2886 if (gdbarch_debug
>= 2)
2887 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
2888 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
2892 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
2893 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
2895 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
2899 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
2901 gdb_assert (gdbarch
!= NULL
);
2902 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
2903 if (gdbarch_debug
>= 2)
2904 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
2905 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
2909 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
2910 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
2912 gdbarch
->register_reggroup_p
= register_reggroup_p
;
2916 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
2918 gdb_assert (gdbarch
!= NULL
);
2919 return gdbarch
->fetch_pointer_argument
!= NULL
;
2923 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
2925 gdb_assert (gdbarch
!= NULL
);
2926 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
2927 if (gdbarch_debug
>= 2)
2928 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
2929 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
2933 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
2934 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
2936 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
2940 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
2942 gdb_assert (gdbarch
!= NULL
);
2943 return gdbarch
->regset_from_core_section
!= NULL
;
2946 const struct regset
*
2947 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
2949 gdb_assert (gdbarch
!= NULL
);
2950 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
2951 if (gdbarch_debug
>= 2)
2952 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
2953 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
2957 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
2958 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
2960 gdbarch
->regset_from_core_section
= regset_from_core_section
;
2964 gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
)
2966 gdb_assert (gdbarch
!= NULL
);
2967 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
2968 if (gdbarch_debug
>= 2)
2969 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vtable_function_descriptors called\n");
2970 return gdbarch
->vtable_function_descriptors
;
2974 set_gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
,
2975 int vtable_function_descriptors
)
2977 gdbarch
->vtable_function_descriptors
= vtable_function_descriptors
;
2981 gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
)
2983 gdb_assert (gdbarch
!= NULL
);
2984 /* Skip verify of vbit_in_delta, invalid_p == 0 */
2985 if (gdbarch_debug
>= 2)
2986 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vbit_in_delta called\n");
2987 return gdbarch
->vbit_in_delta
;
2991 set_gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
,
2994 gdbarch
->vbit_in_delta
= vbit_in_delta
;
2998 gdbarch_skip_permanent_breakpoint_p (struct gdbarch
*gdbarch
)
3000 gdb_assert (gdbarch
!= NULL
);
3001 return gdbarch
->skip_permanent_breakpoint
!= NULL
;
3005 gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
3007 gdb_assert (gdbarch
!= NULL
);
3008 gdb_assert (gdbarch
->skip_permanent_breakpoint
!= NULL
);
3009 if (gdbarch_debug
>= 2)
3010 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_permanent_breakpoint called\n");
3011 gdbarch
->skip_permanent_breakpoint (regcache
);
3015 set_gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
,
3016 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint
)
3018 gdbarch
->skip_permanent_breakpoint
= skip_permanent_breakpoint
;
3022 gdbarch_overlay_update_p (struct gdbarch
*gdbarch
)
3024 gdb_assert (gdbarch
!= NULL
);
3025 return gdbarch
->overlay_update
!= NULL
;
3029 gdbarch_overlay_update (struct gdbarch
*gdbarch
, struct obj_section
*osect
)
3031 gdb_assert (gdbarch
!= NULL
);
3032 gdb_assert (gdbarch
->overlay_update
!= NULL
);
3033 if (gdbarch_debug
>= 2)
3034 fprintf_unfiltered (gdb_stdlog
, "gdbarch_overlay_update called\n");
3035 gdbarch
->overlay_update (osect
);
3039 set_gdbarch_overlay_update (struct gdbarch
*gdbarch
,
3040 gdbarch_overlay_update_ftype overlay_update
)
3042 gdbarch
->overlay_update
= overlay_update
;
3046 /* Keep a registry of per-architecture data-pointers required by GDB
3053 gdbarch_data_pre_init_ftype
*pre_init
;
3054 gdbarch_data_post_init_ftype
*post_init
;
3057 struct gdbarch_data_registration
3059 struct gdbarch_data
*data
;
3060 struct gdbarch_data_registration
*next
;
3063 struct gdbarch_data_registry
3066 struct gdbarch_data_registration
*registrations
;
3069 struct gdbarch_data_registry gdbarch_data_registry
=
3074 static struct gdbarch_data
*
3075 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
3076 gdbarch_data_post_init_ftype
*post_init
)
3078 struct gdbarch_data_registration
**curr
;
3079 /* Append the new registraration. */
3080 for (curr
= &gdbarch_data_registry
.registrations
;
3082 curr
= &(*curr
)->next
);
3083 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
3084 (*curr
)->next
= NULL
;
3085 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
3086 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
3087 (*curr
)->data
->pre_init
= pre_init
;
3088 (*curr
)->data
->post_init
= post_init
;
3089 (*curr
)->data
->init_p
= 1;
3090 return (*curr
)->data
;
3093 struct gdbarch_data
*
3094 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
3096 return gdbarch_data_register (pre_init
, NULL
);
3099 struct gdbarch_data
*
3100 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
3102 return gdbarch_data_register (NULL
, post_init
);
3105 /* Create/delete the gdbarch data vector. */
3108 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
3110 gdb_assert (gdbarch
->data
== NULL
);
3111 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
3112 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
3115 /* Initialize the current value of the specified per-architecture
3119 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
3120 struct gdbarch_data
*data
,
3123 gdb_assert (data
->index
< gdbarch
->nr_data
);
3124 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
3125 gdb_assert (data
->pre_init
== NULL
);
3126 gdbarch
->data
[data
->index
] = pointer
;
3129 /* Return the current value of the specified per-architecture
3133 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
3135 gdb_assert (data
->index
< gdbarch
->nr_data
);
3136 if (gdbarch
->data
[data
->index
] == NULL
)
3138 /* The data-pointer isn't initialized, call init() to get a
3140 if (data
->pre_init
!= NULL
)
3141 /* Mid architecture creation: pass just the obstack, and not
3142 the entire architecture, as that way it isn't possible for
3143 pre-init code to refer to undefined architecture
3145 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
3146 else if (gdbarch
->initialized_p
3147 && data
->post_init
!= NULL
)
3148 /* Post architecture creation: pass the entire architecture
3149 (as all fields are valid), but be careful to also detect
3150 recursive references. */
3152 gdb_assert (data
->init_p
);
3154 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
3158 /* The architecture initialization hasn't completed - punt -
3159 hope that the caller knows what they are doing. Once
3160 deprecated_set_gdbarch_data has been initialized, this can be
3161 changed to an internal error. */
3163 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
3165 return gdbarch
->data
[data
->index
];
3170 /* Keep a registry of swapped data required by GDB modules. */
3175 struct gdbarch_swap_registration
*source
;
3176 struct gdbarch_swap
*next
;
3179 struct gdbarch_swap_registration
3182 unsigned long sizeof_data
;
3183 gdbarch_swap_ftype
*init
;
3184 struct gdbarch_swap_registration
*next
;
3187 struct gdbarch_swap_registry
3190 struct gdbarch_swap_registration
*registrations
;
3193 struct gdbarch_swap_registry gdbarch_swap_registry
=
3199 deprecated_register_gdbarch_swap (void *data
,
3200 unsigned long sizeof_data
,
3201 gdbarch_swap_ftype
*init
)
3203 struct gdbarch_swap_registration
**rego
;
3204 for (rego
= &gdbarch_swap_registry
.registrations
;
3206 rego
= &(*rego
)->next
);
3207 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
3208 (*rego
)->next
= NULL
;
3209 (*rego
)->init
= init
;
3210 (*rego
)->data
= data
;
3211 (*rego
)->sizeof_data
= sizeof_data
;
3215 current_gdbarch_swap_init_hack (void)
3217 struct gdbarch_swap_registration
*rego
;
3218 struct gdbarch_swap
**curr
= ¤t_gdbarch
->swap
;
3219 for (rego
= gdbarch_swap_registry
.registrations
;
3223 if (rego
->data
!= NULL
)
3225 (*curr
) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch
,
3226 struct gdbarch_swap
);
3227 (*curr
)->source
= rego
;
3228 (*curr
)->swap
= gdbarch_obstack_zalloc (current_gdbarch
,
3230 (*curr
)->next
= NULL
;
3231 curr
= &(*curr
)->next
;
3233 if (rego
->init
!= NULL
)
3238 static struct gdbarch
*
3239 current_gdbarch_swap_out_hack (void)
3241 struct gdbarch
*old_gdbarch
= current_gdbarch
;
3242 struct gdbarch_swap
*curr
;
3244 gdb_assert (old_gdbarch
!= NULL
);
3245 for (curr
= old_gdbarch
->swap
;
3249 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
3250 memset (curr
->source
->data
, 0, curr
->source
->sizeof_data
);
3252 current_gdbarch
= NULL
;
3257 current_gdbarch_swap_in_hack (struct gdbarch
*new_gdbarch
)
3259 struct gdbarch_swap
*curr
;
3261 gdb_assert (current_gdbarch
== NULL
);
3262 for (curr
= new_gdbarch
->swap
;
3265 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
3266 current_gdbarch
= new_gdbarch
;
3270 /* Keep a registry of the architectures known by GDB. */
3272 struct gdbarch_registration
3274 enum bfd_architecture bfd_architecture
;
3275 gdbarch_init_ftype
*init
;
3276 gdbarch_dump_tdep_ftype
*dump_tdep
;
3277 struct gdbarch_list
*arches
;
3278 struct gdbarch_registration
*next
;
3281 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
3284 append_name (const char ***buf
, int *nr
, const char *name
)
3286 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
3292 gdbarch_printable_names (void)
3294 /* Accumulate a list of names based on the registed list of
3296 enum bfd_architecture a
;
3298 const char **arches
= NULL
;
3299 struct gdbarch_registration
*rego
;
3300 for (rego
= gdbarch_registry
;
3304 const struct bfd_arch_info
*ap
;
3305 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3307 internal_error (__FILE__
, __LINE__
,
3308 _("gdbarch_architecture_names: multi-arch unknown"));
3311 append_name (&arches
, &nr_arches
, ap
->printable_name
);
3316 append_name (&arches
, &nr_arches
, NULL
);
3322 gdbarch_register (enum bfd_architecture bfd_architecture
,
3323 gdbarch_init_ftype
*init
,
3324 gdbarch_dump_tdep_ftype
*dump_tdep
)
3326 struct gdbarch_registration
**curr
;
3327 const struct bfd_arch_info
*bfd_arch_info
;
3328 /* Check that BFD recognizes this architecture */
3329 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
3330 if (bfd_arch_info
== NULL
)
3332 internal_error (__FILE__
, __LINE__
,
3333 _("gdbarch: Attempt to register unknown architecture (%d)"),
3336 /* Check that we haven't seen this architecture before */
3337 for (curr
= &gdbarch_registry
;
3339 curr
= &(*curr
)->next
)
3341 if (bfd_architecture
== (*curr
)->bfd_architecture
)
3342 internal_error (__FILE__
, __LINE__
,
3343 _("gdbarch: Duplicate registraration of architecture (%s)"),
3344 bfd_arch_info
->printable_name
);
3348 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
3349 bfd_arch_info
->printable_name
,
3352 (*curr
) = XMALLOC (struct gdbarch_registration
);
3353 (*curr
)->bfd_architecture
= bfd_architecture
;
3354 (*curr
)->init
= init
;
3355 (*curr
)->dump_tdep
= dump_tdep
;
3356 (*curr
)->arches
= NULL
;
3357 (*curr
)->next
= NULL
;
3361 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
3362 gdbarch_init_ftype
*init
)
3364 gdbarch_register (bfd_architecture
, init
, NULL
);
3368 /* Look for an architecture using gdbarch_info. */
3370 struct gdbarch_list
*
3371 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
3372 const struct gdbarch_info
*info
)
3374 for (; arches
!= NULL
; arches
= arches
->next
)
3376 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
3378 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
3380 if (info
->osabi
!= arches
->gdbarch
->osabi
)
3382 if (info
->target_desc
!= arches
->gdbarch
->target_desc
)
3390 /* Find an architecture that matches the specified INFO. Create a new
3391 architecture if needed. Return that new architecture. Assumes
3392 that there is no current architecture. */
3394 static struct gdbarch
*
3395 find_arch_by_info (struct gdbarch_info info
)
3397 struct gdbarch
*new_gdbarch
;
3398 struct gdbarch_registration
*rego
;
3400 /* The existing architecture has been swapped out - all this code
3401 works from a clean slate. */
3402 gdb_assert (current_gdbarch
== NULL
);
3404 /* Fill in missing parts of the INFO struct using a number of
3405 sources: "set ..."; INFOabfd supplied; and the global
3407 gdbarch_info_fill (&info
);
3409 /* Must have found some sort of architecture. */
3410 gdb_assert (info
.bfd_arch_info
!= NULL
);
3414 fprintf_unfiltered (gdb_stdlog
,
3415 "find_arch_by_info: info.bfd_arch_info %s\n",
3416 (info
.bfd_arch_info
!= NULL
3417 ? info
.bfd_arch_info
->printable_name
3419 fprintf_unfiltered (gdb_stdlog
,
3420 "find_arch_by_info: info.byte_order %d (%s)\n",
3422 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
3423 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
3425 fprintf_unfiltered (gdb_stdlog
,
3426 "find_arch_by_info: info.osabi %d (%s)\n",
3427 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
3428 fprintf_unfiltered (gdb_stdlog
,
3429 "find_arch_by_info: info.abfd 0x%lx\n",
3431 fprintf_unfiltered (gdb_stdlog
,
3432 "find_arch_by_info: info.tdep_info 0x%lx\n",
3433 (long) info
.tdep_info
);
3436 /* Find the tdep code that knows about this architecture. */
3437 for (rego
= gdbarch_registry
;
3440 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
3445 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3446 "No matching architecture\n");
3450 /* Ask the tdep code for an architecture that matches "info". */
3451 new_gdbarch
= rego
->init (info
, rego
->arches
);
3453 /* Did the tdep code like it? No. Reject the change and revert to
3454 the old architecture. */
3455 if (new_gdbarch
== NULL
)
3458 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3459 "Target rejected architecture\n");
3463 /* Is this a pre-existing architecture (as determined by already
3464 being initialized)? Move it to the front of the architecture
3465 list (keeping the list sorted Most Recently Used). */
3466 if (new_gdbarch
->initialized_p
)
3468 struct gdbarch_list
**list
;
3469 struct gdbarch_list
*this;
3471 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3472 "Previous architecture 0x%08lx (%s) selected\n",
3474 new_gdbarch
->bfd_arch_info
->printable_name
);
3475 /* Find the existing arch in the list. */
3476 for (list
= ®o
->arches
;
3477 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
3478 list
= &(*list
)->next
);
3479 /* It had better be in the list of architectures. */
3480 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
3483 (*list
) = this->next
;
3484 /* Insert THIS at the front. */
3485 this->next
= rego
->arches
;
3486 rego
->arches
= this;
3491 /* It's a new architecture. */
3493 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3494 "New architecture 0x%08lx (%s) selected\n",
3496 new_gdbarch
->bfd_arch_info
->printable_name
);
3498 /* Insert the new architecture into the front of the architecture
3499 list (keep the list sorted Most Recently Used). */
3501 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
3502 this->next
= rego
->arches
;
3503 this->gdbarch
= new_gdbarch
;
3504 rego
->arches
= this;
3507 /* Check that the newly installed architecture is valid. Plug in
3508 any post init values. */
3509 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
3510 verify_gdbarch (new_gdbarch
);
3511 new_gdbarch
->initialized_p
= 1;
3513 /* Initialize any per-architecture swap areas. This phase requires
3514 a valid global CURRENT_GDBARCH. Set it momentarially, and then
3515 swap the entire architecture out. */
3516 current_gdbarch
= new_gdbarch
;
3517 current_gdbarch_swap_init_hack ();
3518 current_gdbarch_swap_out_hack ();
3521 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
3527 gdbarch_find_by_info (struct gdbarch_info info
)
3529 /* Save the previously selected architecture, setting the global to
3530 NULL. This stops things like gdbarch->init() trying to use the
3531 previous architecture's configuration. The previous architecture
3532 may not even be of the same architecture family. The most recent
3533 architecture of the same family is found at the head of the
3534 rego->arches list. */
3535 struct gdbarch
*old_gdbarch
= current_gdbarch_swap_out_hack ();
3537 /* Find the specified architecture. */
3538 struct gdbarch
*new_gdbarch
= find_arch_by_info (info
);
3540 /* Restore the existing architecture. */
3541 gdb_assert (current_gdbarch
== NULL
);
3542 current_gdbarch_swap_in_hack (old_gdbarch
);
3547 /* Make the specified architecture current, swapping the existing one
3551 deprecated_current_gdbarch_select_hack (struct gdbarch
*new_gdbarch
)
3553 gdb_assert (new_gdbarch
!= NULL
);
3554 gdb_assert (current_gdbarch
!= NULL
);
3555 gdb_assert (new_gdbarch
->initialized_p
);
3556 current_gdbarch_swap_out_hack ();
3557 current_gdbarch_swap_in_hack (new_gdbarch
);
3558 architecture_changed_event ();
3559 reinit_frame_cache ();
3562 extern void _initialize_gdbarch (void);
3565 _initialize_gdbarch (void)
3567 struct cmd_list_element
*c
;
3569 add_setshow_zinteger_cmd ("arch", class_maintenance
, &gdbarch_debug
, _("\
3570 Set architecture debugging."), _("\
3571 Show architecture debugging."), _("\
3572 When non-zero, architecture debugging is enabled."),
3575 &setdebuglist
, &showdebuglist
);