1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
5 Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
6 Software Foundation, Inc.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
25 /* This file was created with the aid of ``gdbarch.sh''.
27 The Bourne shell script ``gdbarch.sh'' creates the files
28 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
29 against the existing ``gdbarch.[hc]''. Any differences found
32 If editing this file, please also run gdbarch.sh and merge any
33 changes into that script. Conversely, when making sweeping changes
34 to this file, modifying gdbarch.sh and using its output may prove
39 #include "arch-utils.h"
42 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
45 #include "floatformat.h"
47 #include "gdb_assert.h"
48 #include "gdb_string.h"
49 #include "gdb-events.h"
50 #include "reggroups.h"
52 #include "gdb_obstack.h"
54 /* Static function declarations */
56 static void alloc_gdbarch_data (struct gdbarch
*);
58 /* Non-zero if we want to trace architecture code. */
61 #define GDBARCH_DEBUG 0
63 int gdbarch_debug
= GDBARCH_DEBUG
;
66 /* Maintain the struct gdbarch object */
70 /* Has this architecture been fully initialized? */
73 /* An obstack bound to the lifetime of the architecture. */
74 struct obstack
*obstack
;
76 /* basic architectural information */
77 const struct bfd_arch_info
* bfd_arch_info
;
81 /* target specific vector. */
82 struct gdbarch_tdep
*tdep
;
83 gdbarch_dump_tdep_ftype
*dump_tdep
;
85 /* per-architecture data-pointers */
89 /* per-architecture swap-regions */
90 struct gdbarch_swap
*swap
;
94 When extending this structure you must:
98 Declare set/get functions and define the corresponding
101 gdbarch_alloc(): If zero/NULL is not a suitable default,
102 initialize the new field.
104 verify_gdbarch(): Confirm that the target updated the field
107 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
110 ``startup_gdbarch()'': Append an initial value to the static
111 variable (base values on the host's c-type system).
113 get_gdbarch(): Implement the set/get functions (probably using
114 the macro's as shortcuts).
129 gdbarch_read_pc_ftype
*read_pc
;
130 gdbarch_write_pc_ftype
*write_pc
;
131 gdbarch_read_sp_ftype
*read_sp
;
132 gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
;
133 gdbarch_pseudo_register_read_ftype
*pseudo_register_read
;
134 gdbarch_pseudo_register_write_ftype
*pseudo_register_write
;
141 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
142 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
143 gdbarch_dwarf_reg_to_regnum_ftype
*dwarf_reg_to_regnum
;
144 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
145 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
146 gdbarch_register_name_ftype
*register_name
;
147 gdbarch_register_type_ftype
*register_type
;
148 gdbarch_deprecated_register_byte_ftype
*deprecated_register_byte
;
149 gdbarch_unwind_dummy_id_ftype
*unwind_dummy_id
;
150 int deprecated_fp_regnum
;
151 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
152 gdbarch_deprecated_push_arguments_ftype
*deprecated_push_arguments
;
153 int deprecated_register_size
;
154 int call_dummy_location
;
155 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
156 gdbarch_print_registers_info_ftype
*print_registers_info
;
157 gdbarch_print_float_info_ftype
*print_float_info
;
158 gdbarch_print_vector_info_ftype
*print_vector_info
;
159 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
160 gdbarch_register_bytes_ok_ftype
*register_bytes_ok
;
161 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
162 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
163 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
164 int believe_pcc_promotion
;
165 gdbarch_convert_register_p_ftype
*convert_register_p
;
166 gdbarch_register_to_value_ftype
*register_to_value
;
167 gdbarch_value_to_register_ftype
*value_to_register
;
168 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
169 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
170 gdbarch_integer_to_address_ftype
*integer_to_address
;
171 gdbarch_deprecated_store_struct_return_ftype
*deprecated_store_struct_return
;
172 gdbarch_return_value_ftype
*return_value
;
173 gdbarch_extract_return_value_ftype
*extract_return_value
;
174 gdbarch_store_return_value_ftype
*store_return_value
;
175 gdbarch_deprecated_extract_return_value_ftype
*deprecated_extract_return_value
;
176 gdbarch_deprecated_store_return_value_ftype
*deprecated_store_return_value
;
177 gdbarch_deprecated_use_struct_convention_ftype
*deprecated_use_struct_convention
;
178 gdbarch_deprecated_extract_struct_value_address_ftype
*deprecated_extract_struct_value_address
;
179 gdbarch_skip_prologue_ftype
*skip_prologue
;
180 gdbarch_inner_than_ftype
*inner_than
;
181 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
182 gdbarch_adjust_breakpoint_address_ftype
*adjust_breakpoint_address
;
183 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
184 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
185 CORE_ADDR decr_pc_after_break
;
186 CORE_ADDR deprecated_function_start_offset
;
187 gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
;
188 CORE_ADDR frame_args_skip
;
189 gdbarch_unwind_pc_ftype
*unwind_pc
;
190 gdbarch_unwind_sp_ftype
*unwind_sp
;
191 gdbarch_deprecated_saved_pc_after_call_ftype
*deprecated_saved_pc_after_call
;
192 gdbarch_frame_num_args_ftype
*frame_num_args
;
193 gdbarch_deprecated_stack_align_ftype
*deprecated_stack_align
;
194 gdbarch_frame_align_ftype
*frame_align
;
195 gdbarch_deprecated_reg_struct_has_addr_ftype
*deprecated_reg_struct_has_addr
;
196 gdbarch_stabs_argument_has_addr_ftype
*stabs_argument_has_addr
;
197 int frame_red_zone_size
;
198 const struct floatformat
* float_format
;
199 const struct floatformat
* double_format
;
200 const struct floatformat
* long_double_format
;
201 gdbarch_convert_from_func_ptr_addr_ftype
*convert_from_func_ptr_addr
;
202 gdbarch_addr_bits_remove_ftype
*addr_bits_remove
;
203 gdbarch_smash_text_address_ftype
*smash_text_address
;
204 gdbarch_software_single_step_ftype
*software_single_step
;
205 gdbarch_print_insn_ftype
*print_insn
;
206 gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
;
207 gdbarch_skip_solib_resolver_ftype
*skip_solib_resolver
;
208 gdbarch_in_solib_call_trampoline_ftype
*in_solib_call_trampoline
;
209 gdbarch_in_solib_return_trampoline_ftype
*in_solib_return_trampoline
;
210 gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
;
211 gdbarch_construct_inferior_arguments_ftype
*construct_inferior_arguments
;
212 gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
;
213 gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
;
214 const char * name_of_malloc
;
215 int cannot_step_breakpoint
;
216 int have_nonsteppable_watchpoint
;
217 gdbarch_address_class_type_flags_ftype
*address_class_type_flags
;
218 gdbarch_address_class_type_flags_to_name_ftype
*address_class_type_flags_to_name
;
219 gdbarch_address_class_name_to_type_flags_ftype
*address_class_name_to_type_flags
;
220 gdbarch_register_reggroup_p_ftype
*register_reggroup_p
;
221 gdbarch_fetch_pointer_argument_ftype
*fetch_pointer_argument
;
222 gdbarch_regset_from_core_section_ftype
*regset_from_core_section
;
226 /* The default architecture uses host values (for want of a better
229 extern const struct bfd_arch_info bfd_default_arch_struct
;
231 struct gdbarch startup_gdbarch
=
233 1, /* Always initialized. */
234 NULL
, /* The obstack. */
235 /* basic architecture information */
236 &bfd_default_arch_struct
, /* bfd_arch_info */
237 BFD_ENDIAN_BIG
, /* byte_order */
238 GDB_OSABI_UNKNOWN
, /* osabi */
239 /* target specific vector and its dump routine */
241 /*per-architecture data-pointers and swap regions */
243 /* Multi-arch values */
244 8 * sizeof (short), /* short_bit */
245 8 * sizeof (int), /* int_bit */
246 8 * sizeof (long), /* long_bit */
247 8 * sizeof (LONGEST
), /* long_long_bit */
248 8 * sizeof (float), /* float_bit */
249 8 * sizeof (double), /* double_bit */
250 8 * sizeof (long double), /* long_double_bit */
251 8 * sizeof (void*), /* ptr_bit */
252 8 * sizeof (void*), /* addr_bit */
253 8 * sizeof (void*), /* bfd_vma_bit */
258 0, /* virtual_frame_pointer */
259 0, /* pseudo_register_read */
260 0, /* pseudo_register_write */
262 0, /* num_pseudo_regs */
267 0, /* stab_reg_to_regnum */
268 0, /* ecoff_reg_to_regnum */
269 0, /* dwarf_reg_to_regnum */
270 0, /* sdb_reg_to_regnum */
271 0, /* dwarf2_reg_to_regnum */
272 0, /* register_name */
273 0, /* register_type */
274 generic_register_byte
, /* deprecated_register_byte */
275 0, /* unwind_dummy_id */
276 -1, /* deprecated_fp_regnum */
277 0, /* push_dummy_call */
278 0, /* deprecated_push_arguments */
279 0, /* deprecated_register_size */
280 0, /* call_dummy_location */
281 0, /* push_dummy_code */
282 default_print_registers_info
, /* print_registers_info */
283 0, /* print_float_info */
284 0, /* print_vector_info */
285 0, /* register_sim_regno */
286 0, /* register_bytes_ok */
287 0, /* cannot_fetch_register */
288 0, /* cannot_store_register */
289 0, /* get_longjmp_target */
290 0, /* believe_pcc_promotion */
291 0, /* convert_register_p */
292 0, /* register_to_value */
293 0, /* value_to_register */
294 0, /* pointer_to_address */
295 0, /* address_to_pointer */
296 0, /* integer_to_address */
297 0, /* deprecated_store_struct_return */
298 0, /* return_value */
299 0, /* extract_return_value */
300 0, /* store_return_value */
301 0, /* deprecated_extract_return_value */
302 0, /* deprecated_store_return_value */
303 0, /* deprecated_use_struct_convention */
304 0, /* deprecated_extract_struct_value_address */
305 0, /* skip_prologue */
307 0, /* breakpoint_from_pc */
308 0, /* adjust_breakpoint_address */
309 0, /* memory_insert_breakpoint */
310 0, /* memory_remove_breakpoint */
311 0, /* decr_pc_after_break */
312 0, /* deprecated_function_start_offset */
313 generic_remote_translate_xfer_address
, /* remote_translate_xfer_address */
314 0, /* frame_args_skip */
317 0, /* deprecated_saved_pc_after_call */
318 0, /* frame_num_args */
319 0, /* deprecated_stack_align */
321 0, /* deprecated_reg_struct_has_addr */
322 default_stabs_argument_has_addr
, /* stabs_argument_has_addr */
323 0, /* frame_red_zone_size */
324 0, /* float_format */
325 0, /* double_format */
326 0, /* long_double_format */
327 convert_from_func_ptr_addr_identity
, /* convert_from_func_ptr_addr */
328 0, /* addr_bits_remove */
329 0, /* smash_text_address */
330 0, /* software_single_step */
332 0, /* skip_trampoline_code */
333 generic_skip_solib_resolver
, /* skip_solib_resolver */
334 0, /* in_solib_call_trampoline */
335 0, /* in_solib_return_trampoline */
336 generic_in_function_epilogue_p
, /* in_function_epilogue_p */
337 construct_inferior_arguments
, /* construct_inferior_arguments */
338 0, /* elf_make_msymbol_special */
339 0, /* coff_make_msymbol_special */
340 "malloc", /* name_of_malloc */
341 0, /* cannot_step_breakpoint */
342 0, /* have_nonsteppable_watchpoint */
343 0, /* address_class_type_flags */
344 0, /* address_class_type_flags_to_name */
345 0, /* address_class_name_to_type_flags */
346 default_register_reggroup_p
, /* register_reggroup_p */
347 0, /* fetch_pointer_argument */
348 0, /* regset_from_core_section */
349 /* startup_gdbarch() */
352 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
354 /* Create a new ``struct gdbarch'' based on information provided by
355 ``struct gdbarch_info''. */
358 gdbarch_alloc (const struct gdbarch_info
*info
,
359 struct gdbarch_tdep
*tdep
)
361 /* NOTE: The new architecture variable is named ``current_gdbarch''
362 so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
363 the current local architecture and not the previous global
364 architecture. This ensures that the new architectures initial
365 values are not influenced by the previous architecture. Once
366 everything is parameterised with gdbarch, this will go away. */
367 struct gdbarch
*current_gdbarch
;
369 /* Create an obstack for allocating all the per-architecture memory,
370 then use that to allocate the architecture vector. */
371 struct obstack
*obstack
= XMALLOC (struct obstack
);
372 obstack_init (obstack
);
373 current_gdbarch
= obstack_alloc (obstack
, sizeof (*current_gdbarch
));
374 memset (current_gdbarch
, 0, sizeof (*current_gdbarch
));
375 current_gdbarch
->obstack
= obstack
;
377 alloc_gdbarch_data (current_gdbarch
);
379 current_gdbarch
->tdep
= tdep
;
381 current_gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
382 current_gdbarch
->byte_order
= info
->byte_order
;
383 current_gdbarch
->osabi
= info
->osabi
;
385 /* Force the explicit initialization of these. */
386 current_gdbarch
->short_bit
= 2*TARGET_CHAR_BIT
;
387 current_gdbarch
->int_bit
= 4*TARGET_CHAR_BIT
;
388 current_gdbarch
->long_bit
= 4*TARGET_CHAR_BIT
;
389 current_gdbarch
->long_long_bit
= 2*TARGET_LONG_BIT
;
390 current_gdbarch
->float_bit
= 4*TARGET_CHAR_BIT
;
391 current_gdbarch
->double_bit
= 8*TARGET_CHAR_BIT
;
392 current_gdbarch
->long_double_bit
= 8*TARGET_CHAR_BIT
;
393 current_gdbarch
->ptr_bit
= TARGET_INT_BIT
;
394 current_gdbarch
->bfd_vma_bit
= TARGET_ARCHITECTURE
->bits_per_address
;
395 current_gdbarch
->char_signed
= -1;
396 current_gdbarch
->write_pc
= generic_target_write_pc
;
397 current_gdbarch
->virtual_frame_pointer
= legacy_virtual_frame_pointer
;
398 current_gdbarch
->num_regs
= -1;
399 current_gdbarch
->sp_regnum
= -1;
400 current_gdbarch
->pc_regnum
= -1;
401 current_gdbarch
->ps_regnum
= -1;
402 current_gdbarch
->fp0_regnum
= -1;
403 current_gdbarch
->stab_reg_to_regnum
= no_op_reg_to_regnum
;
404 current_gdbarch
->ecoff_reg_to_regnum
= no_op_reg_to_regnum
;
405 current_gdbarch
->dwarf_reg_to_regnum
= no_op_reg_to_regnum
;
406 current_gdbarch
->sdb_reg_to_regnum
= no_op_reg_to_regnum
;
407 current_gdbarch
->dwarf2_reg_to_regnum
= no_op_reg_to_regnum
;
408 current_gdbarch
->deprecated_register_byte
= generic_register_byte
;
409 current_gdbarch
->deprecated_fp_regnum
= -1;
410 current_gdbarch
->call_dummy_location
= AT_ENTRY_POINT
;
411 current_gdbarch
->print_registers_info
= default_print_registers_info
;
412 current_gdbarch
->register_sim_regno
= legacy_register_sim_regno
;
413 current_gdbarch
->cannot_fetch_register
= cannot_register_not
;
414 current_gdbarch
->cannot_store_register
= cannot_register_not
;
415 current_gdbarch
->convert_register_p
= generic_convert_register_p
;
416 current_gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
417 current_gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
418 current_gdbarch
->return_value
= legacy_return_value
;
419 current_gdbarch
->extract_return_value
= legacy_extract_return_value
;
420 current_gdbarch
->store_return_value
= legacy_store_return_value
;
421 current_gdbarch
->deprecated_use_struct_convention
= generic_use_struct_convention
;
422 current_gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
423 current_gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
424 current_gdbarch
->remote_translate_xfer_address
= generic_remote_translate_xfer_address
;
425 current_gdbarch
->stabs_argument_has_addr
= default_stabs_argument_has_addr
;
426 current_gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr_identity
;
427 current_gdbarch
->addr_bits_remove
= core_addr_identity
;
428 current_gdbarch
->smash_text_address
= core_addr_identity
;
429 current_gdbarch
->skip_trampoline_code
= generic_skip_trampoline_code
;
430 current_gdbarch
->skip_solib_resolver
= generic_skip_solib_resolver
;
431 current_gdbarch
->in_solib_call_trampoline
= generic_in_solib_call_trampoline
;
432 current_gdbarch
->in_solib_return_trampoline
= generic_in_solib_return_trampoline
;
433 current_gdbarch
->in_function_epilogue_p
= generic_in_function_epilogue_p
;
434 current_gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
435 current_gdbarch
->elf_make_msymbol_special
= default_elf_make_msymbol_special
;
436 current_gdbarch
->coff_make_msymbol_special
= default_coff_make_msymbol_special
;
437 current_gdbarch
->name_of_malloc
= "malloc";
438 current_gdbarch
->register_reggroup_p
= default_register_reggroup_p
;
439 /* gdbarch_alloc() */
441 return current_gdbarch
;
445 /* Allocate extra space using the per-architecture obstack. */
448 gdbarch_obstack_zalloc (struct gdbarch
*arch
, long size
)
450 void *data
= obstack_alloc (arch
->obstack
, size
);
451 memset (data
, 0, size
);
456 /* Free a gdbarch struct. This should never happen in normal
457 operation --- once you've created a gdbarch, you keep it around.
458 However, if an architecture's init function encounters an error
459 building the structure, it may need to clean up a partially
460 constructed gdbarch. */
463 gdbarch_free (struct gdbarch
*arch
)
465 struct obstack
*obstack
;
466 gdb_assert (arch
!= NULL
);
467 gdb_assert (!arch
->initialized_p
);
468 obstack
= arch
->obstack
;
469 obstack_free (obstack
, 0); /* Includes the ARCH. */
474 /* Ensure that all values in a GDBARCH are reasonable. */
476 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
477 just happens to match the global variable ``current_gdbarch''. That
478 way macros refering to that variable get the local and not the global
479 version - ulgh. Once everything is parameterised with gdbarch, this
483 verify_gdbarch (struct gdbarch
*current_gdbarch
)
486 struct cleanup
*cleanups
;
489 log
= mem_fileopen ();
490 cleanups
= make_cleanup_ui_file_delete (log
);
492 if (current_gdbarch
->byte_order
== BFD_ENDIAN_UNKNOWN
)
493 fprintf_unfiltered (log
, "\n\tbyte-order");
494 if (current_gdbarch
->bfd_arch_info
== NULL
)
495 fprintf_unfiltered (log
, "\n\tbfd_arch_info");
496 /* Check those that need to be defined for the given multi-arch level. */
497 /* Skip verify of short_bit, invalid_p == 0 */
498 /* Skip verify of int_bit, invalid_p == 0 */
499 /* Skip verify of long_bit, invalid_p == 0 */
500 /* Skip verify of long_long_bit, invalid_p == 0 */
501 /* Skip verify of float_bit, invalid_p == 0 */
502 /* Skip verify of double_bit, invalid_p == 0 */
503 /* Skip verify of long_double_bit, invalid_p == 0 */
504 /* Skip verify of ptr_bit, invalid_p == 0 */
505 if (current_gdbarch
->addr_bit
== 0)
506 current_gdbarch
->addr_bit
= TARGET_PTR_BIT
;
507 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
508 if (current_gdbarch
->char_signed
== -1)
509 current_gdbarch
->char_signed
= 1;
510 /* Skip verify of read_pc, has predicate */
511 /* Skip verify of write_pc, invalid_p == 0 */
512 /* Skip verify of read_sp, has predicate */
513 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
514 /* Skip verify of pseudo_register_read, has predicate */
515 /* Skip verify of pseudo_register_write, has predicate */
516 if ((GDB_MULTI_ARCH
> GDB_MULTI_ARCH_PARTIAL
)
517 && (current_gdbarch
->num_regs
== -1))
518 fprintf_unfiltered (log
, "\n\tnum_regs");
519 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
520 /* Skip verify of sp_regnum, invalid_p == 0 */
521 /* Skip verify of pc_regnum, invalid_p == 0 */
522 /* Skip verify of ps_regnum, invalid_p == 0 */
523 /* Skip verify of fp0_regnum, invalid_p == 0 */
524 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
525 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
526 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
527 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
528 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
529 /* Skip verify of register_type, has predicate */
530 /* Skip verify of deprecated_register_byte, has predicate */
531 /* Skip verify of unwind_dummy_id, has predicate */
532 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
533 /* Skip verify of push_dummy_call, has predicate */
534 /* Skip verify of deprecated_push_arguments, has predicate */
535 /* Skip verify of call_dummy_location, invalid_p == 0 */
536 /* Skip verify of push_dummy_code, has predicate */
537 /* Skip verify of print_registers_info, invalid_p == 0 */
538 /* Skip verify of print_float_info, has predicate */
539 /* Skip verify of print_vector_info, has predicate */
540 /* Skip verify of register_sim_regno, invalid_p == 0 */
541 /* Skip verify of register_bytes_ok, has predicate */
542 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
543 /* Skip verify of cannot_store_register, invalid_p == 0 */
544 /* Skip verify of get_longjmp_target, has predicate */
545 /* Skip verify of convert_register_p, invalid_p == 0 */
546 /* Skip verify of pointer_to_address, invalid_p == 0 */
547 /* Skip verify of address_to_pointer, invalid_p == 0 */
548 /* Skip verify of integer_to_address, has predicate */
549 /* Skip verify of deprecated_store_struct_return, has predicate */
550 /* Skip verify of return_value, has predicate */
551 /* Skip verify of extract_return_value, invalid_p == 0 */
552 /* Skip verify of store_return_value, invalid_p == 0 */
553 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
554 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
555 if ((GDB_MULTI_ARCH
> GDB_MULTI_ARCH_PARTIAL
)
556 && (current_gdbarch
->skip_prologue
== 0))
557 fprintf_unfiltered (log
, "\n\tskip_prologue");
558 if ((GDB_MULTI_ARCH
> GDB_MULTI_ARCH_PARTIAL
)
559 && (current_gdbarch
->inner_than
== 0))
560 fprintf_unfiltered (log
, "\n\tinner_than");
561 if ((GDB_MULTI_ARCH
> GDB_MULTI_ARCH_PARTIAL
)
562 && (current_gdbarch
->breakpoint_from_pc
== 0))
563 fprintf_unfiltered (log
, "\n\tbreakpoint_from_pc");
564 /* Skip verify of adjust_breakpoint_address, has predicate */
565 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
566 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
567 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
568 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
569 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
570 /* Skip verify of frame_args_skip, invalid_p == 0 */
571 /* Skip verify of unwind_pc, has predicate */
572 /* Skip verify of unwind_sp, has predicate */
573 /* Skip verify of deprecated_saved_pc_after_call, has predicate */
574 /* Skip verify of frame_num_args, has predicate */
575 /* Skip verify of deprecated_stack_align, has predicate */
576 /* Skip verify of frame_align, has predicate */
577 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
578 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
579 if (current_gdbarch
->float_format
== 0)
580 current_gdbarch
->float_format
= default_float_format (current_gdbarch
);
581 if (current_gdbarch
->double_format
== 0)
582 current_gdbarch
->double_format
= default_double_format (current_gdbarch
);
583 if (current_gdbarch
->long_double_format
== 0)
584 current_gdbarch
->long_double_format
= default_double_format (current_gdbarch
);
585 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
586 /* Skip verify of addr_bits_remove, invalid_p == 0 */
587 /* Skip verify of smash_text_address, invalid_p == 0 */
588 /* Skip verify of software_single_step, has predicate */
589 if ((GDB_MULTI_ARCH
> GDB_MULTI_ARCH_PARTIAL
)
590 && (current_gdbarch
->print_insn
== 0))
591 fprintf_unfiltered (log
, "\n\tprint_insn");
592 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
593 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
594 /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
595 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
596 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
597 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
598 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
599 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
600 /* Skip verify of name_of_malloc, invalid_p == 0 */
601 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
602 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
603 /* Skip verify of address_class_type_flags, has predicate */
604 /* Skip verify of address_class_type_flags_to_name, has predicate */
605 /* Skip verify of address_class_name_to_type_flags, has predicate */
606 /* Skip verify of register_reggroup_p, invalid_p == 0 */
607 /* Skip verify of fetch_pointer_argument, has predicate */
608 /* Skip verify of regset_from_core_section, has predicate */
609 buf
= ui_file_xstrdup (log
, &dummy
);
610 make_cleanup (xfree
, buf
);
611 if (strlen (buf
) > 0)
612 internal_error (__FILE__
, __LINE__
,
613 "verify_gdbarch: the following are invalid ...%s",
615 do_cleanups (cleanups
);
619 /* Print out the details of the current architecture. */
621 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
622 just happens to match the global variable ``current_gdbarch''. That
623 way macros refering to that variable get the local and not the global
624 version - ulgh. Once everything is parameterised with gdbarch, this
628 gdbarch_dump (struct gdbarch
*current_gdbarch
, struct ui_file
*file
)
630 fprintf_unfiltered (file
,
631 "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
633 #ifdef TARGET_ADDR_BIT
634 fprintf_unfiltered (file
,
635 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
636 XSTRING (TARGET_ADDR_BIT
));
638 fprintf_unfiltered (file
,
639 "gdbarch_dump: addr_bit = %s\n",
640 paddr_d (current_gdbarch
->addr_bit
));
641 #ifdef ADDR_BITS_REMOVE
642 fprintf_unfiltered (file
,
643 "gdbarch_dump: %s # %s\n",
644 "ADDR_BITS_REMOVE(addr)",
645 XSTRING (ADDR_BITS_REMOVE (addr
)));
647 fprintf_unfiltered (file
,
648 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
649 (long) current_gdbarch
->addr_bits_remove
);
650 fprintf_unfiltered (file
,
651 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
652 gdbarch_address_class_name_to_type_flags_p (current_gdbarch
));
653 fprintf_unfiltered (file
,
654 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
655 (long) current_gdbarch
->address_class_name_to_type_flags
);
656 #ifdef ADDRESS_CLASS_TYPE_FLAGS_P
657 fprintf_unfiltered (file
,
658 "gdbarch_dump: %s # %s\n",
659 "ADDRESS_CLASS_TYPE_FLAGS_P()",
660 XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ()));
662 fprintf_unfiltered (file
,
663 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
664 gdbarch_address_class_type_flags_p (current_gdbarch
));
665 #ifdef ADDRESS_CLASS_TYPE_FLAGS
666 fprintf_unfiltered (file
,
667 "gdbarch_dump: %s # %s\n",
668 "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
669 XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size
, dwarf2_addr_class
)));
671 fprintf_unfiltered (file
,
672 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
673 (long) current_gdbarch
->address_class_type_flags
);
674 fprintf_unfiltered (file
,
675 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
676 gdbarch_address_class_type_flags_to_name_p (current_gdbarch
));
677 fprintf_unfiltered (file
,
678 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
679 (long) current_gdbarch
->address_class_type_flags_to_name
);
680 #ifdef ADDRESS_TO_POINTER
681 fprintf_unfiltered (file
,
682 "gdbarch_dump: %s # %s\n",
683 "ADDRESS_TO_POINTER(type, buf, addr)",
684 XSTRING (ADDRESS_TO_POINTER (type
, buf
, addr
)));
686 fprintf_unfiltered (file
,
687 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
688 (long) current_gdbarch
->address_to_pointer
);
689 fprintf_unfiltered (file
,
690 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
691 gdbarch_adjust_breakpoint_address_p (current_gdbarch
));
692 fprintf_unfiltered (file
,
693 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
694 (long) current_gdbarch
->adjust_breakpoint_address
);
695 #ifdef BELIEVE_PCC_PROMOTION
696 fprintf_unfiltered (file
,
697 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
698 XSTRING (BELIEVE_PCC_PROMOTION
));
700 fprintf_unfiltered (file
,
701 "gdbarch_dump: believe_pcc_promotion = %s\n",
702 paddr_d (current_gdbarch
->believe_pcc_promotion
));
703 #ifdef TARGET_ARCHITECTURE
704 fprintf_unfiltered (file
,
705 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
706 XSTRING (TARGET_ARCHITECTURE
));
708 fprintf_unfiltered (file
,
709 "gdbarch_dump: bfd_arch_info = %s\n",
710 TARGET_ARCHITECTURE
->printable_name
);
711 #ifdef TARGET_BFD_VMA_BIT
712 fprintf_unfiltered (file
,
713 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
714 XSTRING (TARGET_BFD_VMA_BIT
));
716 fprintf_unfiltered (file
,
717 "gdbarch_dump: bfd_vma_bit = %s\n",
718 paddr_d (current_gdbarch
->bfd_vma_bit
));
719 #ifdef BREAKPOINT_FROM_PC
720 fprintf_unfiltered (file
,
721 "gdbarch_dump: %s # %s\n",
722 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
723 XSTRING (BREAKPOINT_FROM_PC (pcptr
, lenptr
)));
725 fprintf_unfiltered (file
,
726 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
727 (long) current_gdbarch
->breakpoint_from_pc
);
728 #ifdef TARGET_BYTE_ORDER
729 fprintf_unfiltered (file
,
730 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
731 XSTRING (TARGET_BYTE_ORDER
));
733 fprintf_unfiltered (file
,
734 "gdbarch_dump: byte_order = %s\n",
735 paddr_d (current_gdbarch
->byte_order
));
736 #ifdef CALL_DUMMY_LOCATION
737 fprintf_unfiltered (file
,
738 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
739 XSTRING (CALL_DUMMY_LOCATION
));
741 fprintf_unfiltered (file
,
742 "gdbarch_dump: call_dummy_location = %s\n",
743 paddr_d (current_gdbarch
->call_dummy_location
));
744 #ifdef CANNOT_FETCH_REGISTER
745 fprintf_unfiltered (file
,
746 "gdbarch_dump: %s # %s\n",
747 "CANNOT_FETCH_REGISTER(regnum)",
748 XSTRING (CANNOT_FETCH_REGISTER (regnum
)));
750 fprintf_unfiltered (file
,
751 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
752 (long) current_gdbarch
->cannot_fetch_register
);
753 #ifdef CANNOT_STEP_BREAKPOINT
754 fprintf_unfiltered (file
,
755 "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
756 XSTRING (CANNOT_STEP_BREAKPOINT
));
758 fprintf_unfiltered (file
,
759 "gdbarch_dump: cannot_step_breakpoint = %s\n",
760 paddr_d (current_gdbarch
->cannot_step_breakpoint
));
761 #ifdef CANNOT_STORE_REGISTER
762 fprintf_unfiltered (file
,
763 "gdbarch_dump: %s # %s\n",
764 "CANNOT_STORE_REGISTER(regnum)",
765 XSTRING (CANNOT_STORE_REGISTER (regnum
)));
767 fprintf_unfiltered (file
,
768 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
769 (long) current_gdbarch
->cannot_store_register
);
770 #ifdef TARGET_CHAR_SIGNED
771 fprintf_unfiltered (file
,
772 "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
773 XSTRING (TARGET_CHAR_SIGNED
));
775 fprintf_unfiltered (file
,
776 "gdbarch_dump: char_signed = %s\n",
777 paddr_d (current_gdbarch
->char_signed
));
778 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
779 fprintf_unfiltered (file
,
780 "gdbarch_dump: %s # %s\n",
781 "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
782 XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val
, msym
)));
784 fprintf_unfiltered (file
,
785 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
786 (long) current_gdbarch
->coff_make_msymbol_special
);
787 fprintf_unfiltered (file
,
788 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
789 (long) current_gdbarch
->construct_inferior_arguments
);
790 fprintf_unfiltered (file
,
791 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
792 (long) current_gdbarch
->convert_from_func_ptr_addr
);
793 #ifdef CONVERT_REGISTER_P
794 fprintf_unfiltered (file
,
795 "gdbarch_dump: %s # %s\n",
796 "CONVERT_REGISTER_P(regnum, type)",
797 XSTRING (CONVERT_REGISTER_P (regnum
, type
)));
799 fprintf_unfiltered (file
,
800 "gdbarch_dump: convert_register_p = <0x%lx>\n",
801 (long) current_gdbarch
->convert_register_p
);
802 #ifdef DECR_PC_AFTER_BREAK
803 fprintf_unfiltered (file
,
804 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
805 XSTRING (DECR_PC_AFTER_BREAK
));
807 fprintf_unfiltered (file
,
808 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
809 paddr_nz (current_gdbarch
->decr_pc_after_break
));
810 #ifdef DEPRECATED_EXTRACT_RETURN_VALUE
811 fprintf_unfiltered (file
,
812 "gdbarch_dump: %s # %s\n",
813 "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
814 XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type
, regbuf
, valbuf
)));
816 fprintf_unfiltered (file
,
817 "gdbarch_dump: deprecated_extract_return_value = <0x%lx>\n",
818 (long) current_gdbarch
->deprecated_extract_return_value
);
819 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
820 fprintf_unfiltered (file
,
821 "gdbarch_dump: %s # %s\n",
822 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
823 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
825 fprintf_unfiltered (file
,
826 "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
827 gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch
));
828 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
829 fprintf_unfiltered (file
,
830 "gdbarch_dump: %s # %s\n",
831 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
832 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache
)));
834 fprintf_unfiltered (file
,
835 "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
836 (long) current_gdbarch
->deprecated_extract_struct_value_address
);
837 #ifdef DEPRECATED_FP_REGNUM
838 fprintf_unfiltered (file
,
839 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
840 XSTRING (DEPRECATED_FP_REGNUM
));
842 fprintf_unfiltered (file
,
843 "gdbarch_dump: deprecated_fp_regnum = %s\n",
844 paddr_d (current_gdbarch
->deprecated_fp_regnum
));
845 #ifdef DEPRECATED_FUNCTION_START_OFFSET
846 fprintf_unfiltered (file
,
847 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
848 XSTRING (DEPRECATED_FUNCTION_START_OFFSET
));
850 fprintf_unfiltered (file
,
851 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
852 paddr_nz (current_gdbarch
->deprecated_function_start_offset
));
853 #ifdef DEPRECATED_PUSH_ARGUMENTS_P
854 fprintf_unfiltered (file
,
855 "gdbarch_dump: %s # %s\n",
856 "DEPRECATED_PUSH_ARGUMENTS_P()",
857 XSTRING (DEPRECATED_PUSH_ARGUMENTS_P ()));
859 fprintf_unfiltered (file
,
860 "gdbarch_dump: gdbarch_deprecated_push_arguments_p() = %d\n",
861 gdbarch_deprecated_push_arguments_p (current_gdbarch
));
862 #ifdef DEPRECATED_PUSH_ARGUMENTS
863 fprintf_unfiltered (file
,
864 "gdbarch_dump: %s # %s\n",
865 "DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
866 XSTRING (DEPRECATED_PUSH_ARGUMENTS (nargs
, args
, sp
, struct_return
, struct_addr
)));
868 fprintf_unfiltered (file
,
869 "gdbarch_dump: deprecated_push_arguments = <0x%lx>\n",
870 (long) current_gdbarch
->deprecated_push_arguments
);
871 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
872 fprintf_unfiltered (file
,
873 "gdbarch_dump: %s # %s\n",
874 "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
875 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
877 fprintf_unfiltered (file
,
878 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
879 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch
));
880 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
881 fprintf_unfiltered (file
,
882 "gdbarch_dump: %s # %s\n",
883 "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
884 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p
, type
)));
886 fprintf_unfiltered (file
,
887 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
888 (long) current_gdbarch
->deprecated_reg_struct_has_addr
);
889 #ifdef DEPRECATED_REGISTER_BYTE_P
890 fprintf_unfiltered (file
,
891 "gdbarch_dump: %s # %s\n",
892 "DEPRECATED_REGISTER_BYTE_P()",
893 XSTRING (DEPRECATED_REGISTER_BYTE_P ()));
895 fprintf_unfiltered (file
,
896 "gdbarch_dump: gdbarch_deprecated_register_byte_p() = %d\n",
897 gdbarch_deprecated_register_byte_p (current_gdbarch
));
898 #ifdef DEPRECATED_REGISTER_BYTE
899 fprintf_unfiltered (file
,
900 "gdbarch_dump: %s # %s\n",
901 "DEPRECATED_REGISTER_BYTE(reg_nr)",
902 XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr
)));
904 fprintf_unfiltered (file
,
905 "gdbarch_dump: deprecated_register_byte = <0x%lx>\n",
906 (long) current_gdbarch
->deprecated_register_byte
);
907 #ifdef DEPRECATED_REGISTER_SIZE
908 fprintf_unfiltered (file
,
909 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
910 XSTRING (DEPRECATED_REGISTER_SIZE
));
912 fprintf_unfiltered (file
,
913 "gdbarch_dump: deprecated_register_size = %s\n",
914 paddr_d (current_gdbarch
->deprecated_register_size
));
915 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P
916 fprintf_unfiltered (file
,
917 "gdbarch_dump: %s # %s\n",
918 "DEPRECATED_SAVED_PC_AFTER_CALL_P()",
919 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL_P ()));
921 fprintf_unfiltered (file
,
922 "gdbarch_dump: gdbarch_deprecated_saved_pc_after_call_p() = %d\n",
923 gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch
));
924 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL
925 fprintf_unfiltered (file
,
926 "gdbarch_dump: %s # %s\n",
927 "DEPRECATED_SAVED_PC_AFTER_CALL(frame)",
928 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL (frame
)));
930 fprintf_unfiltered (file
,
931 "gdbarch_dump: deprecated_saved_pc_after_call = <0x%lx>\n",
932 (long) current_gdbarch
->deprecated_saved_pc_after_call
);
933 #ifdef DEPRECATED_STACK_ALIGN_P
934 fprintf_unfiltered (file
,
935 "gdbarch_dump: %s # %s\n",
936 "DEPRECATED_STACK_ALIGN_P()",
937 XSTRING (DEPRECATED_STACK_ALIGN_P ()));
939 fprintf_unfiltered (file
,
940 "gdbarch_dump: gdbarch_deprecated_stack_align_p() = %d\n",
941 gdbarch_deprecated_stack_align_p (current_gdbarch
));
942 #ifdef DEPRECATED_STACK_ALIGN
943 fprintf_unfiltered (file
,
944 "gdbarch_dump: %s # %s\n",
945 "DEPRECATED_STACK_ALIGN(sp)",
946 XSTRING (DEPRECATED_STACK_ALIGN (sp
)));
948 fprintf_unfiltered (file
,
949 "gdbarch_dump: deprecated_stack_align = <0x%lx>\n",
950 (long) current_gdbarch
->deprecated_stack_align
);
951 #ifdef DEPRECATED_STORE_RETURN_VALUE
952 fprintf_unfiltered (file
,
953 "gdbarch_dump: %s # %s\n",
954 "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
955 XSTRING (DEPRECATED_STORE_RETURN_VALUE (type
, valbuf
)));
957 fprintf_unfiltered (file
,
958 "gdbarch_dump: deprecated_store_return_value = <0x%lx>\n",
959 (long) current_gdbarch
->deprecated_store_return_value
);
960 #ifdef DEPRECATED_STORE_STRUCT_RETURN_P
961 fprintf_unfiltered (file
,
962 "gdbarch_dump: %s # %s\n",
963 "DEPRECATED_STORE_STRUCT_RETURN_P()",
964 XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ()));
966 fprintf_unfiltered (file
,
967 "gdbarch_dump: gdbarch_deprecated_store_struct_return_p() = %d\n",
968 gdbarch_deprecated_store_struct_return_p (current_gdbarch
));
969 #ifdef DEPRECATED_STORE_STRUCT_RETURN
970 fprintf_unfiltered (file
,
971 "gdbarch_dump: %s # %s\n",
972 "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)",
973 XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr
, sp
)));
975 fprintf_unfiltered (file
,
976 "gdbarch_dump: deprecated_store_struct_return = <0x%lx>\n",
977 (long) current_gdbarch
->deprecated_store_struct_return
);
978 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
979 fprintf_unfiltered (file
,
980 "gdbarch_dump: %s # %s\n",
981 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
982 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p
, value_type
)));
984 fprintf_unfiltered (file
,
985 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
986 (long) current_gdbarch
->deprecated_use_struct_convention
);
987 #ifdef TARGET_DOUBLE_BIT
988 fprintf_unfiltered (file
,
989 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
990 XSTRING (TARGET_DOUBLE_BIT
));
992 fprintf_unfiltered (file
,
993 "gdbarch_dump: double_bit = %s\n",
994 paddr_d (current_gdbarch
->double_bit
));
995 #ifdef TARGET_DOUBLE_FORMAT
996 fprintf_unfiltered (file
,
997 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
998 XSTRING (TARGET_DOUBLE_FORMAT
));
1000 fprintf_unfiltered (file
,
1001 "gdbarch_dump: double_format = %s\n",
1002 (TARGET_DOUBLE_FORMAT
)->name
);
1003 #ifdef DWARF2_REG_TO_REGNUM
1004 fprintf_unfiltered (file
,
1005 "gdbarch_dump: %s # %s\n",
1006 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
1007 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr
)));
1009 fprintf_unfiltered (file
,
1010 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
1011 (long) current_gdbarch
->dwarf2_reg_to_regnum
);
1012 #ifdef DWARF_REG_TO_REGNUM
1013 fprintf_unfiltered (file
,
1014 "gdbarch_dump: %s # %s\n",
1015 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1016 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr
)));
1018 fprintf_unfiltered (file
,
1019 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
1020 (long) current_gdbarch
->dwarf_reg_to_regnum
);
1021 #ifdef ECOFF_REG_TO_REGNUM
1022 fprintf_unfiltered (file
,
1023 "gdbarch_dump: %s # %s\n",
1024 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1025 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr
)));
1027 fprintf_unfiltered (file
,
1028 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
1029 (long) current_gdbarch
->ecoff_reg_to_regnum
);
1030 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
1031 fprintf_unfiltered (file
,
1032 "gdbarch_dump: %s # %s\n",
1033 "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1034 XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym
, msym
)));
1036 fprintf_unfiltered (file
,
1037 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
1038 (long) current_gdbarch
->elf_make_msymbol_special
);
1039 #ifdef EXTRACT_RETURN_VALUE
1040 fprintf_unfiltered (file
,
1041 "gdbarch_dump: %s # %s\n",
1042 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1043 XSTRING (EXTRACT_RETURN_VALUE (type
, regcache
, valbuf
)));
1045 fprintf_unfiltered (file
,
1046 "gdbarch_dump: extract_return_value = <0x%lx>\n",
1047 (long) current_gdbarch
->extract_return_value
);
1048 #ifdef FETCH_POINTER_ARGUMENT_P
1049 fprintf_unfiltered (file
,
1050 "gdbarch_dump: %s # %s\n",
1051 "FETCH_POINTER_ARGUMENT_P()",
1052 XSTRING (FETCH_POINTER_ARGUMENT_P ()));
1054 fprintf_unfiltered (file
,
1055 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
1056 gdbarch_fetch_pointer_argument_p (current_gdbarch
));
1057 #ifdef FETCH_POINTER_ARGUMENT
1058 fprintf_unfiltered (file
,
1059 "gdbarch_dump: %s # %s\n",
1060 "FETCH_POINTER_ARGUMENT(frame, argi, type)",
1061 XSTRING (FETCH_POINTER_ARGUMENT (frame
, argi
, type
)));
1063 fprintf_unfiltered (file
,
1064 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
1065 (long) current_gdbarch
->fetch_pointer_argument
);
1066 #ifdef TARGET_FLOAT_BIT
1067 fprintf_unfiltered (file
,
1068 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
1069 XSTRING (TARGET_FLOAT_BIT
));
1071 fprintf_unfiltered (file
,
1072 "gdbarch_dump: float_bit = %s\n",
1073 paddr_d (current_gdbarch
->float_bit
));
1074 #ifdef TARGET_FLOAT_FORMAT
1075 fprintf_unfiltered (file
,
1076 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1077 XSTRING (TARGET_FLOAT_FORMAT
));
1079 fprintf_unfiltered (file
,
1080 "gdbarch_dump: float_format = %s\n",
1081 (TARGET_FLOAT_FORMAT
)->name
);
1083 fprintf_unfiltered (file
,
1084 "gdbarch_dump: FP0_REGNUM # %s\n",
1085 XSTRING (FP0_REGNUM
));
1087 fprintf_unfiltered (file
,
1088 "gdbarch_dump: fp0_regnum = %s\n",
1089 paddr_d (current_gdbarch
->fp0_regnum
));
1090 fprintf_unfiltered (file
,
1091 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
1092 gdbarch_frame_align_p (current_gdbarch
));
1093 fprintf_unfiltered (file
,
1094 "gdbarch_dump: frame_align = <0x%lx>\n",
1095 (long) current_gdbarch
->frame_align
);
1096 #ifdef FRAME_ARGS_SKIP
1097 fprintf_unfiltered (file
,
1098 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1099 XSTRING (FRAME_ARGS_SKIP
));
1101 fprintf_unfiltered (file
,
1102 "gdbarch_dump: frame_args_skip = 0x%s\n",
1103 paddr_nz (current_gdbarch
->frame_args_skip
));
1104 #ifdef FRAME_NUM_ARGS_P
1105 fprintf_unfiltered (file
,
1106 "gdbarch_dump: %s # %s\n",
1107 "FRAME_NUM_ARGS_P()",
1108 XSTRING (FRAME_NUM_ARGS_P ()));
1110 fprintf_unfiltered (file
,
1111 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
1112 gdbarch_frame_num_args_p (current_gdbarch
));
1113 #ifdef FRAME_NUM_ARGS
1114 fprintf_unfiltered (file
,
1115 "gdbarch_dump: %s # %s\n",
1116 "FRAME_NUM_ARGS(frame)",
1117 XSTRING (FRAME_NUM_ARGS (frame
)));
1119 fprintf_unfiltered (file
,
1120 "gdbarch_dump: frame_num_args = <0x%lx>\n",
1121 (long) current_gdbarch
->frame_num_args
);
1122 #ifdef FRAME_RED_ZONE_SIZE
1123 fprintf_unfiltered (file
,
1124 "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
1125 XSTRING (FRAME_RED_ZONE_SIZE
));
1127 fprintf_unfiltered (file
,
1128 "gdbarch_dump: frame_red_zone_size = %s\n",
1129 paddr_d (current_gdbarch
->frame_red_zone_size
));
1130 #ifdef GET_LONGJMP_TARGET_P
1131 fprintf_unfiltered (file
,
1132 "gdbarch_dump: %s # %s\n",
1133 "GET_LONGJMP_TARGET_P()",
1134 XSTRING (GET_LONGJMP_TARGET_P ()));
1136 fprintf_unfiltered (file
,
1137 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1138 gdbarch_get_longjmp_target_p (current_gdbarch
));
1139 #ifdef GET_LONGJMP_TARGET
1140 fprintf_unfiltered (file
,
1141 "gdbarch_dump: %s # %s\n",
1142 "GET_LONGJMP_TARGET(pc)",
1143 XSTRING (GET_LONGJMP_TARGET (pc
)));
1145 fprintf_unfiltered (file
,
1146 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
1147 (long) current_gdbarch
->get_longjmp_target
);
1148 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
1149 fprintf_unfiltered (file
,
1150 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1151 XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT
));
1153 fprintf_unfiltered (file
,
1154 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1155 paddr_d (current_gdbarch
->have_nonsteppable_watchpoint
));
1156 fprintf_unfiltered (file
,
1157 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
1158 (long) current_gdbarch
->in_function_epilogue_p
);
1159 #ifdef IN_SOLIB_CALL_TRAMPOLINE
1160 fprintf_unfiltered (file
,
1161 "gdbarch_dump: %s # %s\n",
1162 "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
1163 XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc
, name
)));
1165 fprintf_unfiltered (file
,
1166 "gdbarch_dump: in_solib_call_trampoline = <0x%lx>\n",
1167 (long) current_gdbarch
->in_solib_call_trampoline
);
1168 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1169 fprintf_unfiltered (file
,
1170 "gdbarch_dump: %s # %s\n",
1171 "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1172 XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc
, name
)));
1174 fprintf_unfiltered (file
,
1175 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
1176 (long) current_gdbarch
->in_solib_return_trampoline
);
1178 fprintf_unfiltered (file
,
1179 "gdbarch_dump: %s # %s\n",
1180 "INNER_THAN(lhs, rhs)",
1181 XSTRING (INNER_THAN (lhs
, rhs
)));
1183 fprintf_unfiltered (file
,
1184 "gdbarch_dump: inner_than = <0x%lx>\n",
1185 (long) current_gdbarch
->inner_than
);
1186 #ifdef TARGET_INT_BIT
1187 fprintf_unfiltered (file
,
1188 "gdbarch_dump: TARGET_INT_BIT # %s\n",
1189 XSTRING (TARGET_INT_BIT
));
1191 fprintf_unfiltered (file
,
1192 "gdbarch_dump: int_bit = %s\n",
1193 paddr_d (current_gdbarch
->int_bit
));
1194 #ifdef INTEGER_TO_ADDRESS_P
1195 fprintf_unfiltered (file
,
1196 "gdbarch_dump: %s # %s\n",
1197 "INTEGER_TO_ADDRESS_P()",
1198 XSTRING (INTEGER_TO_ADDRESS_P ()));
1200 fprintf_unfiltered (file
,
1201 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1202 gdbarch_integer_to_address_p (current_gdbarch
));
1203 #ifdef INTEGER_TO_ADDRESS
1204 fprintf_unfiltered (file
,
1205 "gdbarch_dump: %s # %s\n",
1206 "INTEGER_TO_ADDRESS(type, buf)",
1207 XSTRING (INTEGER_TO_ADDRESS (type
, buf
)));
1209 fprintf_unfiltered (file
,
1210 "gdbarch_dump: integer_to_address = <0x%lx>\n",
1211 (long) current_gdbarch
->integer_to_address
);
1212 #ifdef TARGET_LONG_BIT
1213 fprintf_unfiltered (file
,
1214 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
1215 XSTRING (TARGET_LONG_BIT
));
1217 fprintf_unfiltered (file
,
1218 "gdbarch_dump: long_bit = %s\n",
1219 paddr_d (current_gdbarch
->long_bit
));
1220 #ifdef TARGET_LONG_DOUBLE_BIT
1221 fprintf_unfiltered (file
,
1222 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
1223 XSTRING (TARGET_LONG_DOUBLE_BIT
));
1225 fprintf_unfiltered (file
,
1226 "gdbarch_dump: long_double_bit = %s\n",
1227 paddr_d (current_gdbarch
->long_double_bit
));
1228 #ifdef TARGET_LONG_DOUBLE_FORMAT
1229 fprintf_unfiltered (file
,
1230 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1231 XSTRING (TARGET_LONG_DOUBLE_FORMAT
));
1233 fprintf_unfiltered (file
,
1234 "gdbarch_dump: long_double_format = %s\n",
1235 (TARGET_LONG_DOUBLE_FORMAT
)->name
);
1236 #ifdef TARGET_LONG_LONG_BIT
1237 fprintf_unfiltered (file
,
1238 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
1239 XSTRING (TARGET_LONG_LONG_BIT
));
1241 fprintf_unfiltered (file
,
1242 "gdbarch_dump: long_long_bit = %s\n",
1243 paddr_d (current_gdbarch
->long_long_bit
));
1244 #ifdef MEMORY_INSERT_BREAKPOINT
1245 fprintf_unfiltered (file
,
1246 "gdbarch_dump: %s # %s\n",
1247 "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1248 XSTRING (MEMORY_INSERT_BREAKPOINT (addr
, contents_cache
)));
1250 fprintf_unfiltered (file
,
1251 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
1252 (long) current_gdbarch
->memory_insert_breakpoint
);
1253 #ifdef MEMORY_REMOVE_BREAKPOINT
1254 fprintf_unfiltered (file
,
1255 "gdbarch_dump: %s # %s\n",
1256 "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1257 XSTRING (MEMORY_REMOVE_BREAKPOINT (addr
, contents_cache
)));
1259 fprintf_unfiltered (file
,
1260 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
1261 (long) current_gdbarch
->memory_remove_breakpoint
);
1262 #ifdef NAME_OF_MALLOC
1263 fprintf_unfiltered (file
,
1264 "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1265 XSTRING (NAME_OF_MALLOC
));
1267 fprintf_unfiltered (file
,
1268 "gdbarch_dump: name_of_malloc = %s\n",
1270 #ifdef NUM_PSEUDO_REGS
1271 fprintf_unfiltered (file
,
1272 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1273 XSTRING (NUM_PSEUDO_REGS
));
1275 fprintf_unfiltered (file
,
1276 "gdbarch_dump: num_pseudo_regs = %s\n",
1277 paddr_d (current_gdbarch
->num_pseudo_regs
));
1279 fprintf_unfiltered (file
,
1280 "gdbarch_dump: NUM_REGS # %s\n",
1281 XSTRING (NUM_REGS
));
1283 fprintf_unfiltered (file
,
1284 "gdbarch_dump: num_regs = %s\n",
1285 paddr_d (current_gdbarch
->num_regs
));
1287 fprintf_unfiltered (file
,
1288 "gdbarch_dump: TARGET_OSABI # %s\n",
1289 XSTRING (TARGET_OSABI
));
1291 fprintf_unfiltered (file
,
1292 "gdbarch_dump: osabi = %s\n",
1293 paddr_d (current_gdbarch
->osabi
));
1295 fprintf_unfiltered (file
,
1296 "gdbarch_dump: PC_REGNUM # %s\n",
1297 XSTRING (PC_REGNUM
));
1299 fprintf_unfiltered (file
,
1300 "gdbarch_dump: pc_regnum = %s\n",
1301 paddr_d (current_gdbarch
->pc_regnum
));
1302 #ifdef POINTER_TO_ADDRESS
1303 fprintf_unfiltered (file
,
1304 "gdbarch_dump: %s # %s\n",
1305 "POINTER_TO_ADDRESS(type, buf)",
1306 XSTRING (POINTER_TO_ADDRESS (type
, buf
)));
1308 fprintf_unfiltered (file
,
1309 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
1310 (long) current_gdbarch
->pointer_to_address
);
1311 fprintf_unfiltered (file
,
1312 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1313 gdbarch_print_float_info_p (current_gdbarch
));
1314 fprintf_unfiltered (file
,
1315 "gdbarch_dump: print_float_info = <0x%lx>\n",
1316 (long) current_gdbarch
->print_float_info
);
1317 #ifdef TARGET_PRINT_INSN
1318 fprintf_unfiltered (file
,
1319 "gdbarch_dump: %s # %s\n",
1320 "TARGET_PRINT_INSN(vma, info)",
1321 XSTRING (TARGET_PRINT_INSN (vma
, info
)));
1323 fprintf_unfiltered (file
,
1324 "gdbarch_dump: print_insn = <0x%lx>\n",
1325 (long) current_gdbarch
->print_insn
);
1326 fprintf_unfiltered (file
,
1327 "gdbarch_dump: print_registers_info = <0x%lx>\n",
1328 (long) current_gdbarch
->print_registers_info
);
1329 fprintf_unfiltered (file
,
1330 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1331 gdbarch_print_vector_info_p (current_gdbarch
));
1332 fprintf_unfiltered (file
,
1333 "gdbarch_dump: print_vector_info = <0x%lx>\n",
1334 (long) current_gdbarch
->print_vector_info
);
1336 fprintf_unfiltered (file
,
1337 "gdbarch_dump: PS_REGNUM # %s\n",
1338 XSTRING (PS_REGNUM
));
1340 fprintf_unfiltered (file
,
1341 "gdbarch_dump: ps_regnum = %s\n",
1342 paddr_d (current_gdbarch
->ps_regnum
));
1343 fprintf_unfiltered (file
,
1344 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1345 gdbarch_pseudo_register_read_p (current_gdbarch
));
1346 fprintf_unfiltered (file
,
1347 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
1348 (long) current_gdbarch
->pseudo_register_read
);
1349 fprintf_unfiltered (file
,
1350 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1351 gdbarch_pseudo_register_write_p (current_gdbarch
));
1352 fprintf_unfiltered (file
,
1353 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
1354 (long) current_gdbarch
->pseudo_register_write
);
1355 #ifdef TARGET_PTR_BIT
1356 fprintf_unfiltered (file
,
1357 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
1358 XSTRING (TARGET_PTR_BIT
));
1360 fprintf_unfiltered (file
,
1361 "gdbarch_dump: ptr_bit = %s\n",
1362 paddr_d (current_gdbarch
->ptr_bit
));
1363 fprintf_unfiltered (file
,
1364 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1365 gdbarch_push_dummy_call_p (current_gdbarch
));
1366 fprintf_unfiltered (file
,
1367 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
1368 (long) current_gdbarch
->push_dummy_call
);
1369 fprintf_unfiltered (file
,
1370 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1371 gdbarch_push_dummy_code_p (current_gdbarch
));
1372 fprintf_unfiltered (file
,
1373 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
1374 (long) current_gdbarch
->push_dummy_code
);
1375 #ifdef TARGET_READ_PC_P
1376 fprintf_unfiltered (file
,
1377 "gdbarch_dump: %s # %s\n",
1378 "TARGET_READ_PC_P()",
1379 XSTRING (TARGET_READ_PC_P ()));
1381 fprintf_unfiltered (file
,
1382 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1383 gdbarch_read_pc_p (current_gdbarch
));
1384 #ifdef TARGET_READ_PC
1385 fprintf_unfiltered (file
,
1386 "gdbarch_dump: %s # %s\n",
1387 "TARGET_READ_PC(ptid)",
1388 XSTRING (TARGET_READ_PC (ptid
)));
1390 fprintf_unfiltered (file
,
1391 "gdbarch_dump: read_pc = <0x%lx>\n",
1392 (long) current_gdbarch
->read_pc
);
1393 #ifdef TARGET_READ_SP_P
1394 fprintf_unfiltered (file
,
1395 "gdbarch_dump: %s # %s\n",
1396 "TARGET_READ_SP_P()",
1397 XSTRING (TARGET_READ_SP_P ()));
1399 fprintf_unfiltered (file
,
1400 "gdbarch_dump: gdbarch_read_sp_p() = %d\n",
1401 gdbarch_read_sp_p (current_gdbarch
));
1402 #ifdef TARGET_READ_SP
1403 fprintf_unfiltered (file
,
1404 "gdbarch_dump: %s # %s\n",
1406 XSTRING (TARGET_READ_SP ()));
1408 fprintf_unfiltered (file
,
1409 "gdbarch_dump: read_sp = <0x%lx>\n",
1410 (long) current_gdbarch
->read_sp
);
1411 #ifdef REGISTER_BYTES_OK_P
1412 fprintf_unfiltered (file
,
1413 "gdbarch_dump: %s # %s\n",
1414 "REGISTER_BYTES_OK_P()",
1415 XSTRING (REGISTER_BYTES_OK_P ()));
1417 fprintf_unfiltered (file
,
1418 "gdbarch_dump: gdbarch_register_bytes_ok_p() = %d\n",
1419 gdbarch_register_bytes_ok_p (current_gdbarch
));
1420 #ifdef REGISTER_BYTES_OK
1421 fprintf_unfiltered (file
,
1422 "gdbarch_dump: %s # %s\n",
1423 "REGISTER_BYTES_OK(nr_bytes)",
1424 XSTRING (REGISTER_BYTES_OK (nr_bytes
)));
1426 fprintf_unfiltered (file
,
1427 "gdbarch_dump: register_bytes_ok = <0x%lx>\n",
1428 (long) current_gdbarch
->register_bytes_ok
);
1429 #ifdef REGISTER_NAME
1430 fprintf_unfiltered (file
,
1431 "gdbarch_dump: %s # %s\n",
1432 "REGISTER_NAME(regnr)",
1433 XSTRING (REGISTER_NAME (regnr
)));
1435 fprintf_unfiltered (file
,
1436 "gdbarch_dump: register_name = <0x%lx>\n",
1437 (long) current_gdbarch
->register_name
);
1438 fprintf_unfiltered (file
,
1439 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
1440 (long) current_gdbarch
->register_reggroup_p
);
1441 #ifdef REGISTER_SIM_REGNO
1442 fprintf_unfiltered (file
,
1443 "gdbarch_dump: %s # %s\n",
1444 "REGISTER_SIM_REGNO(reg_nr)",
1445 XSTRING (REGISTER_SIM_REGNO (reg_nr
)));
1447 fprintf_unfiltered (file
,
1448 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
1449 (long) current_gdbarch
->register_sim_regno
);
1450 #ifdef REGISTER_TO_VALUE
1451 fprintf_unfiltered (file
,
1452 "gdbarch_dump: %s # %s\n",
1453 "REGISTER_TO_VALUE(frame, regnum, type, buf)",
1454 XSTRING (REGISTER_TO_VALUE (frame
, regnum
, type
, buf
)));
1456 fprintf_unfiltered (file
,
1457 "gdbarch_dump: register_to_value = <0x%lx>\n",
1458 (long) current_gdbarch
->register_to_value
);
1459 fprintf_unfiltered (file
,
1460 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1461 gdbarch_register_type_p (current_gdbarch
));
1462 fprintf_unfiltered (file
,
1463 "gdbarch_dump: register_type = <0x%lx>\n",
1464 (long) current_gdbarch
->register_type
);
1465 fprintf_unfiltered (file
,
1466 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1467 gdbarch_regset_from_core_section_p (current_gdbarch
));
1468 fprintf_unfiltered (file
,
1469 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
1470 (long) current_gdbarch
->regset_from_core_section
);
1471 fprintf_unfiltered (file
,
1472 "gdbarch_dump: remote_translate_xfer_address = <0x%lx>\n",
1473 (long) current_gdbarch
->remote_translate_xfer_address
);
1474 fprintf_unfiltered (file
,
1475 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1476 gdbarch_return_value_p (current_gdbarch
));
1477 fprintf_unfiltered (file
,
1478 "gdbarch_dump: return_value = <0x%lx>\n",
1479 (long) current_gdbarch
->return_value
);
1480 #ifdef SDB_REG_TO_REGNUM
1481 fprintf_unfiltered (file
,
1482 "gdbarch_dump: %s # %s\n",
1483 "SDB_REG_TO_REGNUM(sdb_regnr)",
1484 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr
)));
1486 fprintf_unfiltered (file
,
1487 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1488 (long) current_gdbarch
->sdb_reg_to_regnum
);
1489 #ifdef TARGET_SHORT_BIT
1490 fprintf_unfiltered (file
,
1491 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
1492 XSTRING (TARGET_SHORT_BIT
));
1494 fprintf_unfiltered (file
,
1495 "gdbarch_dump: short_bit = %s\n",
1496 paddr_d (current_gdbarch
->short_bit
));
1497 #ifdef SKIP_PROLOGUE
1498 fprintf_unfiltered (file
,
1499 "gdbarch_dump: %s # %s\n",
1500 "SKIP_PROLOGUE(ip)",
1501 XSTRING (SKIP_PROLOGUE (ip
)));
1503 fprintf_unfiltered (file
,
1504 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1505 (long) current_gdbarch
->skip_prologue
);
1506 fprintf_unfiltered (file
,
1507 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1508 (long) current_gdbarch
->skip_solib_resolver
);
1509 #ifdef SKIP_TRAMPOLINE_CODE
1510 fprintf_unfiltered (file
,
1511 "gdbarch_dump: %s # %s\n",
1512 "SKIP_TRAMPOLINE_CODE(pc)",
1513 XSTRING (SKIP_TRAMPOLINE_CODE (pc
)));
1515 fprintf_unfiltered (file
,
1516 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1517 (long) current_gdbarch
->skip_trampoline_code
);
1518 #ifdef SMASH_TEXT_ADDRESS
1519 fprintf_unfiltered (file
,
1520 "gdbarch_dump: %s # %s\n",
1521 "SMASH_TEXT_ADDRESS(addr)",
1522 XSTRING (SMASH_TEXT_ADDRESS (addr
)));
1524 fprintf_unfiltered (file
,
1525 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1526 (long) current_gdbarch
->smash_text_address
);
1527 #ifdef SOFTWARE_SINGLE_STEP_P
1528 fprintf_unfiltered (file
,
1529 "gdbarch_dump: %s # %s\n",
1530 "SOFTWARE_SINGLE_STEP_P()",
1531 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1533 fprintf_unfiltered (file
,
1534 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1535 gdbarch_software_single_step_p (current_gdbarch
));
1536 #ifdef SOFTWARE_SINGLE_STEP
1537 fprintf_unfiltered (file
,
1538 "gdbarch_dump: %s # %s\n",
1539 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
1540 XSTRING (SOFTWARE_SINGLE_STEP (sig
, insert_breakpoints_p
)));
1542 fprintf_unfiltered (file
,
1543 "gdbarch_dump: software_single_step = <0x%lx>\n",
1544 (long) current_gdbarch
->software_single_step
);
1546 fprintf_unfiltered (file
,
1547 "gdbarch_dump: SP_REGNUM # %s\n",
1548 XSTRING (SP_REGNUM
));
1550 fprintf_unfiltered (file
,
1551 "gdbarch_dump: sp_regnum = %s\n",
1552 paddr_d (current_gdbarch
->sp_regnum
));
1553 #ifdef STAB_REG_TO_REGNUM
1554 fprintf_unfiltered (file
,
1555 "gdbarch_dump: %s # %s\n",
1556 "STAB_REG_TO_REGNUM(stab_regnr)",
1557 XSTRING (STAB_REG_TO_REGNUM (stab_regnr
)));
1559 fprintf_unfiltered (file
,
1560 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1561 (long) current_gdbarch
->stab_reg_to_regnum
);
1562 fprintf_unfiltered (file
,
1563 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1564 (long) current_gdbarch
->stabs_argument_has_addr
);
1565 #ifdef STORE_RETURN_VALUE
1566 fprintf_unfiltered (file
,
1567 "gdbarch_dump: %s # %s\n",
1568 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1569 XSTRING (STORE_RETURN_VALUE (type
, regcache
, valbuf
)));
1571 fprintf_unfiltered (file
,
1572 "gdbarch_dump: store_return_value = <0x%lx>\n",
1573 (long) current_gdbarch
->store_return_value
);
1574 fprintf_unfiltered (file
,
1575 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1576 gdbarch_unwind_dummy_id_p (current_gdbarch
));
1577 fprintf_unfiltered (file
,
1578 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1579 (long) current_gdbarch
->unwind_dummy_id
);
1580 fprintf_unfiltered (file
,
1581 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1582 gdbarch_unwind_pc_p (current_gdbarch
));
1583 fprintf_unfiltered (file
,
1584 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1585 (long) current_gdbarch
->unwind_pc
);
1586 fprintf_unfiltered (file
,
1587 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1588 gdbarch_unwind_sp_p (current_gdbarch
));
1589 fprintf_unfiltered (file
,
1590 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1591 (long) current_gdbarch
->unwind_sp
);
1592 #ifdef VALUE_TO_REGISTER
1593 fprintf_unfiltered (file
,
1594 "gdbarch_dump: %s # %s\n",
1595 "VALUE_TO_REGISTER(frame, regnum, type, buf)",
1596 XSTRING (VALUE_TO_REGISTER (frame
, regnum
, type
, buf
)));
1598 fprintf_unfiltered (file
,
1599 "gdbarch_dump: value_to_register = <0x%lx>\n",
1600 (long) current_gdbarch
->value_to_register
);
1601 #ifdef TARGET_VIRTUAL_FRAME_POINTER
1602 fprintf_unfiltered (file
,
1603 "gdbarch_dump: %s # %s\n",
1604 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
1605 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc
, frame_regnum
, frame_offset
)));
1607 fprintf_unfiltered (file
,
1608 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1609 (long) current_gdbarch
->virtual_frame_pointer
);
1610 #ifdef TARGET_WRITE_PC
1611 fprintf_unfiltered (file
,
1612 "gdbarch_dump: %s # %s\n",
1613 "TARGET_WRITE_PC(val, ptid)",
1614 XSTRING (TARGET_WRITE_PC (val
, ptid
)));
1616 fprintf_unfiltered (file
,
1617 "gdbarch_dump: write_pc = <0x%lx>\n",
1618 (long) current_gdbarch
->write_pc
);
1619 if (current_gdbarch
->dump_tdep
!= NULL
)
1620 current_gdbarch
->dump_tdep (current_gdbarch
, file
);
1623 struct gdbarch_tdep
*
1624 gdbarch_tdep (struct gdbarch
*gdbarch
)
1626 if (gdbarch_debug
>= 2)
1627 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1628 return gdbarch
->tdep
;
1632 const struct bfd_arch_info
*
1633 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1635 gdb_assert (gdbarch
!= NULL
);
1636 if (gdbarch_debug
>= 2)
1637 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1638 return gdbarch
->bfd_arch_info
;
1642 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1644 gdb_assert (gdbarch
!= NULL
);
1645 if (gdbarch_debug
>= 2)
1646 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1647 return gdbarch
->byte_order
;
1651 gdbarch_osabi (struct gdbarch
*gdbarch
)
1653 gdb_assert (gdbarch
!= NULL
);
1654 if (gdbarch_debug
>= 2)
1655 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1656 return gdbarch
->osabi
;
1660 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1662 gdb_assert (gdbarch
!= NULL
);
1663 /* Skip verify of short_bit, invalid_p == 0 */
1664 if (gdbarch_debug
>= 2)
1665 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1666 return gdbarch
->short_bit
;
1670 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1673 gdbarch
->short_bit
= short_bit
;
1677 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1679 gdb_assert (gdbarch
!= NULL
);
1680 /* Skip verify of int_bit, invalid_p == 0 */
1681 if (gdbarch_debug
>= 2)
1682 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1683 return gdbarch
->int_bit
;
1687 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1690 gdbarch
->int_bit
= int_bit
;
1694 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1696 gdb_assert (gdbarch
!= NULL
);
1697 /* Skip verify of long_bit, invalid_p == 0 */
1698 if (gdbarch_debug
>= 2)
1699 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1700 return gdbarch
->long_bit
;
1704 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1707 gdbarch
->long_bit
= long_bit
;
1711 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1713 gdb_assert (gdbarch
!= NULL
);
1714 /* Skip verify of long_long_bit, invalid_p == 0 */
1715 if (gdbarch_debug
>= 2)
1716 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1717 return gdbarch
->long_long_bit
;
1721 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1724 gdbarch
->long_long_bit
= long_long_bit
;
1728 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1730 gdb_assert (gdbarch
!= NULL
);
1731 /* Skip verify of float_bit, invalid_p == 0 */
1732 if (gdbarch_debug
>= 2)
1733 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1734 return gdbarch
->float_bit
;
1738 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1741 gdbarch
->float_bit
= float_bit
;
1745 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1747 gdb_assert (gdbarch
!= NULL
);
1748 /* Skip verify of double_bit, invalid_p == 0 */
1749 if (gdbarch_debug
>= 2)
1750 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1751 return gdbarch
->double_bit
;
1755 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1758 gdbarch
->double_bit
= double_bit
;
1762 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1764 gdb_assert (gdbarch
!= NULL
);
1765 /* Skip verify of long_double_bit, invalid_p == 0 */
1766 if (gdbarch_debug
>= 2)
1767 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1768 return gdbarch
->long_double_bit
;
1772 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1773 int long_double_bit
)
1775 gdbarch
->long_double_bit
= long_double_bit
;
1779 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1781 gdb_assert (gdbarch
!= NULL
);
1782 /* Skip verify of ptr_bit, invalid_p == 0 */
1783 if (gdbarch_debug
>= 2)
1784 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1785 return gdbarch
->ptr_bit
;
1789 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1792 gdbarch
->ptr_bit
= ptr_bit
;
1796 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1798 gdb_assert (gdbarch
!= NULL
);
1799 /* Check variable changed from pre-default. */
1800 gdb_assert (gdbarch
->addr_bit
!= 0);
1801 if (gdbarch_debug
>= 2)
1802 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1803 return gdbarch
->addr_bit
;
1807 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1810 gdbarch
->addr_bit
= addr_bit
;
1814 gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
)
1816 gdb_assert (gdbarch
!= NULL
);
1817 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1818 if (gdbarch_debug
>= 2)
1819 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_vma_bit called\n");
1820 return gdbarch
->bfd_vma_bit
;
1824 set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
,
1827 gdbarch
->bfd_vma_bit
= bfd_vma_bit
;
1831 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1833 gdb_assert (gdbarch
!= NULL
);
1834 /* Check variable changed from pre-default. */
1835 gdb_assert (gdbarch
->char_signed
!= -1);
1836 if (gdbarch_debug
>= 2)
1837 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1838 return gdbarch
->char_signed
;
1842 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1845 gdbarch
->char_signed
= char_signed
;
1849 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1851 gdb_assert (gdbarch
!= NULL
);
1852 return gdbarch
->read_pc
!= NULL
;
1856 gdbarch_read_pc (struct gdbarch
*gdbarch
, ptid_t ptid
)
1858 gdb_assert (gdbarch
!= NULL
);
1859 gdb_assert (gdbarch
->read_pc
!= NULL
);
1860 if (gdbarch_debug
>= 2)
1861 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1862 return gdbarch
->read_pc (ptid
);
1866 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1867 gdbarch_read_pc_ftype read_pc
)
1869 gdbarch
->read_pc
= read_pc
;
1873 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, ptid_t ptid
)
1875 gdb_assert (gdbarch
!= NULL
);
1876 gdb_assert (gdbarch
->write_pc
!= NULL
);
1877 if (gdbarch_debug
>= 2)
1878 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1879 gdbarch
->write_pc (val
, ptid
);
1883 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1884 gdbarch_write_pc_ftype write_pc
)
1886 gdbarch
->write_pc
= write_pc
;
1890 gdbarch_read_sp_p (struct gdbarch
*gdbarch
)
1892 gdb_assert (gdbarch
!= NULL
);
1893 return gdbarch
->read_sp
!= NULL
;
1897 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1899 gdb_assert (gdbarch
!= NULL
);
1900 gdb_assert (gdbarch
->read_sp
!= NULL
);
1901 if (gdbarch_debug
>= 2)
1902 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1903 return gdbarch
->read_sp ();
1907 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1908 gdbarch_read_sp_ftype read_sp
)
1910 gdbarch
->read_sp
= read_sp
;
1914 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1916 gdb_assert (gdbarch
!= NULL
);
1917 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1918 if (gdbarch_debug
>= 2)
1919 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1920 gdbarch
->virtual_frame_pointer (pc
, frame_regnum
, frame_offset
);
1924 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1925 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1927 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1931 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1933 gdb_assert (gdbarch
!= NULL
);
1934 return gdbarch
->pseudo_register_read
!= NULL
;
1938 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, void *buf
)
1940 gdb_assert (gdbarch
!= NULL
);
1941 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
1942 if (gdbarch_debug
>= 2)
1943 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
1944 gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
1948 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
1949 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
1951 gdbarch
->pseudo_register_read
= pseudo_register_read
;
1955 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
1957 gdb_assert (gdbarch
!= NULL
);
1958 return gdbarch
->pseudo_register_write
!= NULL
;
1962 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const void *buf
)
1964 gdb_assert (gdbarch
!= NULL
);
1965 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
1966 if (gdbarch_debug
>= 2)
1967 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
1968 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
1972 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
1973 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
1975 gdbarch
->pseudo_register_write
= pseudo_register_write
;
1979 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1981 gdb_assert (gdbarch
!= NULL
);
1982 /* Check variable changed from pre-default. */
1983 gdb_assert (gdbarch
->num_regs
!= -1);
1984 if (gdbarch_debug
>= 2)
1985 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1986 return gdbarch
->num_regs
;
1990 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1993 gdbarch
->num_regs
= num_regs
;
1997 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
1999 gdb_assert (gdbarch
!= NULL
);
2000 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2001 if (gdbarch_debug
>= 2)
2002 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
2003 return gdbarch
->num_pseudo_regs
;
2007 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
2008 int num_pseudo_regs
)
2010 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
2014 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
2016 gdb_assert (gdbarch
!= NULL
);
2017 /* Skip verify of sp_regnum, invalid_p == 0 */
2018 if (gdbarch_debug
>= 2)
2019 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
2020 return gdbarch
->sp_regnum
;
2024 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
2027 gdbarch
->sp_regnum
= sp_regnum
;
2031 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
2033 gdb_assert (gdbarch
!= NULL
);
2034 /* Skip verify of pc_regnum, invalid_p == 0 */
2035 if (gdbarch_debug
>= 2)
2036 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
2037 return gdbarch
->pc_regnum
;
2041 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
2044 gdbarch
->pc_regnum
= pc_regnum
;
2048 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
2050 gdb_assert (gdbarch
!= NULL
);
2051 /* Skip verify of ps_regnum, invalid_p == 0 */
2052 if (gdbarch_debug
>= 2)
2053 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
2054 return gdbarch
->ps_regnum
;
2058 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
2061 gdbarch
->ps_regnum
= ps_regnum
;
2065 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
2067 gdb_assert (gdbarch
!= NULL
);
2068 /* Skip verify of fp0_regnum, invalid_p == 0 */
2069 if (gdbarch_debug
>= 2)
2070 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
2071 return gdbarch
->fp0_regnum
;
2075 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
2078 gdbarch
->fp0_regnum
= fp0_regnum
;
2082 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
2084 gdb_assert (gdbarch
!= NULL
);
2085 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
2086 if (gdbarch_debug
>= 2)
2087 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
2088 return gdbarch
->stab_reg_to_regnum (stab_regnr
);
2092 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
2093 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
2095 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
2099 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
2101 gdb_assert (gdbarch
!= NULL
);
2102 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
2103 if (gdbarch_debug
>= 2)
2104 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
2105 return gdbarch
->ecoff_reg_to_regnum (ecoff_regnr
);
2109 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
2110 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
2112 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
2116 gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf_regnr
)
2118 gdb_assert (gdbarch
!= NULL
);
2119 gdb_assert (gdbarch
->dwarf_reg_to_regnum
!= NULL
);
2120 if (gdbarch_debug
>= 2)
2121 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf_reg_to_regnum called\n");
2122 return gdbarch
->dwarf_reg_to_regnum (dwarf_regnr
);
2126 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
,
2127 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum
)
2129 gdbarch
->dwarf_reg_to_regnum
= dwarf_reg_to_regnum
;
2133 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
2135 gdb_assert (gdbarch
!= NULL
);
2136 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
2137 if (gdbarch_debug
>= 2)
2138 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
2139 return gdbarch
->sdb_reg_to_regnum (sdb_regnr
);
2143 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
2144 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
2146 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
2150 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
2152 gdb_assert (gdbarch
!= NULL
);
2153 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
2154 if (gdbarch_debug
>= 2)
2155 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
2156 return gdbarch
->dwarf2_reg_to_regnum (dwarf2_regnr
);
2160 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
2161 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
2163 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
2167 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
2169 gdb_assert (gdbarch
!= NULL
);
2170 gdb_assert (gdbarch
->register_name
!= NULL
);
2171 if (gdbarch_debug
>= 2)
2172 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
2173 return gdbarch
->register_name (regnr
);
2177 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
2178 gdbarch_register_name_ftype register_name
)
2180 gdbarch
->register_name
= register_name
;
2184 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
2186 gdb_assert (gdbarch
!= NULL
);
2187 return gdbarch
->register_type
!= NULL
;
2191 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
2193 gdb_assert (gdbarch
!= NULL
);
2194 gdb_assert (gdbarch
->register_type
!= NULL
);
2195 if (gdbarch_debug
>= 2)
2196 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
2197 return gdbarch
->register_type (gdbarch
, reg_nr
);
2201 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
2202 gdbarch_register_type_ftype register_type
)
2204 gdbarch
->register_type
= register_type
;
2208 gdbarch_deprecated_register_byte_p (struct gdbarch
*gdbarch
)
2210 gdb_assert (gdbarch
!= NULL
);
2211 return gdbarch
->deprecated_register_byte
!= generic_register_byte
;
2215 gdbarch_deprecated_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
2217 gdb_assert (gdbarch
!= NULL
);
2218 gdb_assert (gdbarch
->deprecated_register_byte
!= NULL
);
2219 /* Do not check predicate: gdbarch->deprecated_register_byte != generic_register_byte, allow call. */
2220 if (gdbarch_debug
>= 2)
2221 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_register_byte called\n");
2222 return gdbarch
->deprecated_register_byte (reg_nr
);
2226 set_gdbarch_deprecated_register_byte (struct gdbarch
*gdbarch
,
2227 gdbarch_deprecated_register_byte_ftype deprecated_register_byte
)
2229 gdbarch
->deprecated_register_byte
= deprecated_register_byte
;
2233 gdbarch_unwind_dummy_id_p (struct gdbarch
*gdbarch
)
2235 gdb_assert (gdbarch
!= NULL
);
2236 return gdbarch
->unwind_dummy_id
!= NULL
;
2240 gdbarch_unwind_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*info
)
2242 gdb_assert (gdbarch
!= NULL
);
2243 gdb_assert (gdbarch
->unwind_dummy_id
!= NULL
);
2244 if (gdbarch_debug
>= 2)
2245 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_dummy_id called\n");
2246 return gdbarch
->unwind_dummy_id (gdbarch
, info
);
2250 set_gdbarch_unwind_dummy_id (struct gdbarch
*gdbarch
,
2251 gdbarch_unwind_dummy_id_ftype unwind_dummy_id
)
2253 gdbarch
->unwind_dummy_id
= unwind_dummy_id
;
2257 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
2259 gdb_assert (gdbarch
!= NULL
);
2260 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2261 if (gdbarch_debug
>= 2)
2262 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
2263 return gdbarch
->deprecated_fp_regnum
;
2267 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
2268 int deprecated_fp_regnum
)
2270 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
2274 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
2276 gdb_assert (gdbarch
!= NULL
);
2277 return gdbarch
->push_dummy_call
!= NULL
;
2281 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
)
2283 gdb_assert (gdbarch
!= NULL
);
2284 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
2285 if (gdbarch_debug
>= 2)
2286 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
2287 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
2291 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
2292 gdbarch_push_dummy_call_ftype push_dummy_call
)
2294 gdbarch
->push_dummy_call
= push_dummy_call
;
2298 gdbarch_deprecated_push_arguments_p (struct gdbarch
*gdbarch
)
2300 gdb_assert (gdbarch
!= NULL
);
2301 return gdbarch
->deprecated_push_arguments
!= NULL
;
2305 gdbarch_deprecated_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
2307 gdb_assert (gdbarch
!= NULL
);
2308 gdb_assert (gdbarch
->deprecated_push_arguments
!= NULL
);
2309 if (gdbarch_debug
>= 2)
2310 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_push_arguments called\n");
2311 return gdbarch
->deprecated_push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
);
2315 set_gdbarch_deprecated_push_arguments (struct gdbarch
*gdbarch
,
2316 gdbarch_deprecated_push_arguments_ftype deprecated_push_arguments
)
2318 gdbarch
->deprecated_push_arguments
= deprecated_push_arguments
;
2322 gdbarch_deprecated_register_size (struct gdbarch
*gdbarch
)
2324 gdb_assert (gdbarch
!= NULL
);
2325 if (gdbarch_debug
>= 2)
2326 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_register_size called\n");
2327 return gdbarch
->deprecated_register_size
;
2331 set_gdbarch_deprecated_register_size (struct gdbarch
*gdbarch
,
2332 int deprecated_register_size
)
2334 gdbarch
->deprecated_register_size
= deprecated_register_size
;
2338 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
2340 gdb_assert (gdbarch
!= NULL
);
2341 /* Skip verify of call_dummy_location, invalid_p == 0 */
2342 if (gdbarch_debug
>= 2)
2343 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
2344 return gdbarch
->call_dummy_location
;
2348 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
2349 int call_dummy_location
)
2351 gdbarch
->call_dummy_location
= call_dummy_location
;
2355 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
2357 gdb_assert (gdbarch
!= NULL
);
2358 return gdbarch
->push_dummy_code
!= NULL
;
2362 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
)
2364 gdb_assert (gdbarch
!= NULL
);
2365 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
2366 if (gdbarch_debug
>= 2)
2367 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
2368 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, using_gcc
, args
, nargs
, value_type
, real_pc
, bp_addr
);
2372 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
2373 gdbarch_push_dummy_code_ftype push_dummy_code
)
2375 gdbarch
->push_dummy_code
= push_dummy_code
;
2379 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
2381 gdb_assert (gdbarch
!= NULL
);
2382 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
2383 if (gdbarch_debug
>= 2)
2384 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
2385 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
2389 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
2390 gdbarch_print_registers_info_ftype print_registers_info
)
2392 gdbarch
->print_registers_info
= print_registers_info
;
2396 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
2398 gdb_assert (gdbarch
!= NULL
);
2399 return gdbarch
->print_float_info
!= NULL
;
2403 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2405 gdb_assert (gdbarch
!= NULL
);
2406 gdb_assert (gdbarch
->print_float_info
!= NULL
);
2407 if (gdbarch_debug
>= 2)
2408 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
2409 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
2413 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
2414 gdbarch_print_float_info_ftype print_float_info
)
2416 gdbarch
->print_float_info
= print_float_info
;
2420 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
2422 gdb_assert (gdbarch
!= NULL
);
2423 return gdbarch
->print_vector_info
!= NULL
;
2427 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2429 gdb_assert (gdbarch
!= NULL
);
2430 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
2431 if (gdbarch_debug
>= 2)
2432 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
2433 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
2437 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
2438 gdbarch_print_vector_info_ftype print_vector_info
)
2440 gdbarch
->print_vector_info
= print_vector_info
;
2444 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
2446 gdb_assert (gdbarch
!= NULL
);
2447 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
2448 if (gdbarch_debug
>= 2)
2449 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
2450 return gdbarch
->register_sim_regno (reg_nr
);
2454 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
2455 gdbarch_register_sim_regno_ftype register_sim_regno
)
2457 gdbarch
->register_sim_regno
= register_sim_regno
;
2461 gdbarch_register_bytes_ok_p (struct gdbarch
*gdbarch
)
2463 gdb_assert (gdbarch
!= NULL
);
2464 return gdbarch
->register_bytes_ok
!= NULL
;
2468 gdbarch_register_bytes_ok (struct gdbarch
*gdbarch
, long nr_bytes
)
2470 gdb_assert (gdbarch
!= NULL
);
2471 gdb_assert (gdbarch
->register_bytes_ok
!= NULL
);
2472 if (gdbarch_debug
>= 2)
2473 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes_ok called\n");
2474 return gdbarch
->register_bytes_ok (nr_bytes
);
2478 set_gdbarch_register_bytes_ok (struct gdbarch
*gdbarch
,
2479 gdbarch_register_bytes_ok_ftype register_bytes_ok
)
2481 gdbarch
->register_bytes_ok
= register_bytes_ok
;
2485 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
2487 gdb_assert (gdbarch
!= NULL
);
2488 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
2489 if (gdbarch_debug
>= 2)
2490 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
2491 return gdbarch
->cannot_fetch_register (regnum
);
2495 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
2496 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
2498 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
2502 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
2504 gdb_assert (gdbarch
!= NULL
);
2505 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
2506 if (gdbarch_debug
>= 2)
2507 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
2508 return gdbarch
->cannot_store_register (regnum
);
2512 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
2513 gdbarch_cannot_store_register_ftype cannot_store_register
)
2515 gdbarch
->cannot_store_register
= cannot_store_register
;
2519 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
2521 gdb_assert (gdbarch
!= NULL
);
2522 return gdbarch
->get_longjmp_target
!= NULL
;
2526 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, CORE_ADDR
*pc
)
2528 gdb_assert (gdbarch
!= NULL
);
2529 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
2530 if (gdbarch_debug
>= 2)
2531 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
2532 return gdbarch
->get_longjmp_target (pc
);
2536 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
2537 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
2539 gdbarch
->get_longjmp_target
= get_longjmp_target
;
2543 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
2545 gdb_assert (gdbarch
!= NULL
);
2546 if (gdbarch_debug
>= 2)
2547 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
2548 return gdbarch
->believe_pcc_promotion
;
2552 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
2553 int believe_pcc_promotion
)
2555 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2559 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
2561 gdb_assert (gdbarch
!= NULL
);
2562 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
2563 if (gdbarch_debug
>= 2)
2564 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
2565 return gdbarch
->convert_register_p (regnum
, type
);
2569 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
2570 gdbarch_convert_register_p_ftype convert_register_p
)
2572 gdbarch
->convert_register_p
= convert_register_p
;
2576 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, void *buf
)
2578 gdb_assert (gdbarch
!= NULL
);
2579 gdb_assert (gdbarch
->register_to_value
!= NULL
);
2580 if (gdbarch_debug
>= 2)
2581 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2582 gdbarch
->register_to_value (frame
, regnum
, type
, buf
);
2586 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2587 gdbarch_register_to_value_ftype register_to_value
)
2589 gdbarch
->register_to_value
= register_to_value
;
2593 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const void *buf
)
2595 gdb_assert (gdbarch
!= NULL
);
2596 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2597 if (gdbarch_debug
>= 2)
2598 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2599 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2603 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2604 gdbarch_value_to_register_ftype value_to_register
)
2606 gdbarch
->value_to_register
= value_to_register
;
2610 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const void *buf
)
2612 gdb_assert (gdbarch
!= NULL
);
2613 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2614 if (gdbarch_debug
>= 2)
2615 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2616 return gdbarch
->pointer_to_address (type
, buf
);
2620 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2621 gdbarch_pointer_to_address_ftype pointer_to_address
)
2623 gdbarch
->pointer_to_address
= pointer_to_address
;
2627 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, void *buf
, CORE_ADDR addr
)
2629 gdb_assert (gdbarch
!= NULL
);
2630 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2631 if (gdbarch_debug
>= 2)
2632 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2633 gdbarch
->address_to_pointer (type
, buf
, addr
);
2637 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2638 gdbarch_address_to_pointer_ftype address_to_pointer
)
2640 gdbarch
->address_to_pointer
= address_to_pointer
;
2644 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2646 gdb_assert (gdbarch
!= NULL
);
2647 return gdbarch
->integer_to_address
!= NULL
;
2651 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, void *buf
)
2653 gdb_assert (gdbarch
!= NULL
);
2654 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2655 if (gdbarch_debug
>= 2)
2656 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2657 return gdbarch
->integer_to_address (type
, buf
);
2661 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2662 gdbarch_integer_to_address_ftype integer_to_address
)
2664 gdbarch
->integer_to_address
= integer_to_address
;
2668 gdbarch_deprecated_store_struct_return_p (struct gdbarch
*gdbarch
)
2670 gdb_assert (gdbarch
!= NULL
);
2671 return gdbarch
->deprecated_store_struct_return
!= NULL
;
2675 gdbarch_deprecated_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2677 gdb_assert (gdbarch
!= NULL
);
2678 gdb_assert (gdbarch
->deprecated_store_struct_return
!= NULL
);
2679 if (gdbarch_debug
>= 2)
2680 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_store_struct_return called\n");
2681 gdbarch
->deprecated_store_struct_return (addr
, sp
);
2685 set_gdbarch_deprecated_store_struct_return (struct gdbarch
*gdbarch
,
2686 gdbarch_deprecated_store_struct_return_ftype deprecated_store_struct_return
)
2688 gdbarch
->deprecated_store_struct_return
= deprecated_store_struct_return
;
2692 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2694 gdb_assert (gdbarch
!= NULL
);
2695 return gdbarch
->return_value
!= legacy_return_value
;
2698 enum return_value_convention
2699 gdbarch_return_value (struct gdbarch
*gdbarch
, struct type
*valtype
, struct regcache
*regcache
, void *readbuf
, const void *writebuf
)
2701 gdb_assert (gdbarch
!= NULL
);
2702 gdb_assert (gdbarch
->return_value
!= NULL
);
2703 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2704 if (gdbarch_debug
>= 2)
2705 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2706 return gdbarch
->return_value (gdbarch
, valtype
, regcache
, readbuf
, writebuf
);
2710 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2711 gdbarch_return_value_ftype return_value
)
2713 gdbarch
->return_value
= return_value
;
2717 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, struct regcache
*regcache
, void *valbuf
)
2719 gdb_assert (gdbarch
!= NULL
);
2720 gdb_assert (gdbarch
->extract_return_value
!= NULL
);
2721 if (gdbarch_debug
>= 2)
2722 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
2723 gdbarch
->extract_return_value (type
, regcache
, valbuf
);
2727 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
2728 gdbarch_extract_return_value_ftype extract_return_value
)
2730 gdbarch
->extract_return_value
= extract_return_value
;
2734 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, struct regcache
*regcache
, const void *valbuf
)
2736 gdb_assert (gdbarch
!= NULL
);
2737 gdb_assert (gdbarch
->store_return_value
!= NULL
);
2738 if (gdbarch_debug
>= 2)
2739 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2740 gdbarch
->store_return_value (type
, regcache
, valbuf
);
2744 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2745 gdbarch_store_return_value_ftype store_return_value
)
2747 gdbarch
->store_return_value
= store_return_value
;
2751 gdbarch_deprecated_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
)
2753 gdb_assert (gdbarch
!= NULL
);
2754 gdb_assert (gdbarch
->deprecated_extract_return_value
!= NULL
);
2755 if (gdbarch_debug
>= 2)
2756 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_extract_return_value called\n");
2757 gdbarch
->deprecated_extract_return_value (type
, regbuf
, valbuf
);
2761 set_gdbarch_deprecated_extract_return_value (struct gdbarch
*gdbarch
,
2762 gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value
)
2764 gdbarch
->deprecated_extract_return_value
= deprecated_extract_return_value
;
2768 gdbarch_deprecated_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
)
2770 gdb_assert (gdbarch
!= NULL
);
2771 gdb_assert (gdbarch
->deprecated_store_return_value
!= NULL
);
2772 if (gdbarch_debug
>= 2)
2773 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_store_return_value called\n");
2774 gdbarch
->deprecated_store_return_value (type
, valbuf
);
2778 set_gdbarch_deprecated_store_return_value (struct gdbarch
*gdbarch
,
2779 gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value
)
2781 gdbarch
->deprecated_store_return_value
= deprecated_store_return_value
;
2785 gdbarch_deprecated_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2787 gdb_assert (gdbarch
!= NULL
);
2788 gdb_assert (gdbarch
->deprecated_use_struct_convention
!= NULL
);
2789 if (gdbarch_debug
>= 2)
2790 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_use_struct_convention called\n");
2791 return gdbarch
->deprecated_use_struct_convention (gcc_p
, value_type
);
2795 set_gdbarch_deprecated_use_struct_convention (struct gdbarch
*gdbarch
,
2796 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention
)
2798 gdbarch
->deprecated_use_struct_convention
= deprecated_use_struct_convention
;
2802 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch
*gdbarch
)
2804 gdb_assert (gdbarch
!= NULL
);
2805 return gdbarch
->deprecated_extract_struct_value_address
!= NULL
;
2809 gdbarch_deprecated_extract_struct_value_address (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
2811 gdb_assert (gdbarch
!= NULL
);
2812 gdb_assert (gdbarch
->deprecated_extract_struct_value_address
!= NULL
);
2813 if (gdbarch_debug
>= 2)
2814 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_extract_struct_value_address called\n");
2815 return gdbarch
->deprecated_extract_struct_value_address (regcache
);
2819 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch
*gdbarch
,
2820 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address
)
2822 gdbarch
->deprecated_extract_struct_value_address
= deprecated_extract_struct_value_address
;
2826 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2828 gdb_assert (gdbarch
!= NULL
);
2829 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2830 if (gdbarch_debug
>= 2)
2831 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2832 return gdbarch
->skip_prologue (ip
);
2836 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2837 gdbarch_skip_prologue_ftype skip_prologue
)
2839 gdbarch
->skip_prologue
= skip_prologue
;
2843 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2845 gdb_assert (gdbarch
!= NULL
);
2846 gdb_assert (gdbarch
->inner_than
!= NULL
);
2847 if (gdbarch_debug
>= 2)
2848 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2849 return gdbarch
->inner_than (lhs
, rhs
);
2853 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2854 gdbarch_inner_than_ftype inner_than
)
2856 gdbarch
->inner_than
= inner_than
;
2859 const unsigned char *
2860 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2862 gdb_assert (gdbarch
!= NULL
);
2863 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2864 if (gdbarch_debug
>= 2)
2865 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2866 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2870 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2871 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2873 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2877 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2879 gdb_assert (gdbarch
!= NULL
);
2880 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2884 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2886 gdb_assert (gdbarch
!= NULL
);
2887 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2888 if (gdbarch_debug
>= 2)
2889 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2890 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2894 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2895 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2897 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2901 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2903 gdb_assert (gdbarch
!= NULL
);
2904 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2905 if (gdbarch_debug
>= 2)
2906 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2907 return gdbarch
->memory_insert_breakpoint (addr
, contents_cache
);
2911 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2912 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2914 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2918 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2920 gdb_assert (gdbarch
!= NULL
);
2921 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2922 if (gdbarch_debug
>= 2)
2923 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2924 return gdbarch
->memory_remove_breakpoint (addr
, contents_cache
);
2928 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2929 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2931 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2935 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2937 gdb_assert (gdbarch
!= NULL
);
2938 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2939 if (gdbarch_debug
>= 2)
2940 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2941 return gdbarch
->decr_pc_after_break
;
2945 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2946 CORE_ADDR decr_pc_after_break
)
2948 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2952 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
2954 gdb_assert (gdbarch
!= NULL
);
2955 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2956 if (gdbarch_debug
>= 2)
2957 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
2958 return gdbarch
->deprecated_function_start_offset
;
2962 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
2963 CORE_ADDR deprecated_function_start_offset
)
2965 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
2969 gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR gdb_addr
, int gdb_len
, CORE_ADDR
*rem_addr
, int *rem_len
)
2971 gdb_assert (gdbarch
!= NULL
);
2972 gdb_assert (gdbarch
->remote_translate_xfer_address
!= NULL
);
2973 if (gdbarch_debug
>= 2)
2974 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
2975 gdbarch
->remote_translate_xfer_address (gdbarch
, regcache
, gdb_addr
, gdb_len
, rem_addr
, rem_len
);
2979 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
2980 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
2982 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
2986 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2988 gdb_assert (gdbarch
!= NULL
);
2989 /* Skip verify of frame_args_skip, invalid_p == 0 */
2990 if (gdbarch_debug
>= 2)
2991 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2992 return gdbarch
->frame_args_skip
;
2996 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2997 CORE_ADDR frame_args_skip
)
2999 gdbarch
->frame_args_skip
= frame_args_skip
;
3003 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
3005 gdb_assert (gdbarch
!= NULL
);
3006 return gdbarch
->unwind_pc
!= NULL
;
3010 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
3012 gdb_assert (gdbarch
!= NULL
);
3013 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
3014 if (gdbarch_debug
>= 2)
3015 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
3016 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
3020 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
3021 gdbarch_unwind_pc_ftype unwind_pc
)
3023 gdbarch
->unwind_pc
= unwind_pc
;
3027 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
3029 gdb_assert (gdbarch
!= NULL
);
3030 return gdbarch
->unwind_sp
!= NULL
;
3034 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
3036 gdb_assert (gdbarch
!= NULL
);
3037 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
3038 if (gdbarch_debug
>= 2)
3039 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
3040 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
3044 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
3045 gdbarch_unwind_sp_ftype unwind_sp
)
3047 gdbarch
->unwind_sp
= unwind_sp
;
3051 gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch
*gdbarch
)
3053 gdb_assert (gdbarch
!= NULL
);
3054 return gdbarch
->deprecated_saved_pc_after_call
!= NULL
;
3058 gdbarch_deprecated_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3060 gdb_assert (gdbarch
!= NULL
);
3061 gdb_assert (gdbarch
->deprecated_saved_pc_after_call
!= NULL
);
3062 if (gdbarch_debug
>= 2)
3063 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_saved_pc_after_call called\n");
3064 return gdbarch
->deprecated_saved_pc_after_call (frame
);
3068 set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch
*gdbarch
,
3069 gdbarch_deprecated_saved_pc_after_call_ftype deprecated_saved_pc_after_call
)
3071 gdbarch
->deprecated_saved_pc_after_call
= deprecated_saved_pc_after_call
;
3075 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
3077 gdb_assert (gdbarch
!= NULL
);
3078 return gdbarch
->frame_num_args
!= NULL
;
3082 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3084 gdb_assert (gdbarch
!= NULL
);
3085 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
3086 if (gdbarch_debug
>= 2)
3087 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
3088 return gdbarch
->frame_num_args (frame
);
3092 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
3093 gdbarch_frame_num_args_ftype frame_num_args
)
3095 gdbarch
->frame_num_args
= frame_num_args
;
3099 gdbarch_deprecated_stack_align_p (struct gdbarch
*gdbarch
)
3101 gdb_assert (gdbarch
!= NULL
);
3102 return gdbarch
->deprecated_stack_align
!= NULL
;
3106 gdbarch_deprecated_stack_align (struct gdbarch
*gdbarch
, CORE_ADDR sp
)
3108 gdb_assert (gdbarch
!= NULL
);
3109 gdb_assert (gdbarch
->deprecated_stack_align
!= NULL
);
3110 if (gdbarch_debug
>= 2)
3111 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_stack_align called\n");
3112 return gdbarch
->deprecated_stack_align (sp
);
3116 set_gdbarch_deprecated_stack_align (struct gdbarch
*gdbarch
,
3117 gdbarch_deprecated_stack_align_ftype deprecated_stack_align
)
3119 gdbarch
->deprecated_stack_align
= deprecated_stack_align
;
3123 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
3125 gdb_assert (gdbarch
!= NULL
);
3126 return gdbarch
->frame_align
!= NULL
;
3130 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
3132 gdb_assert (gdbarch
!= NULL
);
3133 gdb_assert (gdbarch
->frame_align
!= NULL
);
3134 if (gdbarch_debug
>= 2)
3135 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
3136 return gdbarch
->frame_align (gdbarch
, address
);
3140 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
3141 gdbarch_frame_align_ftype frame_align
)
3143 gdbarch
->frame_align
= frame_align
;
3147 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch
*gdbarch
)
3149 gdb_assert (gdbarch
!= NULL
);
3150 return gdbarch
->deprecated_reg_struct_has_addr
!= NULL
;
3154 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*type
)
3156 gdb_assert (gdbarch
!= NULL
);
3157 gdb_assert (gdbarch
->deprecated_reg_struct_has_addr
!= NULL
);
3158 if (gdbarch_debug
>= 2)
3159 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_reg_struct_has_addr called\n");
3160 return gdbarch
->deprecated_reg_struct_has_addr (gcc_p
, type
);
3164 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch
*gdbarch
,
3165 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr
)
3167 gdbarch
->deprecated_reg_struct_has_addr
= deprecated_reg_struct_has_addr
;
3171 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
3173 gdb_assert (gdbarch
!= NULL
);
3174 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
3175 if (gdbarch_debug
>= 2)
3176 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
3177 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
3181 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
3182 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
3184 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
3188 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
3190 gdb_assert (gdbarch
!= NULL
);
3191 if (gdbarch_debug
>= 2)
3192 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
3193 return gdbarch
->frame_red_zone_size
;
3197 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
3198 int frame_red_zone_size
)
3200 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
3203 const struct floatformat
*
3204 gdbarch_float_format (struct gdbarch
*gdbarch
)
3206 gdb_assert (gdbarch
!= NULL
);
3207 if (gdbarch_debug
>= 2)
3208 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
3209 return gdbarch
->float_format
;
3213 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
3214 const struct floatformat
* float_format
)
3216 gdbarch
->float_format
= float_format
;
3219 const struct floatformat
*
3220 gdbarch_double_format (struct gdbarch
*gdbarch
)
3222 gdb_assert (gdbarch
!= NULL
);
3223 if (gdbarch_debug
>= 2)
3224 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
3225 return gdbarch
->double_format
;
3229 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
3230 const struct floatformat
* double_format
)
3232 gdbarch
->double_format
= double_format
;
3235 const struct floatformat
*
3236 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
3238 gdb_assert (gdbarch
!= NULL
);
3239 if (gdbarch_debug
>= 2)
3240 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
3241 return gdbarch
->long_double_format
;
3245 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
3246 const struct floatformat
* long_double_format
)
3248 gdbarch
->long_double_format
= long_double_format
;
3252 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
3254 gdb_assert (gdbarch
!= NULL
);
3255 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
3256 if (gdbarch_debug
>= 2)
3257 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
3258 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
3262 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
3263 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
3265 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
3269 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3271 gdb_assert (gdbarch
!= NULL
);
3272 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
3273 if (gdbarch_debug
>= 2)
3274 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
3275 return gdbarch
->addr_bits_remove (addr
);
3279 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
3280 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
3282 gdbarch
->addr_bits_remove
= addr_bits_remove
;
3286 gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3288 gdb_assert (gdbarch
!= NULL
);
3289 gdb_assert (gdbarch
->smash_text_address
!= NULL
);
3290 if (gdbarch_debug
>= 2)
3291 fprintf_unfiltered (gdb_stdlog
, "gdbarch_smash_text_address called\n");
3292 return gdbarch
->smash_text_address (addr
);
3296 set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
,
3297 gdbarch_smash_text_address_ftype smash_text_address
)
3299 gdbarch
->smash_text_address
= smash_text_address
;
3303 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
3305 gdb_assert (gdbarch
!= NULL
);
3306 return gdbarch
->software_single_step
!= NULL
;
3310 gdbarch_software_single_step (struct gdbarch
*gdbarch
, enum target_signal sig
, int insert_breakpoints_p
)
3312 gdb_assert (gdbarch
!= NULL
);
3313 gdb_assert (gdbarch
->software_single_step
!= NULL
);
3314 if (gdbarch_debug
>= 2)
3315 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
3316 gdbarch
->software_single_step (sig
, insert_breakpoints_p
);
3320 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
3321 gdbarch_software_single_step_ftype software_single_step
)
3323 gdbarch
->software_single_step
= software_single_step
;
3327 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
3329 gdb_assert (gdbarch
!= NULL
);
3330 gdb_assert (gdbarch
->print_insn
!= NULL
);
3331 if (gdbarch_debug
>= 2)
3332 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
3333 return gdbarch
->print_insn (vma
, info
);
3337 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
3338 gdbarch_print_insn_ftype print_insn
)
3340 gdbarch
->print_insn
= print_insn
;
3344 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
3346 gdb_assert (gdbarch
!= NULL
);
3347 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
3348 if (gdbarch_debug
>= 2)
3349 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
3350 return gdbarch
->skip_trampoline_code (pc
);
3354 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
3355 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
3357 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
3361 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
3363 gdb_assert (gdbarch
!= NULL
);
3364 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
3365 if (gdbarch_debug
>= 2)
3366 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
3367 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
3371 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
3372 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
3374 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
3378 gdbarch_in_solib_call_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
)
3380 gdb_assert (gdbarch
!= NULL
);
3381 gdb_assert (gdbarch
->in_solib_call_trampoline
!= NULL
);
3382 if (gdbarch_debug
>= 2)
3383 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_call_trampoline called\n");
3384 return gdbarch
->in_solib_call_trampoline (pc
, name
);
3388 set_gdbarch_in_solib_call_trampoline (struct gdbarch
*gdbarch
,
3389 gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline
)
3391 gdbarch
->in_solib_call_trampoline
= in_solib_call_trampoline
;
3395 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
)
3397 gdb_assert (gdbarch
!= NULL
);
3398 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
3399 if (gdbarch_debug
>= 2)
3400 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
3401 return gdbarch
->in_solib_return_trampoline (pc
, name
);
3405 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
3406 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
3408 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
3412 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3414 gdb_assert (gdbarch
!= NULL
);
3415 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
3416 if (gdbarch_debug
>= 2)
3417 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
3418 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
3422 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
3423 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
3425 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
3429 gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
, int argc
, char **argv
)
3431 gdb_assert (gdbarch
!= NULL
);
3432 gdb_assert (gdbarch
->construct_inferior_arguments
!= NULL
);
3433 if (gdbarch_debug
>= 2)
3434 fprintf_unfiltered (gdb_stdlog
, "gdbarch_construct_inferior_arguments called\n");
3435 return gdbarch
->construct_inferior_arguments (gdbarch
, argc
, argv
);
3439 set_gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
,
3440 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments
)
3442 gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
3446 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
3448 gdb_assert (gdbarch
!= NULL
);
3449 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
3450 if (gdbarch_debug
>= 2)
3451 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
3452 gdbarch
->elf_make_msymbol_special (sym
, msym
);
3456 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
3457 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
3459 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
3463 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
3465 gdb_assert (gdbarch
!= NULL
);
3466 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
3467 if (gdbarch_debug
>= 2)
3468 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
3469 gdbarch
->coff_make_msymbol_special (val
, msym
);
3473 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
3474 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
3476 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
3480 gdbarch_name_of_malloc (struct gdbarch
*gdbarch
)
3482 gdb_assert (gdbarch
!= NULL
);
3483 /* Skip verify of name_of_malloc, invalid_p == 0 */
3484 if (gdbarch_debug
>= 2)
3485 fprintf_unfiltered (gdb_stdlog
, "gdbarch_name_of_malloc called\n");
3486 return gdbarch
->name_of_malloc
;
3490 set_gdbarch_name_of_malloc (struct gdbarch
*gdbarch
,
3491 const char * name_of_malloc
)
3493 gdbarch
->name_of_malloc
= name_of_malloc
;
3497 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
3499 gdb_assert (gdbarch
!= NULL
);
3500 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3501 if (gdbarch_debug
>= 2)
3502 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
3503 return gdbarch
->cannot_step_breakpoint
;
3507 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
3508 int cannot_step_breakpoint
)
3510 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
3514 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
3516 gdb_assert (gdbarch
!= NULL
);
3517 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3518 if (gdbarch_debug
>= 2)
3519 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
3520 return gdbarch
->have_nonsteppable_watchpoint
;
3524 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
3525 int have_nonsteppable_watchpoint
)
3527 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
3531 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
3533 gdb_assert (gdbarch
!= NULL
);
3534 return gdbarch
->address_class_type_flags
!= NULL
;
3538 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
3540 gdb_assert (gdbarch
!= NULL
);
3541 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
3542 if (gdbarch_debug
>= 2)
3543 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
3544 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
3548 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
3549 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
3551 gdbarch
->address_class_type_flags
= address_class_type_flags
;
3555 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
3557 gdb_assert (gdbarch
!= NULL
);
3558 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
3562 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
3564 gdb_assert (gdbarch
!= NULL
);
3565 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
3566 if (gdbarch_debug
>= 2)
3567 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
3568 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
3572 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
3573 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
3575 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
3579 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
3581 gdb_assert (gdbarch
!= NULL
);
3582 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
3586 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
3588 gdb_assert (gdbarch
!= NULL
);
3589 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
3590 if (gdbarch_debug
>= 2)
3591 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
3592 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
3596 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
3597 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
3599 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
3603 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
3605 gdb_assert (gdbarch
!= NULL
);
3606 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
3607 if (gdbarch_debug
>= 2)
3608 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
3609 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
3613 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
3614 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
3616 gdbarch
->register_reggroup_p
= register_reggroup_p
;
3620 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
3622 gdb_assert (gdbarch
!= NULL
);
3623 return gdbarch
->fetch_pointer_argument
!= NULL
;
3627 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
3629 gdb_assert (gdbarch
!= NULL
);
3630 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
3631 if (gdbarch_debug
>= 2)
3632 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
3633 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
3637 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
3638 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
3640 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
3644 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
3646 gdb_assert (gdbarch
!= NULL
);
3647 return gdbarch
->regset_from_core_section
!= NULL
;
3650 const struct regset
*
3651 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
3653 gdb_assert (gdbarch
!= NULL
);
3654 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
3655 if (gdbarch_debug
>= 2)
3656 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
3657 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
3661 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
3662 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
3664 gdbarch
->regset_from_core_section
= regset_from_core_section
;
3668 /* Keep a registry of per-architecture data-pointers required by GDB
3675 gdbarch_data_pre_init_ftype
*pre_init
;
3676 gdbarch_data_post_init_ftype
*post_init
;
3679 struct gdbarch_data_registration
3681 struct gdbarch_data
*data
;
3682 struct gdbarch_data_registration
*next
;
3685 struct gdbarch_data_registry
3688 struct gdbarch_data_registration
*registrations
;
3691 struct gdbarch_data_registry gdbarch_data_registry
=
3696 static struct gdbarch_data
*
3697 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
3698 gdbarch_data_post_init_ftype
*post_init
)
3700 struct gdbarch_data_registration
**curr
;
3701 /* Append the new registraration. */
3702 for (curr
= &gdbarch_data_registry
.registrations
;
3704 curr
= &(*curr
)->next
);
3705 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
3706 (*curr
)->next
= NULL
;
3707 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
3708 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
3709 (*curr
)->data
->pre_init
= pre_init
;
3710 (*curr
)->data
->post_init
= post_init
;
3711 (*curr
)->data
->init_p
= 1;
3712 return (*curr
)->data
;
3715 struct gdbarch_data
*
3716 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
3718 return gdbarch_data_register (pre_init
, NULL
);
3721 struct gdbarch_data
*
3722 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
3724 return gdbarch_data_register (NULL
, post_init
);
3727 /* Create/delete the gdbarch data vector. */
3730 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
3732 gdb_assert (gdbarch
->data
== NULL
);
3733 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
3734 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
3737 /* Initialize the current value of the specified per-architecture
3741 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
3742 struct gdbarch_data
*data
,
3745 gdb_assert (data
->index
< gdbarch
->nr_data
);
3746 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
3747 gdb_assert (data
->pre_init
== NULL
);
3748 gdbarch
->data
[data
->index
] = pointer
;
3751 /* Return the current value of the specified per-architecture
3755 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
3757 gdb_assert (data
->index
< gdbarch
->nr_data
);
3758 if (gdbarch
->data
[data
->index
] == NULL
)
3760 /* The data-pointer isn't initialized, call init() to get a
3762 if (data
->pre_init
!= NULL
)
3763 /* Mid architecture creation: pass just the obstack, and not
3764 the entire architecture, as that way it isn't possible for
3765 pre-init code to refer to undefined architecture
3767 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
3768 else if (gdbarch
->initialized_p
3769 && data
->post_init
!= NULL
)
3770 /* Post architecture creation: pass the entire architecture
3771 (as all fields are valid), but be careful to also detect
3772 recursive references. */
3774 gdb_assert (data
->init_p
);
3776 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
3780 /* The architecture initialization hasn't completed - punt -
3781 hope that the caller knows what they are doing. Once
3782 deprecated_set_gdbarch_data has been initialized, this can be
3783 changed to an internal error. */
3785 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
3787 return gdbarch
->data
[data
->index
];
3792 /* Keep a registry of swapped data required by GDB modules. */
3797 struct gdbarch_swap_registration
*source
;
3798 struct gdbarch_swap
*next
;
3801 struct gdbarch_swap_registration
3804 unsigned long sizeof_data
;
3805 gdbarch_swap_ftype
*init
;
3806 struct gdbarch_swap_registration
*next
;
3809 struct gdbarch_swap_registry
3812 struct gdbarch_swap_registration
*registrations
;
3815 struct gdbarch_swap_registry gdbarch_swap_registry
=
3821 deprecated_register_gdbarch_swap (void *data
,
3822 unsigned long sizeof_data
,
3823 gdbarch_swap_ftype
*init
)
3825 struct gdbarch_swap_registration
**rego
;
3826 for (rego
= &gdbarch_swap_registry
.registrations
;
3828 rego
= &(*rego
)->next
);
3829 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
3830 (*rego
)->next
= NULL
;
3831 (*rego
)->init
= init
;
3832 (*rego
)->data
= data
;
3833 (*rego
)->sizeof_data
= sizeof_data
;
3837 current_gdbarch_swap_init_hack (void)
3839 struct gdbarch_swap_registration
*rego
;
3840 struct gdbarch_swap
**curr
= ¤t_gdbarch
->swap
;
3841 for (rego
= gdbarch_swap_registry
.registrations
;
3845 if (rego
->data
!= NULL
)
3847 (*curr
) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch
,
3848 struct gdbarch_swap
);
3849 (*curr
)->source
= rego
;
3850 (*curr
)->swap
= gdbarch_obstack_zalloc (current_gdbarch
,
3852 (*curr
)->next
= NULL
;
3853 curr
= &(*curr
)->next
;
3855 if (rego
->init
!= NULL
)
3860 static struct gdbarch
*
3861 current_gdbarch_swap_out_hack (void)
3863 struct gdbarch
*old_gdbarch
= current_gdbarch
;
3864 struct gdbarch_swap
*curr
;
3866 gdb_assert (old_gdbarch
!= NULL
);
3867 for (curr
= old_gdbarch
->swap
;
3871 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
3872 memset (curr
->source
->data
, 0, curr
->source
->sizeof_data
);
3874 current_gdbarch
= NULL
;
3879 current_gdbarch_swap_in_hack (struct gdbarch
*new_gdbarch
)
3881 struct gdbarch_swap
*curr
;
3883 gdb_assert (current_gdbarch
== NULL
);
3884 for (curr
= new_gdbarch
->swap
;
3887 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
3888 current_gdbarch
= new_gdbarch
;
3892 /* Keep a registry of the architectures known by GDB. */
3894 struct gdbarch_registration
3896 enum bfd_architecture bfd_architecture
;
3897 gdbarch_init_ftype
*init
;
3898 gdbarch_dump_tdep_ftype
*dump_tdep
;
3899 struct gdbarch_list
*arches
;
3900 struct gdbarch_registration
*next
;
3903 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
3906 append_name (const char ***buf
, int *nr
, const char *name
)
3908 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
3914 gdbarch_printable_names (void)
3916 /* Accumulate a list of names based on the registed list of
3918 enum bfd_architecture a
;
3920 const char **arches
= NULL
;
3921 struct gdbarch_registration
*rego
;
3922 for (rego
= gdbarch_registry
;
3926 const struct bfd_arch_info
*ap
;
3927 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3929 internal_error (__FILE__
, __LINE__
,
3930 "gdbarch_architecture_names: multi-arch unknown");
3933 append_name (&arches
, &nr_arches
, ap
->printable_name
);
3938 append_name (&arches
, &nr_arches
, NULL
);
3944 gdbarch_register (enum bfd_architecture bfd_architecture
,
3945 gdbarch_init_ftype
*init
,
3946 gdbarch_dump_tdep_ftype
*dump_tdep
)
3948 struct gdbarch_registration
**curr
;
3949 const struct bfd_arch_info
*bfd_arch_info
;
3950 /* Check that BFD recognizes this architecture */
3951 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
3952 if (bfd_arch_info
== NULL
)
3954 internal_error (__FILE__
, __LINE__
,
3955 "gdbarch: Attempt to register unknown architecture (%d)",
3958 /* Check that we haven't seen this architecture before */
3959 for (curr
= &gdbarch_registry
;
3961 curr
= &(*curr
)->next
)
3963 if (bfd_architecture
== (*curr
)->bfd_architecture
)
3964 internal_error (__FILE__
, __LINE__
,
3965 "gdbarch: Duplicate registraration of architecture (%s)",
3966 bfd_arch_info
->printable_name
);
3970 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
3971 bfd_arch_info
->printable_name
,
3974 (*curr
) = XMALLOC (struct gdbarch_registration
);
3975 (*curr
)->bfd_architecture
= bfd_architecture
;
3976 (*curr
)->init
= init
;
3977 (*curr
)->dump_tdep
= dump_tdep
;
3978 (*curr
)->arches
= NULL
;
3979 (*curr
)->next
= NULL
;
3983 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
3984 gdbarch_init_ftype
*init
)
3986 gdbarch_register (bfd_architecture
, init
, NULL
);
3990 /* Look for an architecture using gdbarch_info. Base search on only
3991 BFD_ARCH_INFO and BYTE_ORDER. */
3993 struct gdbarch_list
*
3994 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
3995 const struct gdbarch_info
*info
)
3997 for (; arches
!= NULL
; arches
= arches
->next
)
3999 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
4001 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
4003 if (info
->osabi
!= arches
->gdbarch
->osabi
)
4011 /* Find an architecture that matches the specified INFO. Create a new
4012 architecture if needed. Return that new architecture. Assumes
4013 that there is no current architecture. */
4015 static struct gdbarch
*
4016 find_arch_by_info (struct gdbarch
*old_gdbarch
, struct gdbarch_info info
)
4018 struct gdbarch
*new_gdbarch
;
4019 struct gdbarch_registration
*rego
;
4021 /* The existing architecture has been swapped out - all this code
4022 works from a clean slate. */
4023 gdb_assert (current_gdbarch
== NULL
);
4025 /* Fill in missing parts of the INFO struct using a number of
4026 sources: "set ..."; INFOabfd supplied; and the existing
4028 gdbarch_info_fill (old_gdbarch
, &info
);
4030 /* Must have found some sort of architecture. */
4031 gdb_assert (info
.bfd_arch_info
!= NULL
);
4035 fprintf_unfiltered (gdb_stdlog
,
4036 "find_arch_by_info: info.bfd_arch_info %s\n",
4037 (info
.bfd_arch_info
!= NULL
4038 ? info
.bfd_arch_info
->printable_name
4040 fprintf_unfiltered (gdb_stdlog
,
4041 "find_arch_by_info: info.byte_order %d (%s)\n",
4043 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
4044 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
4046 fprintf_unfiltered (gdb_stdlog
,
4047 "find_arch_by_info: info.osabi %d (%s)\n",
4048 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
4049 fprintf_unfiltered (gdb_stdlog
,
4050 "find_arch_by_info: info.abfd 0x%lx\n",
4052 fprintf_unfiltered (gdb_stdlog
,
4053 "find_arch_by_info: info.tdep_info 0x%lx\n",
4054 (long) info
.tdep_info
);
4057 /* Find the tdep code that knows about this architecture. */
4058 for (rego
= gdbarch_registry
;
4061 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
4066 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4067 "No matching architecture\n");
4071 /* Ask the tdep code for an architecture that matches "info". */
4072 new_gdbarch
= rego
->init (info
, rego
->arches
);
4074 /* Did the tdep code like it? No. Reject the change and revert to
4075 the old architecture. */
4076 if (new_gdbarch
== NULL
)
4079 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4080 "Target rejected architecture\n");
4084 /* Is this a pre-existing architecture (as determined by already
4085 being initialized)? Move it to the front of the architecture
4086 list (keeping the list sorted Most Recently Used). */
4087 if (new_gdbarch
->initialized_p
)
4089 struct gdbarch_list
**list
;
4090 struct gdbarch_list
*this;
4092 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4093 "Previous architecture 0x%08lx (%s) selected\n",
4095 new_gdbarch
->bfd_arch_info
->printable_name
);
4096 /* Find the existing arch in the list. */
4097 for (list
= ®o
->arches
;
4098 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
4099 list
= &(*list
)->next
);
4100 /* It had better be in the list of architectures. */
4101 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
4104 (*list
) = this->next
;
4105 /* Insert THIS at the front. */
4106 this->next
= rego
->arches
;
4107 rego
->arches
= this;
4112 /* It's a new architecture. */
4114 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4115 "New architecture 0x%08lx (%s) selected\n",
4117 new_gdbarch
->bfd_arch_info
->printable_name
);
4119 /* Insert the new architecture into the front of the architecture
4120 list (keep the list sorted Most Recently Used). */
4122 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
4123 this->next
= rego
->arches
;
4124 this->gdbarch
= new_gdbarch
;
4125 rego
->arches
= this;
4128 /* Check that the newly installed architecture is valid. Plug in
4129 any post init values. */
4130 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
4131 verify_gdbarch (new_gdbarch
);
4132 new_gdbarch
->initialized_p
= 1;
4134 /* Initialize any per-architecture swap areas. This phase requires
4135 a valid global CURRENT_GDBARCH. Set it momentarially, and then
4136 swap the entire architecture out. */
4137 current_gdbarch
= new_gdbarch
;
4138 current_gdbarch_swap_init_hack ();
4139 current_gdbarch_swap_out_hack ();
4142 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
4148 gdbarch_find_by_info (struct gdbarch_info info
)
4150 /* Save the previously selected architecture, setting the global to
4151 NULL. This stops things like gdbarch->init() trying to use the
4152 previous architecture's configuration. The previous architecture
4153 may not even be of the same architecture family. The most recent
4154 architecture of the same family is found at the head of the
4155 rego->arches list. */
4156 struct gdbarch
*old_gdbarch
= current_gdbarch_swap_out_hack ();
4158 /* Find the specified architecture. */
4159 struct gdbarch
*new_gdbarch
= find_arch_by_info (old_gdbarch
, info
);
4161 /* Restore the existing architecture. */
4162 gdb_assert (current_gdbarch
== NULL
);
4163 current_gdbarch_swap_in_hack (old_gdbarch
);
4168 /* Make the specified architecture current, swapping the existing one
4172 deprecated_current_gdbarch_select_hack (struct gdbarch
*new_gdbarch
)
4174 gdb_assert (new_gdbarch
!= NULL
);
4175 gdb_assert (current_gdbarch
!= NULL
);
4176 gdb_assert (new_gdbarch
->initialized_p
);
4177 current_gdbarch_swap_out_hack ();
4178 current_gdbarch_swap_in_hack (new_gdbarch
);
4179 architecture_changed_event ();
4182 extern void _initialize_gdbarch (void);
4185 _initialize_gdbarch (void)
4187 struct cmd_list_element
*c
;
4189 deprecated_add_show_from_set
4190 (add_set_cmd ("arch",
4193 (char *)&gdbarch_debug
,
4194 "Set architecture debugging.\n\
4195 When non-zero, architecture debugging is enabled.", &setdebuglist
),
4197 c
= add_set_cmd ("archdebug",
4200 (char *)&gdbarch_debug
,
4201 "Set architecture debugging.\n\
4202 When non-zero, architecture debugging is enabled.", &setlist
);
4204 deprecate_cmd (c
, "set debug arch");
4205 deprecate_cmd (deprecated_add_show_from_set (c
, &showlist
), "show debug arch");