* gdbarch.sh (deprecated_extract_return_value)
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
2
3 /* Dynamic architecture support for GDB, the GNU debugger.
4
5 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
7
8 This file is part of GDB.
9
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.
14
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.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 Boston, MA 02110-1301, USA. */
24
25 /* This file was created with the aid of ``gdbarch.sh''.
26
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
30 being reported.
31
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
35 easier. */
36
37
38 #include "defs.h"
39 #include "arch-utils.h"
40
41 #include "gdbcmd.h"
42 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
43 #include "symcat.h"
44
45 #include "floatformat.h"
46
47 #include "gdb_assert.h"
48 #include "gdb_string.h"
49 #include "gdb-events.h"
50 #include "reggroups.h"
51 #include "osabi.h"
52 #include "gdb_obstack.h"
53
54 /* Static function declarations */
55
56 static void alloc_gdbarch_data (struct gdbarch *);
57
58 /* Non-zero if we want to trace architecture code. */
59
60 #ifndef GDBARCH_DEBUG
61 #define GDBARCH_DEBUG 0
62 #endif
63 int gdbarch_debug = GDBARCH_DEBUG;
64 static void
65 show_gdbarch_debug (struct ui_file *file, int from_tty,
66 struct cmd_list_element *c, const char *value)
67 {
68 fprintf_filtered (file, _("Architecture debugging is %s.\n"), value);
69 }
70
71 static const char *
72 pformat (const struct floatformat *format)
73 {
74 if (format == NULL)
75 return "(null)";
76 else
77 return format->name;
78 }
79
80
81 /* Maintain the struct gdbarch object */
82
83 struct gdbarch
84 {
85 /* Has this architecture been fully initialized? */
86 int initialized_p;
87
88 /* An obstack bound to the lifetime of the architecture. */
89 struct obstack *obstack;
90
91 /* basic architectural information */
92 const struct bfd_arch_info * bfd_arch_info;
93 int byte_order;
94 enum gdb_osabi osabi;
95 const struct target_desc * target_desc;
96
97 /* target specific vector. */
98 struct gdbarch_tdep *tdep;
99 gdbarch_dump_tdep_ftype *dump_tdep;
100
101 /* per-architecture data-pointers */
102 unsigned nr_data;
103 void **data;
104
105 /* per-architecture swap-regions */
106 struct gdbarch_swap *swap;
107
108 /* Multi-arch values.
109
110 When extending this structure you must:
111
112 Add the field below.
113
114 Declare set/get functions and define the corresponding
115 macro in gdbarch.h.
116
117 gdbarch_alloc(): If zero/NULL is not a suitable default,
118 initialize the new field.
119
120 verify_gdbarch(): Confirm that the target updated the field
121 correctly.
122
123 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
124 field is dumped out
125
126 ``startup_gdbarch()'': Append an initial value to the static
127 variable (base values on the host's c-type system).
128
129 get_gdbarch(): Implement the set/get functions (probably using
130 the macro's as shortcuts).
131
132 */
133
134 int short_bit;
135 int int_bit;
136 int long_bit;
137 int long_long_bit;
138 int float_bit;
139 const struct floatformat * float_format;
140 int double_bit;
141 const struct floatformat * double_format;
142 int long_double_bit;
143 const struct floatformat * long_double_format;
144 int ptr_bit;
145 int addr_bit;
146 int bfd_vma_bit;
147 int char_signed;
148 gdbarch_read_pc_ftype *read_pc;
149 gdbarch_write_pc_ftype *write_pc;
150 gdbarch_read_sp_ftype *read_sp;
151 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
152 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
153 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
154 int num_regs;
155 int num_pseudo_regs;
156 int sp_regnum;
157 int pc_regnum;
158 int ps_regnum;
159 int fp0_regnum;
160 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
161 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
162 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
163 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
164 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
165 gdbarch_register_name_ftype *register_name;
166 gdbarch_register_type_ftype *register_type;
167 gdbarch_deprecated_register_byte_ftype *deprecated_register_byte;
168 gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
169 int deprecated_fp_regnum;
170 gdbarch_push_dummy_call_ftype *push_dummy_call;
171 int deprecated_register_size;
172 int call_dummy_location;
173 gdbarch_push_dummy_code_ftype *push_dummy_code;
174 gdbarch_print_registers_info_ftype *print_registers_info;
175 gdbarch_print_float_info_ftype *print_float_info;
176 gdbarch_print_vector_info_ftype *print_vector_info;
177 gdbarch_register_sim_regno_ftype *register_sim_regno;
178 gdbarch_register_bytes_ok_ftype *register_bytes_ok;
179 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
180 gdbarch_cannot_store_register_ftype *cannot_store_register;
181 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
182 int believe_pcc_promotion;
183 gdbarch_convert_register_p_ftype *convert_register_p;
184 gdbarch_register_to_value_ftype *register_to_value;
185 gdbarch_value_to_register_ftype *value_to_register;
186 gdbarch_value_from_register_ftype *value_from_register;
187 gdbarch_pointer_to_address_ftype *pointer_to_address;
188 gdbarch_address_to_pointer_ftype *address_to_pointer;
189 gdbarch_integer_to_address_ftype *integer_to_address;
190 gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return;
191 gdbarch_return_value_ftype *return_value;
192 gdbarch_extract_return_value_ftype *extract_return_value;
193 gdbarch_store_return_value_ftype *store_return_value;
194 gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
195 gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
196 gdbarch_skip_prologue_ftype *skip_prologue;
197 gdbarch_inner_than_ftype *inner_than;
198 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
199 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
200 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
201 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
202 CORE_ADDR decr_pc_after_break;
203 CORE_ADDR deprecated_function_start_offset;
204 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
205 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
206 CORE_ADDR frame_args_skip;
207 gdbarch_unwind_pc_ftype *unwind_pc;
208 gdbarch_unwind_sp_ftype *unwind_sp;
209 gdbarch_frame_num_args_ftype *frame_num_args;
210 gdbarch_deprecated_stack_align_ftype *deprecated_stack_align;
211 gdbarch_frame_align_ftype *frame_align;
212 gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr;
213 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
214 int frame_red_zone_size;
215 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
216 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
217 gdbarch_smash_text_address_ftype *smash_text_address;
218 gdbarch_software_single_step_ftype *software_single_step;
219 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
220 gdbarch_print_insn_ftype *print_insn;
221 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
222 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
223 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
224 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
225 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
226 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
227 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
228 const char * name_of_malloc;
229 int cannot_step_breakpoint;
230 int have_nonsteppable_watchpoint;
231 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
232 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
233 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
234 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
235 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
236 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
237 int vtable_function_descriptors;
238 int vbit_in_delta;
239 };
240
241
242 /* The default architecture uses host values (for want of a better
243 choice). */
244
245 extern const struct bfd_arch_info bfd_default_arch_struct;
246
247 struct gdbarch startup_gdbarch =
248 {
249 1, /* Always initialized. */
250 NULL, /* The obstack. */
251 /* basic architecture information */
252 &bfd_default_arch_struct, /* bfd_arch_info */
253 BFD_ENDIAN_BIG, /* byte_order */
254 GDB_OSABI_UNKNOWN, /* osabi */
255 0, /* target_desc */
256 /* target specific vector and its dump routine */
257 NULL, NULL,
258 /*per-architecture data-pointers and swap regions */
259 0, NULL, NULL,
260 /* Multi-arch values */
261 8 * sizeof (short), /* short_bit */
262 8 * sizeof (int), /* int_bit */
263 8 * sizeof (long), /* long_bit */
264 8 * sizeof (LONGEST), /* long_long_bit */
265 8 * sizeof (float), /* float_bit */
266 0, /* float_format */
267 8 * sizeof (double), /* double_bit */
268 0, /* double_format */
269 8 * sizeof (long double), /* long_double_bit */
270 0, /* long_double_format */
271 8 * sizeof (void*), /* ptr_bit */
272 8 * sizeof (void*), /* addr_bit */
273 8 * sizeof (void*), /* bfd_vma_bit */
274 1, /* char_signed */
275 0, /* read_pc */
276 0, /* write_pc */
277 0, /* read_sp */
278 0, /* virtual_frame_pointer */
279 0, /* pseudo_register_read */
280 0, /* pseudo_register_write */
281 0, /* num_regs */
282 0, /* num_pseudo_regs */
283 -1, /* sp_regnum */
284 -1, /* pc_regnum */
285 -1, /* ps_regnum */
286 0, /* fp0_regnum */
287 0, /* stab_reg_to_regnum */
288 0, /* ecoff_reg_to_regnum */
289 0, /* dwarf_reg_to_regnum */
290 0, /* sdb_reg_to_regnum */
291 0, /* dwarf2_reg_to_regnum */
292 0, /* register_name */
293 0, /* register_type */
294 generic_register_byte, /* deprecated_register_byte */
295 0, /* unwind_dummy_id */
296 -1, /* deprecated_fp_regnum */
297 0, /* push_dummy_call */
298 0, /* deprecated_register_size */
299 0, /* call_dummy_location */
300 0, /* push_dummy_code */
301 default_print_registers_info, /* print_registers_info */
302 0, /* print_float_info */
303 0, /* print_vector_info */
304 0, /* register_sim_regno */
305 0, /* register_bytes_ok */
306 0, /* cannot_fetch_register */
307 0, /* cannot_store_register */
308 0, /* get_longjmp_target */
309 0, /* believe_pcc_promotion */
310 0, /* convert_register_p */
311 0, /* register_to_value */
312 0, /* value_to_register */
313 0, /* value_from_register */
314 0, /* pointer_to_address */
315 0, /* address_to_pointer */
316 0, /* integer_to_address */
317 0, /* deprecated_store_struct_return */
318 0, /* return_value */
319 0, /* extract_return_value */
320 0, /* store_return_value */
321 0, /* deprecated_use_struct_convention */
322 0, /* deprecated_extract_struct_value_address */
323 0, /* skip_prologue */
324 0, /* inner_than */
325 0, /* breakpoint_from_pc */
326 0, /* adjust_breakpoint_address */
327 0, /* memory_insert_breakpoint */
328 0, /* memory_remove_breakpoint */
329 0, /* decr_pc_after_break */
330 0, /* deprecated_function_start_offset */
331 generic_remote_translate_xfer_address, /* remote_translate_xfer_address */
332 0, /* fetch_tls_load_module_address */
333 0, /* frame_args_skip */
334 0, /* unwind_pc */
335 0, /* unwind_sp */
336 0, /* frame_num_args */
337 0, /* deprecated_stack_align */
338 0, /* frame_align */
339 0, /* deprecated_reg_struct_has_addr */
340 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
341 0, /* frame_red_zone_size */
342 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
343 0, /* addr_bits_remove */
344 0, /* smash_text_address */
345 0, /* software_single_step */
346 0, /* single_step_through_delay */
347 0, /* print_insn */
348 0, /* skip_trampoline_code */
349 generic_skip_solib_resolver, /* skip_solib_resolver */
350 0, /* in_solib_return_trampoline */
351 generic_in_function_epilogue_p, /* in_function_epilogue_p */
352 construct_inferior_arguments, /* construct_inferior_arguments */
353 0, /* elf_make_msymbol_special */
354 0, /* coff_make_msymbol_special */
355 "malloc", /* name_of_malloc */
356 0, /* cannot_step_breakpoint */
357 0, /* have_nonsteppable_watchpoint */
358 0, /* address_class_type_flags */
359 0, /* address_class_type_flags_to_name */
360 0, /* address_class_name_to_type_flags */
361 default_register_reggroup_p, /* register_reggroup_p */
362 0, /* fetch_pointer_argument */
363 0, /* regset_from_core_section */
364 0, /* vtable_function_descriptors */
365 0, /* vbit_in_delta */
366 /* startup_gdbarch() */
367 };
368
369 struct gdbarch *current_gdbarch = &startup_gdbarch;
370
371 /* Create a new ``struct gdbarch'' based on information provided by
372 ``struct gdbarch_info''. */
373
374 struct gdbarch *
375 gdbarch_alloc (const struct gdbarch_info *info,
376 struct gdbarch_tdep *tdep)
377 {
378 /* NOTE: The new architecture variable is named ``current_gdbarch''
379 so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
380 the current local architecture and not the previous global
381 architecture. This ensures that the new architectures initial
382 values are not influenced by the previous architecture. Once
383 everything is parameterised with gdbarch, this will go away. */
384 struct gdbarch *current_gdbarch;
385
386 /* Create an obstack for allocating all the per-architecture memory,
387 then use that to allocate the architecture vector. */
388 struct obstack *obstack = XMALLOC (struct obstack);
389 obstack_init (obstack);
390 current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch));
391 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
392 current_gdbarch->obstack = obstack;
393
394 alloc_gdbarch_data (current_gdbarch);
395
396 current_gdbarch->tdep = tdep;
397
398 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
399 current_gdbarch->byte_order = info->byte_order;
400 current_gdbarch->osabi = info->osabi;
401 current_gdbarch->target_desc = info->target_desc;
402
403 /* Force the explicit initialization of these. */
404 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
405 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
406 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
407 current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
408 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
409 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
410 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
411 current_gdbarch->ptr_bit = TARGET_INT_BIT;
412 current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
413 current_gdbarch->char_signed = -1;
414 current_gdbarch->write_pc = generic_target_write_pc;
415 current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
416 current_gdbarch->num_regs = -1;
417 current_gdbarch->sp_regnum = -1;
418 current_gdbarch->pc_regnum = -1;
419 current_gdbarch->ps_regnum = -1;
420 current_gdbarch->fp0_regnum = -1;
421 current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
422 current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
423 current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
424 current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
425 current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
426 current_gdbarch->deprecated_register_byte = generic_register_byte;
427 current_gdbarch->deprecated_fp_regnum = -1;
428 current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
429 current_gdbarch->print_registers_info = default_print_registers_info;
430 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
431 current_gdbarch->cannot_fetch_register = cannot_register_not;
432 current_gdbarch->cannot_store_register = cannot_register_not;
433 current_gdbarch->convert_register_p = generic_convert_register_p;
434 current_gdbarch->value_from_register = default_value_from_register;
435 current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
436 current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
437 current_gdbarch->return_value = legacy_return_value;
438 current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
439 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
440 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
441 current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
442 current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
443 current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
444 current_gdbarch->addr_bits_remove = core_addr_identity;
445 current_gdbarch->smash_text_address = core_addr_identity;
446 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
447 current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
448 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
449 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
450 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
451 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
452 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
453 current_gdbarch->name_of_malloc = "malloc";
454 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
455 /* gdbarch_alloc() */
456
457 return current_gdbarch;
458 }
459
460
461 /* Allocate extra space using the per-architecture obstack. */
462
463 void *
464 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
465 {
466 void *data = obstack_alloc (arch->obstack, size);
467 memset (data, 0, size);
468 return data;
469 }
470
471
472 /* Free a gdbarch struct. This should never happen in normal
473 operation --- once you've created a gdbarch, you keep it around.
474 However, if an architecture's init function encounters an error
475 building the structure, it may need to clean up a partially
476 constructed gdbarch. */
477
478 void
479 gdbarch_free (struct gdbarch *arch)
480 {
481 struct obstack *obstack;
482 gdb_assert (arch != NULL);
483 gdb_assert (!arch->initialized_p);
484 obstack = arch->obstack;
485 obstack_free (obstack, 0); /* Includes the ARCH. */
486 xfree (obstack);
487 }
488
489
490 /* Ensure that all values in a GDBARCH are reasonable. */
491
492 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
493 just happens to match the global variable ``current_gdbarch''. That
494 way macros refering to that variable get the local and not the global
495 version - ulgh. Once everything is parameterised with gdbarch, this
496 will go away. */
497
498 static void
499 verify_gdbarch (struct gdbarch *current_gdbarch)
500 {
501 struct ui_file *log;
502 struct cleanup *cleanups;
503 long dummy;
504 char *buf;
505 log = mem_fileopen ();
506 cleanups = make_cleanup_ui_file_delete (log);
507 /* fundamental */
508 if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
509 fprintf_unfiltered (log, "\n\tbyte-order");
510 if (current_gdbarch->bfd_arch_info == NULL)
511 fprintf_unfiltered (log, "\n\tbfd_arch_info");
512 /* Check those that need to be defined for the given multi-arch level. */
513 /* Skip verify of short_bit, invalid_p == 0 */
514 /* Skip verify of int_bit, invalid_p == 0 */
515 /* Skip verify of long_bit, invalid_p == 0 */
516 /* Skip verify of long_long_bit, invalid_p == 0 */
517 /* Skip verify of float_bit, invalid_p == 0 */
518 if (current_gdbarch->float_format == 0)
519 current_gdbarch->float_format = default_float_format (current_gdbarch);
520 /* Skip verify of double_bit, invalid_p == 0 */
521 if (current_gdbarch->double_format == 0)
522 current_gdbarch->double_format = default_double_format (current_gdbarch);
523 /* Skip verify of long_double_bit, invalid_p == 0 */
524 if (current_gdbarch->long_double_format == 0)
525 current_gdbarch->long_double_format = default_double_format (current_gdbarch);
526 /* Skip verify of ptr_bit, invalid_p == 0 */
527 if (current_gdbarch->addr_bit == 0)
528 current_gdbarch->addr_bit = TARGET_PTR_BIT;
529 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
530 if (current_gdbarch->char_signed == -1)
531 current_gdbarch->char_signed = 1;
532 /* Skip verify of read_pc, has predicate */
533 /* Skip verify of write_pc, invalid_p == 0 */
534 /* Skip verify of read_sp, has predicate */
535 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
536 /* Skip verify of pseudo_register_read, has predicate */
537 /* Skip verify of pseudo_register_write, has predicate */
538 if (current_gdbarch->num_regs == -1)
539 fprintf_unfiltered (log, "\n\tnum_regs");
540 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
541 /* Skip verify of sp_regnum, invalid_p == 0 */
542 /* Skip verify of pc_regnum, invalid_p == 0 */
543 /* Skip verify of ps_regnum, invalid_p == 0 */
544 /* Skip verify of fp0_regnum, invalid_p == 0 */
545 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
546 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
547 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
548 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
549 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
550 /* Skip verify of register_type, has predicate */
551 /* Skip verify of deprecated_register_byte, has predicate */
552 /* Skip verify of unwind_dummy_id, has predicate */
553 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
554 /* Skip verify of push_dummy_call, has predicate */
555 /* Skip verify of call_dummy_location, invalid_p == 0 */
556 /* Skip verify of push_dummy_code, has predicate */
557 /* Skip verify of print_registers_info, invalid_p == 0 */
558 /* Skip verify of print_float_info, has predicate */
559 /* Skip verify of print_vector_info, has predicate */
560 /* Skip verify of register_sim_regno, invalid_p == 0 */
561 /* Skip verify of register_bytes_ok, has predicate */
562 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
563 /* Skip verify of cannot_store_register, invalid_p == 0 */
564 /* Skip verify of get_longjmp_target, has predicate */
565 /* Skip verify of convert_register_p, invalid_p == 0 */
566 /* Skip verify of value_from_register, invalid_p == 0 */
567 /* Skip verify of pointer_to_address, invalid_p == 0 */
568 /* Skip verify of address_to_pointer, invalid_p == 0 */
569 /* Skip verify of integer_to_address, has predicate */
570 /* Skip verify of deprecated_store_struct_return, has predicate */
571 /* Skip verify of return_value, has predicate */
572 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
573 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
574 if (current_gdbarch->skip_prologue == 0)
575 fprintf_unfiltered (log, "\n\tskip_prologue");
576 if (current_gdbarch->inner_than == 0)
577 fprintf_unfiltered (log, "\n\tinner_than");
578 if (current_gdbarch->breakpoint_from_pc == 0)
579 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
580 /* Skip verify of adjust_breakpoint_address, has predicate */
581 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
582 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
583 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
584 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
585 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
586 /* Skip verify of fetch_tls_load_module_address, has predicate */
587 /* Skip verify of frame_args_skip, invalid_p == 0 */
588 /* Skip verify of unwind_pc, has predicate */
589 /* Skip verify of unwind_sp, has predicate */
590 /* Skip verify of frame_num_args, has predicate */
591 /* Skip verify of deprecated_stack_align, has predicate */
592 /* Skip verify of frame_align, has predicate */
593 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
594 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
595 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
596 /* Skip verify of addr_bits_remove, invalid_p == 0 */
597 /* Skip verify of smash_text_address, invalid_p == 0 */
598 /* Skip verify of software_single_step, has predicate */
599 /* Skip verify of single_step_through_delay, has predicate */
600 if (current_gdbarch->print_insn == 0)
601 fprintf_unfiltered (log, "\n\tprint_insn");
602 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
603 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
604 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
605 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
606 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
607 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
608 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
609 /* Skip verify of name_of_malloc, invalid_p == 0 */
610 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
611 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
612 /* Skip verify of address_class_type_flags, has predicate */
613 /* Skip verify of address_class_type_flags_to_name, has predicate */
614 /* Skip verify of address_class_name_to_type_flags, has predicate */
615 /* Skip verify of register_reggroup_p, invalid_p == 0 */
616 /* Skip verify of fetch_pointer_argument, has predicate */
617 /* Skip verify of regset_from_core_section, has predicate */
618 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
619 /* Skip verify of vbit_in_delta, invalid_p == 0 */
620 buf = ui_file_xstrdup (log, &dummy);
621 make_cleanup (xfree, buf);
622 if (strlen (buf) > 0)
623 internal_error (__FILE__, __LINE__,
624 _("verify_gdbarch: the following are invalid ...%s"),
625 buf);
626 do_cleanups (cleanups);
627 }
628
629
630 /* Print out the details of the current architecture. */
631
632 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
633 just happens to match the global variable ``current_gdbarch''. That
634 way macros refering to that variable get the local and not the global
635 version - ulgh. Once everything is parameterised with gdbarch, this
636 will go away. */
637
638 void
639 gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
640 {
641 const char *gdb_xm_file = "<not-defined>";
642 const char *gdb_nm_file = "<not-defined>";
643 const char *gdb_tm_file = "<not-defined>";
644 #if defined (GDB_XM_FILE)
645 gdb_xm_file = GDB_XM_FILE;
646 #endif
647 fprintf_unfiltered (file,
648 "gdbarch_dump: GDB_XM_FILE = %s\n",
649 gdb_xm_file);
650 #if defined (GDB_NM_FILE)
651 gdb_nm_file = GDB_NM_FILE;
652 #endif
653 fprintf_unfiltered (file,
654 "gdbarch_dump: GDB_NM_FILE = %s\n",
655 gdb_nm_file);
656 #if defined (GDB_TM_FILE)
657 gdb_tm_file = GDB_TM_FILE;
658 #endif
659 fprintf_unfiltered (file,
660 "gdbarch_dump: GDB_TM_FILE = %s\n",
661 gdb_tm_file);
662 #ifdef TARGET_ADDR_BIT
663 fprintf_unfiltered (file,
664 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
665 XSTRING (TARGET_ADDR_BIT));
666 #endif
667 fprintf_unfiltered (file,
668 "gdbarch_dump: addr_bit = %s\n",
669 paddr_d (current_gdbarch->addr_bit));
670 #ifdef ADDR_BITS_REMOVE
671 fprintf_unfiltered (file,
672 "gdbarch_dump: %s # %s\n",
673 "ADDR_BITS_REMOVE(addr)",
674 XSTRING (ADDR_BITS_REMOVE (addr)));
675 #endif
676 fprintf_unfiltered (file,
677 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
678 (long) current_gdbarch->addr_bits_remove);
679 fprintf_unfiltered (file,
680 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
681 gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
682 fprintf_unfiltered (file,
683 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
684 (long) current_gdbarch->address_class_name_to_type_flags);
685 #ifdef ADDRESS_CLASS_TYPE_FLAGS_P
686 fprintf_unfiltered (file,
687 "gdbarch_dump: %s # %s\n",
688 "ADDRESS_CLASS_TYPE_FLAGS_P()",
689 XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ()));
690 #endif
691 fprintf_unfiltered (file,
692 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
693 gdbarch_address_class_type_flags_p (current_gdbarch));
694 #ifdef ADDRESS_CLASS_TYPE_FLAGS
695 fprintf_unfiltered (file,
696 "gdbarch_dump: %s # %s\n",
697 "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
698 XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class)));
699 #endif
700 fprintf_unfiltered (file,
701 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
702 (long) current_gdbarch->address_class_type_flags);
703 fprintf_unfiltered (file,
704 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
705 gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
706 fprintf_unfiltered (file,
707 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
708 (long) current_gdbarch->address_class_type_flags_to_name);
709 #ifdef ADDRESS_TO_POINTER
710 fprintf_unfiltered (file,
711 "gdbarch_dump: %s # %s\n",
712 "ADDRESS_TO_POINTER(type, buf, addr)",
713 XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
714 #endif
715 fprintf_unfiltered (file,
716 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
717 (long) current_gdbarch->address_to_pointer);
718 fprintf_unfiltered (file,
719 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
720 gdbarch_adjust_breakpoint_address_p (current_gdbarch));
721 fprintf_unfiltered (file,
722 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
723 (long) current_gdbarch->adjust_breakpoint_address);
724 #ifdef BELIEVE_PCC_PROMOTION
725 fprintf_unfiltered (file,
726 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
727 XSTRING (BELIEVE_PCC_PROMOTION));
728 #endif
729 fprintf_unfiltered (file,
730 "gdbarch_dump: believe_pcc_promotion = %s\n",
731 paddr_d (current_gdbarch->believe_pcc_promotion));
732 #ifdef TARGET_ARCHITECTURE
733 fprintf_unfiltered (file,
734 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
735 XSTRING (TARGET_ARCHITECTURE));
736 #endif
737 fprintf_unfiltered (file,
738 "gdbarch_dump: bfd_arch_info = %s\n",
739 TARGET_ARCHITECTURE->printable_name);
740 #ifdef TARGET_BFD_VMA_BIT
741 fprintf_unfiltered (file,
742 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
743 XSTRING (TARGET_BFD_VMA_BIT));
744 #endif
745 fprintf_unfiltered (file,
746 "gdbarch_dump: bfd_vma_bit = %s\n",
747 paddr_d (current_gdbarch->bfd_vma_bit));
748 #ifdef BREAKPOINT_FROM_PC
749 fprintf_unfiltered (file,
750 "gdbarch_dump: %s # %s\n",
751 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
752 XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
753 #endif
754 fprintf_unfiltered (file,
755 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
756 (long) current_gdbarch->breakpoint_from_pc);
757 #ifdef TARGET_BYTE_ORDER
758 fprintf_unfiltered (file,
759 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
760 XSTRING (TARGET_BYTE_ORDER));
761 #endif
762 fprintf_unfiltered (file,
763 "gdbarch_dump: byte_order = %s\n",
764 paddr_d (current_gdbarch->byte_order));
765 #ifdef CALL_DUMMY_LOCATION
766 fprintf_unfiltered (file,
767 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
768 XSTRING (CALL_DUMMY_LOCATION));
769 #endif
770 fprintf_unfiltered (file,
771 "gdbarch_dump: call_dummy_location = %s\n",
772 paddr_d (current_gdbarch->call_dummy_location));
773 #ifdef CANNOT_FETCH_REGISTER
774 fprintf_unfiltered (file,
775 "gdbarch_dump: %s # %s\n",
776 "CANNOT_FETCH_REGISTER(regnum)",
777 XSTRING (CANNOT_FETCH_REGISTER (regnum)));
778 #endif
779 fprintf_unfiltered (file,
780 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
781 (long) current_gdbarch->cannot_fetch_register);
782 #ifdef CANNOT_STEP_BREAKPOINT
783 fprintf_unfiltered (file,
784 "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
785 XSTRING (CANNOT_STEP_BREAKPOINT));
786 #endif
787 fprintf_unfiltered (file,
788 "gdbarch_dump: cannot_step_breakpoint = %s\n",
789 paddr_d (current_gdbarch->cannot_step_breakpoint));
790 #ifdef CANNOT_STORE_REGISTER
791 fprintf_unfiltered (file,
792 "gdbarch_dump: %s # %s\n",
793 "CANNOT_STORE_REGISTER(regnum)",
794 XSTRING (CANNOT_STORE_REGISTER (regnum)));
795 #endif
796 fprintf_unfiltered (file,
797 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
798 (long) current_gdbarch->cannot_store_register);
799 #ifdef TARGET_CHAR_SIGNED
800 fprintf_unfiltered (file,
801 "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
802 XSTRING (TARGET_CHAR_SIGNED));
803 #endif
804 fprintf_unfiltered (file,
805 "gdbarch_dump: char_signed = %s\n",
806 paddr_d (current_gdbarch->char_signed));
807 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
808 fprintf_unfiltered (file,
809 "gdbarch_dump: %s # %s\n",
810 "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
811 XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
812 #endif
813 fprintf_unfiltered (file,
814 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
815 (long) current_gdbarch->coff_make_msymbol_special);
816 fprintf_unfiltered (file,
817 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
818 (long) current_gdbarch->construct_inferior_arguments);
819 fprintf_unfiltered (file,
820 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
821 (long) current_gdbarch->convert_from_func_ptr_addr);
822 #ifdef CONVERT_REGISTER_P
823 fprintf_unfiltered (file,
824 "gdbarch_dump: %s # %s\n",
825 "CONVERT_REGISTER_P(regnum, type)",
826 XSTRING (CONVERT_REGISTER_P (regnum, type)));
827 #endif
828 fprintf_unfiltered (file,
829 "gdbarch_dump: convert_register_p = <0x%lx>\n",
830 (long) current_gdbarch->convert_register_p);
831 #ifdef DECR_PC_AFTER_BREAK
832 fprintf_unfiltered (file,
833 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
834 XSTRING (DECR_PC_AFTER_BREAK));
835 #endif
836 fprintf_unfiltered (file,
837 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
838 paddr_nz (current_gdbarch->decr_pc_after_break));
839 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
840 fprintf_unfiltered (file,
841 "gdbarch_dump: %s # %s\n",
842 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
843 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
844 #endif
845 fprintf_unfiltered (file,
846 "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
847 gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch));
848 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
849 fprintf_unfiltered (file,
850 "gdbarch_dump: %s # %s\n",
851 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
852 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
853 #endif
854 fprintf_unfiltered (file,
855 "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
856 (long) current_gdbarch->deprecated_extract_struct_value_address);
857 #ifdef DEPRECATED_FP_REGNUM
858 fprintf_unfiltered (file,
859 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
860 XSTRING (DEPRECATED_FP_REGNUM));
861 #endif
862 fprintf_unfiltered (file,
863 "gdbarch_dump: deprecated_fp_regnum = %s\n",
864 paddr_d (current_gdbarch->deprecated_fp_regnum));
865 #ifdef DEPRECATED_FUNCTION_START_OFFSET
866 fprintf_unfiltered (file,
867 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
868 XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
869 #endif
870 fprintf_unfiltered (file,
871 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
872 paddr_nz (current_gdbarch->deprecated_function_start_offset));
873 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
874 fprintf_unfiltered (file,
875 "gdbarch_dump: %s # %s\n",
876 "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
877 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
878 #endif
879 fprintf_unfiltered (file,
880 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
881 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch));
882 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
883 fprintf_unfiltered (file,
884 "gdbarch_dump: %s # %s\n",
885 "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
886 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
887 #endif
888 fprintf_unfiltered (file,
889 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
890 (long) current_gdbarch->deprecated_reg_struct_has_addr);
891 #ifdef DEPRECATED_REGISTER_BYTE_P
892 fprintf_unfiltered (file,
893 "gdbarch_dump: %s # %s\n",
894 "DEPRECATED_REGISTER_BYTE_P()",
895 XSTRING (DEPRECATED_REGISTER_BYTE_P ()));
896 #endif
897 fprintf_unfiltered (file,
898 "gdbarch_dump: gdbarch_deprecated_register_byte_p() = %d\n",
899 gdbarch_deprecated_register_byte_p (current_gdbarch));
900 #ifdef DEPRECATED_REGISTER_BYTE
901 fprintf_unfiltered (file,
902 "gdbarch_dump: %s # %s\n",
903 "DEPRECATED_REGISTER_BYTE(reg_nr)",
904 XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr)));
905 #endif
906 fprintf_unfiltered (file,
907 "gdbarch_dump: deprecated_register_byte = <0x%lx>\n",
908 (long) current_gdbarch->deprecated_register_byte);
909 #ifdef DEPRECATED_REGISTER_SIZE
910 fprintf_unfiltered (file,
911 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
912 XSTRING (DEPRECATED_REGISTER_SIZE));
913 #endif
914 fprintf_unfiltered (file,
915 "gdbarch_dump: deprecated_register_size = %s\n",
916 paddr_d (current_gdbarch->deprecated_register_size));
917 #ifdef DEPRECATED_STACK_ALIGN_P
918 fprintf_unfiltered (file,
919 "gdbarch_dump: %s # %s\n",
920 "DEPRECATED_STACK_ALIGN_P()",
921 XSTRING (DEPRECATED_STACK_ALIGN_P ()));
922 #endif
923 fprintf_unfiltered (file,
924 "gdbarch_dump: gdbarch_deprecated_stack_align_p() = %d\n",
925 gdbarch_deprecated_stack_align_p (current_gdbarch));
926 #ifdef DEPRECATED_STACK_ALIGN
927 fprintf_unfiltered (file,
928 "gdbarch_dump: %s # %s\n",
929 "DEPRECATED_STACK_ALIGN(sp)",
930 XSTRING (DEPRECATED_STACK_ALIGN (sp)));
931 #endif
932 fprintf_unfiltered (file,
933 "gdbarch_dump: deprecated_stack_align = <0x%lx>\n",
934 (long) current_gdbarch->deprecated_stack_align);
935 #ifdef DEPRECATED_STORE_STRUCT_RETURN_P
936 fprintf_unfiltered (file,
937 "gdbarch_dump: %s # %s\n",
938 "DEPRECATED_STORE_STRUCT_RETURN_P()",
939 XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ()));
940 #endif
941 fprintf_unfiltered (file,
942 "gdbarch_dump: gdbarch_deprecated_store_struct_return_p() = %d\n",
943 gdbarch_deprecated_store_struct_return_p (current_gdbarch));
944 #ifdef DEPRECATED_STORE_STRUCT_RETURN
945 fprintf_unfiltered (file,
946 "gdbarch_dump: %s # %s\n",
947 "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)",
948 XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr, sp)));
949 #endif
950 fprintf_unfiltered (file,
951 "gdbarch_dump: deprecated_store_struct_return = <0x%lx>\n",
952 (long) current_gdbarch->deprecated_store_struct_return);
953 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
954 fprintf_unfiltered (file,
955 "gdbarch_dump: %s # %s\n",
956 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
957 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type)));
958 #endif
959 fprintf_unfiltered (file,
960 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
961 (long) current_gdbarch->deprecated_use_struct_convention);
962 #ifdef TARGET_DOUBLE_BIT
963 fprintf_unfiltered (file,
964 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
965 XSTRING (TARGET_DOUBLE_BIT));
966 #endif
967 fprintf_unfiltered (file,
968 "gdbarch_dump: double_bit = %s\n",
969 paddr_d (current_gdbarch->double_bit));
970 #ifdef TARGET_DOUBLE_FORMAT
971 fprintf_unfiltered (file,
972 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
973 XSTRING (TARGET_DOUBLE_FORMAT));
974 #endif
975 fprintf_unfiltered (file,
976 "gdbarch_dump: double_format = %s\n",
977 pformat (current_gdbarch->double_format));
978 #ifdef DWARF2_REG_TO_REGNUM
979 fprintf_unfiltered (file,
980 "gdbarch_dump: %s # %s\n",
981 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
982 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
983 #endif
984 fprintf_unfiltered (file,
985 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
986 (long) current_gdbarch->dwarf2_reg_to_regnum);
987 #ifdef DWARF_REG_TO_REGNUM
988 fprintf_unfiltered (file,
989 "gdbarch_dump: %s # %s\n",
990 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
991 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
992 #endif
993 fprintf_unfiltered (file,
994 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
995 (long) current_gdbarch->dwarf_reg_to_regnum);
996 #ifdef ECOFF_REG_TO_REGNUM
997 fprintf_unfiltered (file,
998 "gdbarch_dump: %s # %s\n",
999 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1000 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
1001 #endif
1002 fprintf_unfiltered (file,
1003 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
1004 (long) current_gdbarch->ecoff_reg_to_regnum);
1005 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
1006 fprintf_unfiltered (file,
1007 "gdbarch_dump: %s # %s\n",
1008 "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1009 XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
1010 #endif
1011 fprintf_unfiltered (file,
1012 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
1013 (long) current_gdbarch->elf_make_msymbol_special);
1014 #ifdef EXTRACT_RETURN_VALUE
1015 fprintf_unfiltered (file,
1016 "gdbarch_dump: %s # %s\n",
1017 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1018 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
1019 #endif
1020 fprintf_unfiltered (file,
1021 "gdbarch_dump: extract_return_value = <0x%lx>\n",
1022 (long) current_gdbarch->extract_return_value);
1023 #ifdef FETCH_POINTER_ARGUMENT_P
1024 fprintf_unfiltered (file,
1025 "gdbarch_dump: %s # %s\n",
1026 "FETCH_POINTER_ARGUMENT_P()",
1027 XSTRING (FETCH_POINTER_ARGUMENT_P ()));
1028 #endif
1029 fprintf_unfiltered (file,
1030 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
1031 gdbarch_fetch_pointer_argument_p (current_gdbarch));
1032 #ifdef FETCH_POINTER_ARGUMENT
1033 fprintf_unfiltered (file,
1034 "gdbarch_dump: %s # %s\n",
1035 "FETCH_POINTER_ARGUMENT(frame, argi, type)",
1036 XSTRING (FETCH_POINTER_ARGUMENT (frame, argi, type)));
1037 #endif
1038 fprintf_unfiltered (file,
1039 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
1040 (long) current_gdbarch->fetch_pointer_argument);
1041 #ifdef FETCH_TLS_LOAD_MODULE_ADDRESS_P
1042 fprintf_unfiltered (file,
1043 "gdbarch_dump: %s # %s\n",
1044 "FETCH_TLS_LOAD_MODULE_ADDRESS_P()",
1045 XSTRING (FETCH_TLS_LOAD_MODULE_ADDRESS_P ()));
1046 #endif
1047 fprintf_unfiltered (file,
1048 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
1049 gdbarch_fetch_tls_load_module_address_p (current_gdbarch));
1050 #ifdef FETCH_TLS_LOAD_MODULE_ADDRESS
1051 fprintf_unfiltered (file,
1052 "gdbarch_dump: %s # %s\n",
1053 "FETCH_TLS_LOAD_MODULE_ADDRESS(objfile)",
1054 XSTRING (FETCH_TLS_LOAD_MODULE_ADDRESS (objfile)));
1055 #endif
1056 fprintf_unfiltered (file,
1057 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
1058 (long) current_gdbarch->fetch_tls_load_module_address);
1059 #ifdef TARGET_FLOAT_BIT
1060 fprintf_unfiltered (file,
1061 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
1062 XSTRING (TARGET_FLOAT_BIT));
1063 #endif
1064 fprintf_unfiltered (file,
1065 "gdbarch_dump: float_bit = %s\n",
1066 paddr_d (current_gdbarch->float_bit));
1067 #ifdef TARGET_FLOAT_FORMAT
1068 fprintf_unfiltered (file,
1069 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1070 XSTRING (TARGET_FLOAT_FORMAT));
1071 #endif
1072 fprintf_unfiltered (file,
1073 "gdbarch_dump: float_format = %s\n",
1074 pformat (current_gdbarch->float_format));
1075 #ifdef FP0_REGNUM
1076 fprintf_unfiltered (file,
1077 "gdbarch_dump: FP0_REGNUM # %s\n",
1078 XSTRING (FP0_REGNUM));
1079 #endif
1080 fprintf_unfiltered (file,
1081 "gdbarch_dump: fp0_regnum = %s\n",
1082 paddr_d (current_gdbarch->fp0_regnum));
1083 fprintf_unfiltered (file,
1084 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
1085 gdbarch_frame_align_p (current_gdbarch));
1086 fprintf_unfiltered (file,
1087 "gdbarch_dump: frame_align = <0x%lx>\n",
1088 (long) current_gdbarch->frame_align);
1089 #ifdef FRAME_ARGS_SKIP
1090 fprintf_unfiltered (file,
1091 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1092 XSTRING (FRAME_ARGS_SKIP));
1093 #endif
1094 fprintf_unfiltered (file,
1095 "gdbarch_dump: frame_args_skip = 0x%s\n",
1096 paddr_nz (current_gdbarch->frame_args_skip));
1097 #ifdef FRAME_NUM_ARGS_P
1098 fprintf_unfiltered (file,
1099 "gdbarch_dump: %s # %s\n",
1100 "FRAME_NUM_ARGS_P()",
1101 XSTRING (FRAME_NUM_ARGS_P ()));
1102 #endif
1103 fprintf_unfiltered (file,
1104 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
1105 gdbarch_frame_num_args_p (current_gdbarch));
1106 #ifdef FRAME_NUM_ARGS
1107 fprintf_unfiltered (file,
1108 "gdbarch_dump: %s # %s\n",
1109 "FRAME_NUM_ARGS(frame)",
1110 XSTRING (FRAME_NUM_ARGS (frame)));
1111 #endif
1112 fprintf_unfiltered (file,
1113 "gdbarch_dump: frame_num_args = <0x%lx>\n",
1114 (long) current_gdbarch->frame_num_args);
1115 #ifdef FRAME_RED_ZONE_SIZE
1116 fprintf_unfiltered (file,
1117 "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
1118 XSTRING (FRAME_RED_ZONE_SIZE));
1119 #endif
1120 fprintf_unfiltered (file,
1121 "gdbarch_dump: frame_red_zone_size = %s\n",
1122 paddr_d (current_gdbarch->frame_red_zone_size));
1123 #ifdef GET_LONGJMP_TARGET_P
1124 fprintf_unfiltered (file,
1125 "gdbarch_dump: %s # %s\n",
1126 "GET_LONGJMP_TARGET_P()",
1127 XSTRING (GET_LONGJMP_TARGET_P ()));
1128 #endif
1129 fprintf_unfiltered (file,
1130 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1131 gdbarch_get_longjmp_target_p (current_gdbarch));
1132 #ifdef GET_LONGJMP_TARGET
1133 fprintf_unfiltered (file,
1134 "gdbarch_dump: %s # %s\n",
1135 "GET_LONGJMP_TARGET(pc)",
1136 XSTRING (GET_LONGJMP_TARGET (pc)));
1137 #endif
1138 fprintf_unfiltered (file,
1139 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
1140 (long) current_gdbarch->get_longjmp_target);
1141 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
1142 fprintf_unfiltered (file,
1143 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1144 XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
1145 #endif
1146 fprintf_unfiltered (file,
1147 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1148 paddr_d (current_gdbarch->have_nonsteppable_watchpoint));
1149 fprintf_unfiltered (file,
1150 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
1151 (long) current_gdbarch->in_function_epilogue_p);
1152 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1153 fprintf_unfiltered (file,
1154 "gdbarch_dump: %s # %s\n",
1155 "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1156 XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
1157 #endif
1158 fprintf_unfiltered (file,
1159 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
1160 (long) current_gdbarch->in_solib_return_trampoline);
1161 #ifdef INNER_THAN
1162 fprintf_unfiltered (file,
1163 "gdbarch_dump: %s # %s\n",
1164 "INNER_THAN(lhs, rhs)",
1165 XSTRING (INNER_THAN (lhs, rhs)));
1166 #endif
1167 fprintf_unfiltered (file,
1168 "gdbarch_dump: inner_than = <0x%lx>\n",
1169 (long) current_gdbarch->inner_than);
1170 #ifdef TARGET_INT_BIT
1171 fprintf_unfiltered (file,
1172 "gdbarch_dump: TARGET_INT_BIT # %s\n",
1173 XSTRING (TARGET_INT_BIT));
1174 #endif
1175 fprintf_unfiltered (file,
1176 "gdbarch_dump: int_bit = %s\n",
1177 paddr_d (current_gdbarch->int_bit));
1178 fprintf_unfiltered (file,
1179 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1180 gdbarch_integer_to_address_p (current_gdbarch));
1181 fprintf_unfiltered (file,
1182 "gdbarch_dump: integer_to_address = <0x%lx>\n",
1183 (long) current_gdbarch->integer_to_address);
1184 #ifdef TARGET_LONG_BIT
1185 fprintf_unfiltered (file,
1186 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
1187 XSTRING (TARGET_LONG_BIT));
1188 #endif
1189 fprintf_unfiltered (file,
1190 "gdbarch_dump: long_bit = %s\n",
1191 paddr_d (current_gdbarch->long_bit));
1192 #ifdef TARGET_LONG_DOUBLE_BIT
1193 fprintf_unfiltered (file,
1194 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
1195 XSTRING (TARGET_LONG_DOUBLE_BIT));
1196 #endif
1197 fprintf_unfiltered (file,
1198 "gdbarch_dump: long_double_bit = %s\n",
1199 paddr_d (current_gdbarch->long_double_bit));
1200 #ifdef TARGET_LONG_DOUBLE_FORMAT
1201 fprintf_unfiltered (file,
1202 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1203 XSTRING (TARGET_LONG_DOUBLE_FORMAT));
1204 #endif
1205 fprintf_unfiltered (file,
1206 "gdbarch_dump: long_double_format = %s\n",
1207 pformat (current_gdbarch->long_double_format));
1208 #ifdef TARGET_LONG_LONG_BIT
1209 fprintf_unfiltered (file,
1210 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
1211 XSTRING (TARGET_LONG_LONG_BIT));
1212 #endif
1213 fprintf_unfiltered (file,
1214 "gdbarch_dump: long_long_bit = %s\n",
1215 paddr_d (current_gdbarch->long_long_bit));
1216 #ifdef MEMORY_INSERT_BREAKPOINT
1217 fprintf_unfiltered (file,
1218 "gdbarch_dump: %s # %s\n",
1219 "MEMORY_INSERT_BREAKPOINT(bp_tgt)",
1220 XSTRING (MEMORY_INSERT_BREAKPOINT (bp_tgt)));
1221 #endif
1222 fprintf_unfiltered (file,
1223 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
1224 (long) current_gdbarch->memory_insert_breakpoint);
1225 #ifdef MEMORY_REMOVE_BREAKPOINT
1226 fprintf_unfiltered (file,
1227 "gdbarch_dump: %s # %s\n",
1228 "MEMORY_REMOVE_BREAKPOINT(bp_tgt)",
1229 XSTRING (MEMORY_REMOVE_BREAKPOINT (bp_tgt)));
1230 #endif
1231 fprintf_unfiltered (file,
1232 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
1233 (long) current_gdbarch->memory_remove_breakpoint);
1234 #ifdef NAME_OF_MALLOC
1235 fprintf_unfiltered (file,
1236 "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1237 XSTRING (NAME_OF_MALLOC));
1238 #endif
1239 fprintf_unfiltered (file,
1240 "gdbarch_dump: name_of_malloc = %s\n",
1241 NAME_OF_MALLOC);
1242 #ifdef NUM_PSEUDO_REGS
1243 fprintf_unfiltered (file,
1244 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1245 XSTRING (NUM_PSEUDO_REGS));
1246 #endif
1247 fprintf_unfiltered (file,
1248 "gdbarch_dump: num_pseudo_regs = %s\n",
1249 paddr_d (current_gdbarch->num_pseudo_regs));
1250 #ifdef NUM_REGS
1251 fprintf_unfiltered (file,
1252 "gdbarch_dump: NUM_REGS # %s\n",
1253 XSTRING (NUM_REGS));
1254 #endif
1255 fprintf_unfiltered (file,
1256 "gdbarch_dump: num_regs = %s\n",
1257 paddr_d (current_gdbarch->num_regs));
1258 #ifdef TARGET_OSABI
1259 fprintf_unfiltered (file,
1260 "gdbarch_dump: TARGET_OSABI # %s\n",
1261 XSTRING (TARGET_OSABI));
1262 #endif
1263 fprintf_unfiltered (file,
1264 "gdbarch_dump: osabi = %s\n",
1265 paddr_d (current_gdbarch->osabi));
1266 #ifdef PC_REGNUM
1267 fprintf_unfiltered (file,
1268 "gdbarch_dump: PC_REGNUM # %s\n",
1269 XSTRING (PC_REGNUM));
1270 #endif
1271 fprintf_unfiltered (file,
1272 "gdbarch_dump: pc_regnum = %s\n",
1273 paddr_d (current_gdbarch->pc_regnum));
1274 #ifdef POINTER_TO_ADDRESS
1275 fprintf_unfiltered (file,
1276 "gdbarch_dump: %s # %s\n",
1277 "POINTER_TO_ADDRESS(type, buf)",
1278 XSTRING (POINTER_TO_ADDRESS (type, buf)));
1279 #endif
1280 fprintf_unfiltered (file,
1281 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
1282 (long) current_gdbarch->pointer_to_address);
1283 fprintf_unfiltered (file,
1284 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1285 gdbarch_print_float_info_p (current_gdbarch));
1286 fprintf_unfiltered (file,
1287 "gdbarch_dump: print_float_info = <0x%lx>\n",
1288 (long) current_gdbarch->print_float_info);
1289 #ifdef TARGET_PRINT_INSN
1290 fprintf_unfiltered (file,
1291 "gdbarch_dump: %s # %s\n",
1292 "TARGET_PRINT_INSN(vma, info)",
1293 XSTRING (TARGET_PRINT_INSN (vma, info)));
1294 #endif
1295 fprintf_unfiltered (file,
1296 "gdbarch_dump: print_insn = <0x%lx>\n",
1297 (long) current_gdbarch->print_insn);
1298 fprintf_unfiltered (file,
1299 "gdbarch_dump: print_registers_info = <0x%lx>\n",
1300 (long) current_gdbarch->print_registers_info);
1301 fprintf_unfiltered (file,
1302 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1303 gdbarch_print_vector_info_p (current_gdbarch));
1304 fprintf_unfiltered (file,
1305 "gdbarch_dump: print_vector_info = <0x%lx>\n",
1306 (long) current_gdbarch->print_vector_info);
1307 #ifdef PS_REGNUM
1308 fprintf_unfiltered (file,
1309 "gdbarch_dump: PS_REGNUM # %s\n",
1310 XSTRING (PS_REGNUM));
1311 #endif
1312 fprintf_unfiltered (file,
1313 "gdbarch_dump: ps_regnum = %s\n",
1314 paddr_d (current_gdbarch->ps_regnum));
1315 fprintf_unfiltered (file,
1316 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1317 gdbarch_pseudo_register_read_p (current_gdbarch));
1318 fprintf_unfiltered (file,
1319 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
1320 (long) current_gdbarch->pseudo_register_read);
1321 fprintf_unfiltered (file,
1322 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1323 gdbarch_pseudo_register_write_p (current_gdbarch));
1324 fprintf_unfiltered (file,
1325 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
1326 (long) current_gdbarch->pseudo_register_write);
1327 #ifdef TARGET_PTR_BIT
1328 fprintf_unfiltered (file,
1329 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
1330 XSTRING (TARGET_PTR_BIT));
1331 #endif
1332 fprintf_unfiltered (file,
1333 "gdbarch_dump: ptr_bit = %s\n",
1334 paddr_d (current_gdbarch->ptr_bit));
1335 fprintf_unfiltered (file,
1336 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1337 gdbarch_push_dummy_call_p (current_gdbarch));
1338 fprintf_unfiltered (file,
1339 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
1340 (long) current_gdbarch->push_dummy_call);
1341 fprintf_unfiltered (file,
1342 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1343 gdbarch_push_dummy_code_p (current_gdbarch));
1344 fprintf_unfiltered (file,
1345 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
1346 (long) current_gdbarch->push_dummy_code);
1347 #ifdef TARGET_READ_PC_P
1348 fprintf_unfiltered (file,
1349 "gdbarch_dump: %s # %s\n",
1350 "TARGET_READ_PC_P()",
1351 XSTRING (TARGET_READ_PC_P ()));
1352 #endif
1353 fprintf_unfiltered (file,
1354 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1355 gdbarch_read_pc_p (current_gdbarch));
1356 #ifdef TARGET_READ_PC
1357 fprintf_unfiltered (file,
1358 "gdbarch_dump: %s # %s\n",
1359 "TARGET_READ_PC(ptid)",
1360 XSTRING (TARGET_READ_PC (ptid)));
1361 #endif
1362 fprintf_unfiltered (file,
1363 "gdbarch_dump: read_pc = <0x%lx>\n",
1364 (long) current_gdbarch->read_pc);
1365 #ifdef TARGET_READ_SP_P
1366 fprintf_unfiltered (file,
1367 "gdbarch_dump: %s # %s\n",
1368 "TARGET_READ_SP_P()",
1369 XSTRING (TARGET_READ_SP_P ()));
1370 #endif
1371 fprintf_unfiltered (file,
1372 "gdbarch_dump: gdbarch_read_sp_p() = %d\n",
1373 gdbarch_read_sp_p (current_gdbarch));
1374 #ifdef TARGET_READ_SP
1375 fprintf_unfiltered (file,
1376 "gdbarch_dump: %s # %s\n",
1377 "TARGET_READ_SP()",
1378 XSTRING (TARGET_READ_SP ()));
1379 #endif
1380 fprintf_unfiltered (file,
1381 "gdbarch_dump: read_sp = <0x%lx>\n",
1382 (long) current_gdbarch->read_sp);
1383 #ifdef REGISTER_BYTES_OK_P
1384 fprintf_unfiltered (file,
1385 "gdbarch_dump: %s # %s\n",
1386 "REGISTER_BYTES_OK_P()",
1387 XSTRING (REGISTER_BYTES_OK_P ()));
1388 #endif
1389 fprintf_unfiltered (file,
1390 "gdbarch_dump: gdbarch_register_bytes_ok_p() = %d\n",
1391 gdbarch_register_bytes_ok_p (current_gdbarch));
1392 #ifdef REGISTER_BYTES_OK
1393 fprintf_unfiltered (file,
1394 "gdbarch_dump: %s # %s\n",
1395 "REGISTER_BYTES_OK(nr_bytes)",
1396 XSTRING (REGISTER_BYTES_OK (nr_bytes)));
1397 #endif
1398 fprintf_unfiltered (file,
1399 "gdbarch_dump: register_bytes_ok = <0x%lx>\n",
1400 (long) current_gdbarch->register_bytes_ok);
1401 #ifdef REGISTER_NAME
1402 fprintf_unfiltered (file,
1403 "gdbarch_dump: %s # %s\n",
1404 "REGISTER_NAME(regnr)",
1405 XSTRING (REGISTER_NAME (regnr)));
1406 #endif
1407 fprintf_unfiltered (file,
1408 "gdbarch_dump: register_name = <0x%lx>\n",
1409 (long) current_gdbarch->register_name);
1410 fprintf_unfiltered (file,
1411 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
1412 (long) current_gdbarch->register_reggroup_p);
1413 #ifdef REGISTER_SIM_REGNO
1414 fprintf_unfiltered (file,
1415 "gdbarch_dump: %s # %s\n",
1416 "REGISTER_SIM_REGNO(reg_nr)",
1417 XSTRING (REGISTER_SIM_REGNO (reg_nr)));
1418 #endif
1419 fprintf_unfiltered (file,
1420 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
1421 (long) current_gdbarch->register_sim_regno);
1422 #ifdef REGISTER_TO_VALUE
1423 fprintf_unfiltered (file,
1424 "gdbarch_dump: %s # %s\n",
1425 "REGISTER_TO_VALUE(frame, regnum, type, buf)",
1426 XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf)));
1427 #endif
1428 fprintf_unfiltered (file,
1429 "gdbarch_dump: register_to_value = <0x%lx>\n",
1430 (long) current_gdbarch->register_to_value);
1431 fprintf_unfiltered (file,
1432 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1433 gdbarch_register_type_p (current_gdbarch));
1434 fprintf_unfiltered (file,
1435 "gdbarch_dump: register_type = <0x%lx>\n",
1436 (long) current_gdbarch->register_type);
1437 fprintf_unfiltered (file,
1438 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1439 gdbarch_regset_from_core_section_p (current_gdbarch));
1440 fprintf_unfiltered (file,
1441 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
1442 (long) current_gdbarch->regset_from_core_section);
1443 fprintf_unfiltered (file,
1444 "gdbarch_dump: remote_translate_xfer_address = <0x%lx>\n",
1445 (long) current_gdbarch->remote_translate_xfer_address);
1446 fprintf_unfiltered (file,
1447 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1448 gdbarch_return_value_p (current_gdbarch));
1449 fprintf_unfiltered (file,
1450 "gdbarch_dump: return_value = <0x%lx>\n",
1451 (long) current_gdbarch->return_value);
1452 #ifdef SDB_REG_TO_REGNUM
1453 fprintf_unfiltered (file,
1454 "gdbarch_dump: %s # %s\n",
1455 "SDB_REG_TO_REGNUM(sdb_regnr)",
1456 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
1457 #endif
1458 fprintf_unfiltered (file,
1459 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1460 (long) current_gdbarch->sdb_reg_to_regnum);
1461 #ifdef TARGET_SHORT_BIT
1462 fprintf_unfiltered (file,
1463 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
1464 XSTRING (TARGET_SHORT_BIT));
1465 #endif
1466 fprintf_unfiltered (file,
1467 "gdbarch_dump: short_bit = %s\n",
1468 paddr_d (current_gdbarch->short_bit));
1469 fprintf_unfiltered (file,
1470 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1471 gdbarch_single_step_through_delay_p (current_gdbarch));
1472 fprintf_unfiltered (file,
1473 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
1474 (long) current_gdbarch->single_step_through_delay);
1475 #ifdef SKIP_PROLOGUE
1476 fprintf_unfiltered (file,
1477 "gdbarch_dump: %s # %s\n",
1478 "SKIP_PROLOGUE(ip)",
1479 XSTRING (SKIP_PROLOGUE (ip)));
1480 #endif
1481 fprintf_unfiltered (file,
1482 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1483 (long) current_gdbarch->skip_prologue);
1484 fprintf_unfiltered (file,
1485 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1486 (long) current_gdbarch->skip_solib_resolver);
1487 #ifdef SKIP_TRAMPOLINE_CODE
1488 fprintf_unfiltered (file,
1489 "gdbarch_dump: %s # %s\n",
1490 "SKIP_TRAMPOLINE_CODE(pc)",
1491 XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
1492 #endif
1493 fprintf_unfiltered (file,
1494 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1495 (long) current_gdbarch->skip_trampoline_code);
1496 #ifdef SMASH_TEXT_ADDRESS
1497 fprintf_unfiltered (file,
1498 "gdbarch_dump: %s # %s\n",
1499 "SMASH_TEXT_ADDRESS(addr)",
1500 XSTRING (SMASH_TEXT_ADDRESS (addr)));
1501 #endif
1502 fprintf_unfiltered (file,
1503 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1504 (long) current_gdbarch->smash_text_address);
1505 #ifdef SOFTWARE_SINGLE_STEP_P
1506 fprintf_unfiltered (file,
1507 "gdbarch_dump: %s # %s\n",
1508 "SOFTWARE_SINGLE_STEP_P()",
1509 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1510 #endif
1511 fprintf_unfiltered (file,
1512 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1513 gdbarch_software_single_step_p (current_gdbarch));
1514 #ifdef SOFTWARE_SINGLE_STEP
1515 fprintf_unfiltered (file,
1516 "gdbarch_dump: %s # %s\n",
1517 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
1518 XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
1519 #endif
1520 fprintf_unfiltered (file,
1521 "gdbarch_dump: software_single_step = <0x%lx>\n",
1522 (long) current_gdbarch->software_single_step);
1523 #ifdef SP_REGNUM
1524 fprintf_unfiltered (file,
1525 "gdbarch_dump: SP_REGNUM # %s\n",
1526 XSTRING (SP_REGNUM));
1527 #endif
1528 fprintf_unfiltered (file,
1529 "gdbarch_dump: sp_regnum = %s\n",
1530 paddr_d (current_gdbarch->sp_regnum));
1531 #ifdef STAB_REG_TO_REGNUM
1532 fprintf_unfiltered (file,
1533 "gdbarch_dump: %s # %s\n",
1534 "STAB_REG_TO_REGNUM(stab_regnr)",
1535 XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
1536 #endif
1537 fprintf_unfiltered (file,
1538 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1539 (long) current_gdbarch->stab_reg_to_regnum);
1540 fprintf_unfiltered (file,
1541 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1542 (long) current_gdbarch->stabs_argument_has_addr);
1543 #ifdef STORE_RETURN_VALUE
1544 fprintf_unfiltered (file,
1545 "gdbarch_dump: %s # %s\n",
1546 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1547 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
1548 #endif
1549 fprintf_unfiltered (file,
1550 "gdbarch_dump: store_return_value = <0x%lx>\n",
1551 (long) current_gdbarch->store_return_value);
1552 fprintf_unfiltered (file,
1553 "gdbarch_dump: target_desc = %s\n",
1554 paddr_d ((long) current_gdbarch->target_desc));
1555 fprintf_unfiltered (file,
1556 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1557 gdbarch_unwind_dummy_id_p (current_gdbarch));
1558 fprintf_unfiltered (file,
1559 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1560 (long) current_gdbarch->unwind_dummy_id);
1561 fprintf_unfiltered (file,
1562 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1563 gdbarch_unwind_pc_p (current_gdbarch));
1564 fprintf_unfiltered (file,
1565 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1566 (long) current_gdbarch->unwind_pc);
1567 fprintf_unfiltered (file,
1568 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1569 gdbarch_unwind_sp_p (current_gdbarch));
1570 fprintf_unfiltered (file,
1571 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1572 (long) current_gdbarch->unwind_sp);
1573 fprintf_unfiltered (file,
1574 "gdbarch_dump: value_from_register = <0x%lx>\n",
1575 (long) current_gdbarch->value_from_register);
1576 #ifdef VALUE_TO_REGISTER
1577 fprintf_unfiltered (file,
1578 "gdbarch_dump: %s # %s\n",
1579 "VALUE_TO_REGISTER(frame, regnum, type, buf)",
1580 XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf)));
1581 #endif
1582 fprintf_unfiltered (file,
1583 "gdbarch_dump: value_to_register = <0x%lx>\n",
1584 (long) current_gdbarch->value_to_register);
1585 fprintf_unfiltered (file,
1586 "gdbarch_dump: vbit_in_delta = %s\n",
1587 paddr_d (current_gdbarch->vbit_in_delta));
1588 #ifdef TARGET_VIRTUAL_FRAME_POINTER
1589 fprintf_unfiltered (file,
1590 "gdbarch_dump: %s # %s\n",
1591 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
1592 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
1593 #endif
1594 fprintf_unfiltered (file,
1595 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1596 (long) current_gdbarch->virtual_frame_pointer);
1597 fprintf_unfiltered (file,
1598 "gdbarch_dump: vtable_function_descriptors = %s\n",
1599 paddr_d (current_gdbarch->vtable_function_descriptors));
1600 #ifdef TARGET_WRITE_PC
1601 fprintf_unfiltered (file,
1602 "gdbarch_dump: %s # %s\n",
1603 "TARGET_WRITE_PC(val, ptid)",
1604 XSTRING (TARGET_WRITE_PC (val, ptid)));
1605 #endif
1606 fprintf_unfiltered (file,
1607 "gdbarch_dump: write_pc = <0x%lx>\n",
1608 (long) current_gdbarch->write_pc);
1609 if (current_gdbarch->dump_tdep != NULL)
1610 current_gdbarch->dump_tdep (current_gdbarch, file);
1611 }
1612
1613 struct gdbarch_tdep *
1614 gdbarch_tdep (struct gdbarch *gdbarch)
1615 {
1616 if (gdbarch_debug >= 2)
1617 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1618 return gdbarch->tdep;
1619 }
1620
1621
1622 const struct bfd_arch_info *
1623 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1624 {
1625 gdb_assert (gdbarch != NULL);
1626 if (gdbarch_debug >= 2)
1627 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1628 return gdbarch->bfd_arch_info;
1629 }
1630
1631 int
1632 gdbarch_byte_order (struct gdbarch *gdbarch)
1633 {
1634 gdb_assert (gdbarch != NULL);
1635 if (gdbarch_debug >= 2)
1636 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1637 return gdbarch->byte_order;
1638 }
1639
1640 enum gdb_osabi
1641 gdbarch_osabi (struct gdbarch *gdbarch)
1642 {
1643 gdb_assert (gdbarch != NULL);
1644 if (gdbarch_debug >= 2)
1645 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1646 return gdbarch->osabi;
1647 }
1648
1649 const struct target_desc *
1650 gdbarch_target_desc (struct gdbarch *gdbarch)
1651 {
1652 gdb_assert (gdbarch != NULL);
1653 if (gdbarch_debug >= 2)
1654 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1655 return gdbarch->target_desc;
1656 }
1657
1658 int
1659 gdbarch_short_bit (struct gdbarch *gdbarch)
1660 {
1661 gdb_assert (gdbarch != NULL);
1662 /* Skip verify of short_bit, invalid_p == 0 */
1663 if (gdbarch_debug >= 2)
1664 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1665 return gdbarch->short_bit;
1666 }
1667
1668 void
1669 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1670 int short_bit)
1671 {
1672 gdbarch->short_bit = short_bit;
1673 }
1674
1675 int
1676 gdbarch_int_bit (struct gdbarch *gdbarch)
1677 {
1678 gdb_assert (gdbarch != NULL);
1679 /* Skip verify of int_bit, invalid_p == 0 */
1680 if (gdbarch_debug >= 2)
1681 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1682 return gdbarch->int_bit;
1683 }
1684
1685 void
1686 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1687 int int_bit)
1688 {
1689 gdbarch->int_bit = int_bit;
1690 }
1691
1692 int
1693 gdbarch_long_bit (struct gdbarch *gdbarch)
1694 {
1695 gdb_assert (gdbarch != NULL);
1696 /* Skip verify of long_bit, invalid_p == 0 */
1697 if (gdbarch_debug >= 2)
1698 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1699 return gdbarch->long_bit;
1700 }
1701
1702 void
1703 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1704 int long_bit)
1705 {
1706 gdbarch->long_bit = long_bit;
1707 }
1708
1709 int
1710 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1711 {
1712 gdb_assert (gdbarch != NULL);
1713 /* Skip verify of long_long_bit, invalid_p == 0 */
1714 if (gdbarch_debug >= 2)
1715 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1716 return gdbarch->long_long_bit;
1717 }
1718
1719 void
1720 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1721 int long_long_bit)
1722 {
1723 gdbarch->long_long_bit = long_long_bit;
1724 }
1725
1726 int
1727 gdbarch_float_bit (struct gdbarch *gdbarch)
1728 {
1729 gdb_assert (gdbarch != NULL);
1730 /* Skip verify of float_bit, invalid_p == 0 */
1731 if (gdbarch_debug >= 2)
1732 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1733 return gdbarch->float_bit;
1734 }
1735
1736 void
1737 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1738 int float_bit)
1739 {
1740 gdbarch->float_bit = float_bit;
1741 }
1742
1743 const struct floatformat *
1744 gdbarch_float_format (struct gdbarch *gdbarch)
1745 {
1746 gdb_assert (gdbarch != NULL);
1747 if (gdbarch_debug >= 2)
1748 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1749 return gdbarch->float_format;
1750 }
1751
1752 void
1753 set_gdbarch_float_format (struct gdbarch *gdbarch,
1754 const struct floatformat * float_format)
1755 {
1756 gdbarch->float_format = float_format;
1757 }
1758
1759 int
1760 gdbarch_double_bit (struct gdbarch *gdbarch)
1761 {
1762 gdb_assert (gdbarch != NULL);
1763 /* Skip verify of double_bit, invalid_p == 0 */
1764 if (gdbarch_debug >= 2)
1765 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1766 return gdbarch->double_bit;
1767 }
1768
1769 void
1770 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1771 int double_bit)
1772 {
1773 gdbarch->double_bit = double_bit;
1774 }
1775
1776 const struct floatformat *
1777 gdbarch_double_format (struct gdbarch *gdbarch)
1778 {
1779 gdb_assert (gdbarch != NULL);
1780 if (gdbarch_debug >= 2)
1781 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1782 return gdbarch->double_format;
1783 }
1784
1785 void
1786 set_gdbarch_double_format (struct gdbarch *gdbarch,
1787 const struct floatformat * double_format)
1788 {
1789 gdbarch->double_format = double_format;
1790 }
1791
1792 int
1793 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1794 {
1795 gdb_assert (gdbarch != NULL);
1796 /* Skip verify of long_double_bit, invalid_p == 0 */
1797 if (gdbarch_debug >= 2)
1798 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1799 return gdbarch->long_double_bit;
1800 }
1801
1802 void
1803 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1804 int long_double_bit)
1805 {
1806 gdbarch->long_double_bit = long_double_bit;
1807 }
1808
1809 const struct floatformat *
1810 gdbarch_long_double_format (struct gdbarch *gdbarch)
1811 {
1812 gdb_assert (gdbarch != NULL);
1813 if (gdbarch_debug >= 2)
1814 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1815 return gdbarch->long_double_format;
1816 }
1817
1818 void
1819 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1820 const struct floatformat * long_double_format)
1821 {
1822 gdbarch->long_double_format = long_double_format;
1823 }
1824
1825 int
1826 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1827 {
1828 gdb_assert (gdbarch != NULL);
1829 /* Skip verify of ptr_bit, invalid_p == 0 */
1830 if (gdbarch_debug >= 2)
1831 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1832 return gdbarch->ptr_bit;
1833 }
1834
1835 void
1836 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1837 int ptr_bit)
1838 {
1839 gdbarch->ptr_bit = ptr_bit;
1840 }
1841
1842 int
1843 gdbarch_addr_bit (struct gdbarch *gdbarch)
1844 {
1845 gdb_assert (gdbarch != NULL);
1846 /* Check variable changed from pre-default. */
1847 gdb_assert (gdbarch->addr_bit != 0);
1848 if (gdbarch_debug >= 2)
1849 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1850 return gdbarch->addr_bit;
1851 }
1852
1853 void
1854 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1855 int addr_bit)
1856 {
1857 gdbarch->addr_bit = addr_bit;
1858 }
1859
1860 int
1861 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
1862 {
1863 gdb_assert (gdbarch != NULL);
1864 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1865 if (gdbarch_debug >= 2)
1866 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
1867 return gdbarch->bfd_vma_bit;
1868 }
1869
1870 void
1871 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
1872 int bfd_vma_bit)
1873 {
1874 gdbarch->bfd_vma_bit = bfd_vma_bit;
1875 }
1876
1877 int
1878 gdbarch_char_signed (struct gdbarch *gdbarch)
1879 {
1880 gdb_assert (gdbarch != NULL);
1881 /* Check variable changed from pre-default. */
1882 gdb_assert (gdbarch->char_signed != -1);
1883 if (gdbarch_debug >= 2)
1884 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1885 return gdbarch->char_signed;
1886 }
1887
1888 void
1889 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1890 int char_signed)
1891 {
1892 gdbarch->char_signed = char_signed;
1893 }
1894
1895 int
1896 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1897 {
1898 gdb_assert (gdbarch != NULL);
1899 return gdbarch->read_pc != NULL;
1900 }
1901
1902 CORE_ADDR
1903 gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
1904 {
1905 gdb_assert (gdbarch != NULL);
1906 gdb_assert (gdbarch->read_pc != NULL);
1907 if (gdbarch_debug >= 2)
1908 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1909 return gdbarch->read_pc (ptid);
1910 }
1911
1912 void
1913 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1914 gdbarch_read_pc_ftype read_pc)
1915 {
1916 gdbarch->read_pc = read_pc;
1917 }
1918
1919 void
1920 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
1921 {
1922 gdb_assert (gdbarch != NULL);
1923 gdb_assert (gdbarch->write_pc != NULL);
1924 if (gdbarch_debug >= 2)
1925 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1926 gdbarch->write_pc (val, ptid);
1927 }
1928
1929 void
1930 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1931 gdbarch_write_pc_ftype write_pc)
1932 {
1933 gdbarch->write_pc = write_pc;
1934 }
1935
1936 int
1937 gdbarch_read_sp_p (struct gdbarch *gdbarch)
1938 {
1939 gdb_assert (gdbarch != NULL);
1940 return gdbarch->read_sp != NULL;
1941 }
1942
1943 CORE_ADDR
1944 gdbarch_read_sp (struct gdbarch *gdbarch)
1945 {
1946 gdb_assert (gdbarch != NULL);
1947 gdb_assert (gdbarch->read_sp != NULL);
1948 if (gdbarch_debug >= 2)
1949 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
1950 return gdbarch->read_sp ();
1951 }
1952
1953 void
1954 set_gdbarch_read_sp (struct gdbarch *gdbarch,
1955 gdbarch_read_sp_ftype read_sp)
1956 {
1957 gdbarch->read_sp = read_sp;
1958 }
1959
1960 void
1961 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1962 {
1963 gdb_assert (gdbarch != NULL);
1964 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1965 if (gdbarch_debug >= 2)
1966 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1967 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
1968 }
1969
1970 void
1971 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1972 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1973 {
1974 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1975 }
1976
1977 int
1978 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1979 {
1980 gdb_assert (gdbarch != NULL);
1981 return gdbarch->pseudo_register_read != NULL;
1982 }
1983
1984 void
1985 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
1986 {
1987 gdb_assert (gdbarch != NULL);
1988 gdb_assert (gdbarch->pseudo_register_read != NULL);
1989 if (gdbarch_debug >= 2)
1990 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1991 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1992 }
1993
1994 void
1995 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1996 gdbarch_pseudo_register_read_ftype pseudo_register_read)
1997 {
1998 gdbarch->pseudo_register_read = pseudo_register_read;
1999 }
2000
2001 int
2002 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
2003 {
2004 gdb_assert (gdbarch != NULL);
2005 return gdbarch->pseudo_register_write != NULL;
2006 }
2007
2008 void
2009 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
2010 {
2011 gdb_assert (gdbarch != NULL);
2012 gdb_assert (gdbarch->pseudo_register_write != NULL);
2013 if (gdbarch_debug >= 2)
2014 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
2015 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
2016 }
2017
2018 void
2019 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
2020 gdbarch_pseudo_register_write_ftype pseudo_register_write)
2021 {
2022 gdbarch->pseudo_register_write = pseudo_register_write;
2023 }
2024
2025 int
2026 gdbarch_num_regs (struct gdbarch *gdbarch)
2027 {
2028 gdb_assert (gdbarch != NULL);
2029 /* Check variable changed from pre-default. */
2030 gdb_assert (gdbarch->num_regs != -1);
2031 if (gdbarch_debug >= 2)
2032 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
2033 return gdbarch->num_regs;
2034 }
2035
2036 void
2037 set_gdbarch_num_regs (struct gdbarch *gdbarch,
2038 int num_regs)
2039 {
2040 gdbarch->num_regs = num_regs;
2041 }
2042
2043 int
2044 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
2045 {
2046 gdb_assert (gdbarch != NULL);
2047 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2048 if (gdbarch_debug >= 2)
2049 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
2050 return gdbarch->num_pseudo_regs;
2051 }
2052
2053 void
2054 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
2055 int num_pseudo_regs)
2056 {
2057 gdbarch->num_pseudo_regs = num_pseudo_regs;
2058 }
2059
2060 int
2061 gdbarch_sp_regnum (struct gdbarch *gdbarch)
2062 {
2063 gdb_assert (gdbarch != NULL);
2064 /* Skip verify of sp_regnum, invalid_p == 0 */
2065 if (gdbarch_debug >= 2)
2066 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2067 return gdbarch->sp_regnum;
2068 }
2069
2070 void
2071 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2072 int sp_regnum)
2073 {
2074 gdbarch->sp_regnum = sp_regnum;
2075 }
2076
2077 int
2078 gdbarch_pc_regnum (struct gdbarch *gdbarch)
2079 {
2080 gdb_assert (gdbarch != NULL);
2081 /* Skip verify of pc_regnum, invalid_p == 0 */
2082 if (gdbarch_debug >= 2)
2083 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2084 return gdbarch->pc_regnum;
2085 }
2086
2087 void
2088 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2089 int pc_regnum)
2090 {
2091 gdbarch->pc_regnum = pc_regnum;
2092 }
2093
2094 int
2095 gdbarch_ps_regnum (struct gdbarch *gdbarch)
2096 {
2097 gdb_assert (gdbarch != NULL);
2098 /* Skip verify of ps_regnum, invalid_p == 0 */
2099 if (gdbarch_debug >= 2)
2100 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
2101 return gdbarch->ps_regnum;
2102 }
2103
2104 void
2105 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
2106 int ps_regnum)
2107 {
2108 gdbarch->ps_regnum = ps_regnum;
2109 }
2110
2111 int
2112 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2113 {
2114 gdb_assert (gdbarch != NULL);
2115 /* Skip verify of fp0_regnum, invalid_p == 0 */
2116 if (gdbarch_debug >= 2)
2117 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2118 return gdbarch->fp0_regnum;
2119 }
2120
2121 void
2122 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2123 int fp0_regnum)
2124 {
2125 gdbarch->fp0_regnum = fp0_regnum;
2126 }
2127
2128 int
2129 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
2130 {
2131 gdb_assert (gdbarch != NULL);
2132 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
2133 if (gdbarch_debug >= 2)
2134 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
2135 return gdbarch->stab_reg_to_regnum (stab_regnr);
2136 }
2137
2138 void
2139 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
2140 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
2141 {
2142 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
2143 }
2144
2145 int
2146 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
2147 {
2148 gdb_assert (gdbarch != NULL);
2149 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
2150 if (gdbarch_debug >= 2)
2151 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
2152 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
2153 }
2154
2155 void
2156 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
2157 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
2158 {
2159 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
2160 }
2161
2162 int
2163 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
2164 {
2165 gdb_assert (gdbarch != NULL);
2166 gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
2167 if (gdbarch_debug >= 2)
2168 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
2169 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
2170 }
2171
2172 void
2173 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
2174 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
2175 {
2176 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
2177 }
2178
2179 int
2180 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
2181 {
2182 gdb_assert (gdbarch != NULL);
2183 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
2184 if (gdbarch_debug >= 2)
2185 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
2186 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
2187 }
2188
2189 void
2190 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2191 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2192 {
2193 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2194 }
2195
2196 int
2197 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2198 {
2199 gdb_assert (gdbarch != NULL);
2200 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
2201 if (gdbarch_debug >= 2)
2202 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
2203 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
2204 }
2205
2206 void
2207 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2208 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2209 {
2210 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2211 }
2212
2213 const char *
2214 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2215 {
2216 gdb_assert (gdbarch != NULL);
2217 gdb_assert (gdbarch->register_name != NULL);
2218 if (gdbarch_debug >= 2)
2219 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2220 return gdbarch->register_name (regnr);
2221 }
2222
2223 void
2224 set_gdbarch_register_name (struct gdbarch *gdbarch,
2225 gdbarch_register_name_ftype register_name)
2226 {
2227 gdbarch->register_name = register_name;
2228 }
2229
2230 int
2231 gdbarch_register_type_p (struct gdbarch *gdbarch)
2232 {
2233 gdb_assert (gdbarch != NULL);
2234 return gdbarch->register_type != NULL;
2235 }
2236
2237 struct type *
2238 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
2239 {
2240 gdb_assert (gdbarch != NULL);
2241 gdb_assert (gdbarch->register_type != NULL);
2242 if (gdbarch_debug >= 2)
2243 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
2244 return gdbarch->register_type (gdbarch, reg_nr);
2245 }
2246
2247 void
2248 set_gdbarch_register_type (struct gdbarch *gdbarch,
2249 gdbarch_register_type_ftype register_type)
2250 {
2251 gdbarch->register_type = register_type;
2252 }
2253
2254 int
2255 gdbarch_deprecated_register_byte_p (struct gdbarch *gdbarch)
2256 {
2257 gdb_assert (gdbarch != NULL);
2258 return gdbarch->deprecated_register_byte != generic_register_byte;
2259 }
2260
2261 int
2262 gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, int reg_nr)
2263 {
2264 gdb_assert (gdbarch != NULL);
2265 gdb_assert (gdbarch->deprecated_register_byte != NULL);
2266 /* Do not check predicate: gdbarch->deprecated_register_byte != generic_register_byte, allow call. */
2267 if (gdbarch_debug >= 2)
2268 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_byte called\n");
2269 return gdbarch->deprecated_register_byte (reg_nr);
2270 }
2271
2272 void
2273 set_gdbarch_deprecated_register_byte (struct gdbarch *gdbarch,
2274 gdbarch_deprecated_register_byte_ftype deprecated_register_byte)
2275 {
2276 gdbarch->deprecated_register_byte = deprecated_register_byte;
2277 }
2278
2279 int
2280 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
2281 {
2282 gdb_assert (gdbarch != NULL);
2283 return gdbarch->unwind_dummy_id != NULL;
2284 }
2285
2286 struct frame_id
2287 gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
2288 {
2289 gdb_assert (gdbarch != NULL);
2290 gdb_assert (gdbarch->unwind_dummy_id != NULL);
2291 if (gdbarch_debug >= 2)
2292 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
2293 return gdbarch->unwind_dummy_id (gdbarch, info);
2294 }
2295
2296 void
2297 set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
2298 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
2299 {
2300 gdbarch->unwind_dummy_id = unwind_dummy_id;
2301 }
2302
2303 int
2304 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
2305 {
2306 gdb_assert (gdbarch != NULL);
2307 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2308 if (gdbarch_debug >= 2)
2309 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
2310 return gdbarch->deprecated_fp_regnum;
2311 }
2312
2313 void
2314 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
2315 int deprecated_fp_regnum)
2316 {
2317 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
2318 }
2319
2320 int
2321 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
2322 {
2323 gdb_assert (gdbarch != NULL);
2324 return gdbarch->push_dummy_call != NULL;
2325 }
2326
2327 CORE_ADDR
2328 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)
2329 {
2330 gdb_assert (gdbarch != NULL);
2331 gdb_assert (gdbarch->push_dummy_call != NULL);
2332 if (gdbarch_debug >= 2)
2333 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
2334 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
2335 }
2336
2337 void
2338 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
2339 gdbarch_push_dummy_call_ftype push_dummy_call)
2340 {
2341 gdbarch->push_dummy_call = push_dummy_call;
2342 }
2343
2344 int
2345 gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
2346 {
2347 gdb_assert (gdbarch != NULL);
2348 if (gdbarch_debug >= 2)
2349 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
2350 return gdbarch->deprecated_register_size;
2351 }
2352
2353 void
2354 set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
2355 int deprecated_register_size)
2356 {
2357 gdbarch->deprecated_register_size = deprecated_register_size;
2358 }
2359
2360 int
2361 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
2362 {
2363 gdb_assert (gdbarch != NULL);
2364 /* Skip verify of call_dummy_location, invalid_p == 0 */
2365 if (gdbarch_debug >= 2)
2366 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
2367 return gdbarch->call_dummy_location;
2368 }
2369
2370 void
2371 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
2372 int call_dummy_location)
2373 {
2374 gdbarch->call_dummy_location = call_dummy_location;
2375 }
2376
2377 int
2378 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
2379 {
2380 gdb_assert (gdbarch != NULL);
2381 return gdbarch->push_dummy_code != NULL;
2382 }
2383
2384 CORE_ADDR
2385 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)
2386 {
2387 gdb_assert (gdbarch != NULL);
2388 gdb_assert (gdbarch->push_dummy_code != NULL);
2389 if (gdbarch_debug >= 2)
2390 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
2391 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr);
2392 }
2393
2394 void
2395 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
2396 gdbarch_push_dummy_code_ftype push_dummy_code)
2397 {
2398 gdbarch->push_dummy_code = push_dummy_code;
2399 }
2400
2401 void
2402 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
2403 {
2404 gdb_assert (gdbarch != NULL);
2405 gdb_assert (gdbarch->print_registers_info != NULL);
2406 if (gdbarch_debug >= 2)
2407 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
2408 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
2409 }
2410
2411 void
2412 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
2413 gdbarch_print_registers_info_ftype print_registers_info)
2414 {
2415 gdbarch->print_registers_info = print_registers_info;
2416 }
2417
2418 int
2419 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
2420 {
2421 gdb_assert (gdbarch != NULL);
2422 return gdbarch->print_float_info != NULL;
2423 }
2424
2425 void
2426 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2427 {
2428 gdb_assert (gdbarch != NULL);
2429 gdb_assert (gdbarch->print_float_info != NULL);
2430 if (gdbarch_debug >= 2)
2431 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
2432 gdbarch->print_float_info (gdbarch, file, frame, args);
2433 }
2434
2435 void
2436 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
2437 gdbarch_print_float_info_ftype print_float_info)
2438 {
2439 gdbarch->print_float_info = print_float_info;
2440 }
2441
2442 int
2443 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
2444 {
2445 gdb_assert (gdbarch != NULL);
2446 return gdbarch->print_vector_info != NULL;
2447 }
2448
2449 void
2450 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2451 {
2452 gdb_assert (gdbarch != NULL);
2453 gdb_assert (gdbarch->print_vector_info != NULL);
2454 if (gdbarch_debug >= 2)
2455 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
2456 gdbarch->print_vector_info (gdbarch, file, frame, args);
2457 }
2458
2459 void
2460 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
2461 gdbarch_print_vector_info_ftype print_vector_info)
2462 {
2463 gdbarch->print_vector_info = print_vector_info;
2464 }
2465
2466 int
2467 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
2468 {
2469 gdb_assert (gdbarch != NULL);
2470 gdb_assert (gdbarch->register_sim_regno != NULL);
2471 if (gdbarch_debug >= 2)
2472 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
2473 return gdbarch->register_sim_regno (reg_nr);
2474 }
2475
2476 void
2477 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
2478 gdbarch_register_sim_regno_ftype register_sim_regno)
2479 {
2480 gdbarch->register_sim_regno = register_sim_regno;
2481 }
2482
2483 int
2484 gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
2485 {
2486 gdb_assert (gdbarch != NULL);
2487 return gdbarch->register_bytes_ok != NULL;
2488 }
2489
2490 int
2491 gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
2492 {
2493 gdb_assert (gdbarch != NULL);
2494 gdb_assert (gdbarch->register_bytes_ok != NULL);
2495 if (gdbarch_debug >= 2)
2496 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
2497 return gdbarch->register_bytes_ok (nr_bytes);
2498 }
2499
2500 void
2501 set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
2502 gdbarch_register_bytes_ok_ftype register_bytes_ok)
2503 {
2504 gdbarch->register_bytes_ok = register_bytes_ok;
2505 }
2506
2507 int
2508 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
2509 {
2510 gdb_assert (gdbarch != NULL);
2511 gdb_assert (gdbarch->cannot_fetch_register != NULL);
2512 if (gdbarch_debug >= 2)
2513 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
2514 return gdbarch->cannot_fetch_register (regnum);
2515 }
2516
2517 void
2518 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
2519 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
2520 {
2521 gdbarch->cannot_fetch_register = cannot_fetch_register;
2522 }
2523
2524 int
2525 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
2526 {
2527 gdb_assert (gdbarch != NULL);
2528 gdb_assert (gdbarch->cannot_store_register != NULL);
2529 if (gdbarch_debug >= 2)
2530 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
2531 return gdbarch->cannot_store_register (regnum);
2532 }
2533
2534 void
2535 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
2536 gdbarch_cannot_store_register_ftype cannot_store_register)
2537 {
2538 gdbarch->cannot_store_register = cannot_store_register;
2539 }
2540
2541 int
2542 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
2543 {
2544 gdb_assert (gdbarch != NULL);
2545 return gdbarch->get_longjmp_target != NULL;
2546 }
2547
2548 int
2549 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
2550 {
2551 gdb_assert (gdbarch != NULL);
2552 gdb_assert (gdbarch->get_longjmp_target != NULL);
2553 if (gdbarch_debug >= 2)
2554 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
2555 return gdbarch->get_longjmp_target (pc);
2556 }
2557
2558 void
2559 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2560 gdbarch_get_longjmp_target_ftype get_longjmp_target)
2561 {
2562 gdbarch->get_longjmp_target = get_longjmp_target;
2563 }
2564
2565 int
2566 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2567 {
2568 gdb_assert (gdbarch != NULL);
2569 if (gdbarch_debug >= 2)
2570 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2571 return gdbarch->believe_pcc_promotion;
2572 }
2573
2574 void
2575 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2576 int believe_pcc_promotion)
2577 {
2578 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2579 }
2580
2581 int
2582 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
2583 {
2584 gdb_assert (gdbarch != NULL);
2585 gdb_assert (gdbarch->convert_register_p != NULL);
2586 if (gdbarch_debug >= 2)
2587 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
2588 return gdbarch->convert_register_p (regnum, type);
2589 }
2590
2591 void
2592 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2593 gdbarch_convert_register_p_ftype convert_register_p)
2594 {
2595 gdbarch->convert_register_p = convert_register_p;
2596 }
2597
2598 void
2599 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf)
2600 {
2601 gdb_assert (gdbarch != NULL);
2602 gdb_assert (gdbarch->register_to_value != NULL);
2603 if (gdbarch_debug >= 2)
2604 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2605 gdbarch->register_to_value (frame, regnum, type, buf);
2606 }
2607
2608 void
2609 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2610 gdbarch_register_to_value_ftype register_to_value)
2611 {
2612 gdbarch->register_to_value = register_to_value;
2613 }
2614
2615 void
2616 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
2617 {
2618 gdb_assert (gdbarch != NULL);
2619 gdb_assert (gdbarch->value_to_register != NULL);
2620 if (gdbarch_debug >= 2)
2621 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2622 gdbarch->value_to_register (frame, regnum, type, buf);
2623 }
2624
2625 void
2626 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2627 gdbarch_value_to_register_ftype value_to_register)
2628 {
2629 gdbarch->value_to_register = value_to_register;
2630 }
2631
2632 struct value *
2633 gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
2634 {
2635 gdb_assert (gdbarch != NULL);
2636 gdb_assert (gdbarch->value_from_register != NULL);
2637 if (gdbarch_debug >= 2)
2638 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
2639 return gdbarch->value_from_register (type, regnum, frame);
2640 }
2641
2642 void
2643 set_gdbarch_value_from_register (struct gdbarch *gdbarch,
2644 gdbarch_value_from_register_ftype value_from_register)
2645 {
2646 gdbarch->value_from_register = value_from_register;
2647 }
2648
2649 CORE_ADDR
2650 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2651 {
2652 gdb_assert (gdbarch != NULL);
2653 gdb_assert (gdbarch->pointer_to_address != NULL);
2654 if (gdbarch_debug >= 2)
2655 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2656 return gdbarch->pointer_to_address (type, buf);
2657 }
2658
2659 void
2660 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2661 gdbarch_pointer_to_address_ftype pointer_to_address)
2662 {
2663 gdbarch->pointer_to_address = pointer_to_address;
2664 }
2665
2666 void
2667 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
2668 {
2669 gdb_assert (gdbarch != NULL);
2670 gdb_assert (gdbarch->address_to_pointer != NULL);
2671 if (gdbarch_debug >= 2)
2672 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2673 gdbarch->address_to_pointer (type, buf, addr);
2674 }
2675
2676 void
2677 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2678 gdbarch_address_to_pointer_ftype address_to_pointer)
2679 {
2680 gdbarch->address_to_pointer = address_to_pointer;
2681 }
2682
2683 int
2684 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2685 {
2686 gdb_assert (gdbarch != NULL);
2687 return gdbarch->integer_to_address != NULL;
2688 }
2689
2690 CORE_ADDR
2691 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2692 {
2693 gdb_assert (gdbarch != NULL);
2694 gdb_assert (gdbarch->integer_to_address != NULL);
2695 if (gdbarch_debug >= 2)
2696 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2697 return gdbarch->integer_to_address (gdbarch, type, buf);
2698 }
2699
2700 void
2701 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2702 gdbarch_integer_to_address_ftype integer_to_address)
2703 {
2704 gdbarch->integer_to_address = integer_to_address;
2705 }
2706
2707 int
2708 gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch)
2709 {
2710 gdb_assert (gdbarch != NULL);
2711 return gdbarch->deprecated_store_struct_return != NULL;
2712 }
2713
2714 void
2715 gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
2716 {
2717 gdb_assert (gdbarch != NULL);
2718 gdb_assert (gdbarch->deprecated_store_struct_return != NULL);
2719 if (gdbarch_debug >= 2)
2720 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_struct_return called\n");
2721 gdbarch->deprecated_store_struct_return (addr, sp);
2722 }
2723
2724 void
2725 set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch,
2726 gdbarch_deprecated_store_struct_return_ftype deprecated_store_struct_return)
2727 {
2728 gdbarch->deprecated_store_struct_return = deprecated_store_struct_return;
2729 }
2730
2731 int
2732 gdbarch_return_value_p (struct gdbarch *gdbarch)
2733 {
2734 gdb_assert (gdbarch != NULL);
2735 return gdbarch->return_value != legacy_return_value;
2736 }
2737
2738 enum return_value_convention
2739 gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2740 {
2741 gdb_assert (gdbarch != NULL);
2742 gdb_assert (gdbarch->return_value != NULL);
2743 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2744 if (gdbarch_debug >= 2)
2745 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2746 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
2747 }
2748
2749 void
2750 set_gdbarch_return_value (struct gdbarch *gdbarch,
2751 gdbarch_return_value_ftype return_value)
2752 {
2753 gdbarch->return_value = return_value;
2754 }
2755
2756 void
2757 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf)
2758 {
2759 gdb_assert (gdbarch != NULL);
2760 gdb_assert (gdbarch->extract_return_value != NULL);
2761 if (gdbarch_debug >= 2)
2762 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
2763 gdbarch->extract_return_value (type, regcache, valbuf);
2764 }
2765
2766 void
2767 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
2768 gdbarch_extract_return_value_ftype extract_return_value)
2769 {
2770 gdbarch->extract_return_value = extract_return_value;
2771 }
2772
2773 void
2774 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
2775 {
2776 gdb_assert (gdbarch != NULL);
2777 gdb_assert (gdbarch->store_return_value != NULL);
2778 if (gdbarch_debug >= 2)
2779 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
2780 gdbarch->store_return_value (type, regcache, valbuf);
2781 }
2782
2783 void
2784 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
2785 gdbarch_store_return_value_ftype store_return_value)
2786 {
2787 gdbarch->store_return_value = store_return_value;
2788 }
2789
2790 int
2791 gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
2792 {
2793 gdb_assert (gdbarch != NULL);
2794 gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
2795 if (gdbarch_debug >= 2)
2796 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
2797 return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
2798 }
2799
2800 void
2801 set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
2802 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
2803 {
2804 gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
2805 }
2806
2807 int
2808 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
2809 {
2810 gdb_assert (gdbarch != NULL);
2811 return gdbarch->deprecated_extract_struct_value_address != NULL;
2812 }
2813
2814 CORE_ADDR
2815 gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
2816 {
2817 gdb_assert (gdbarch != NULL);
2818 gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL);
2819 if (gdbarch_debug >= 2)
2820 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
2821 return gdbarch->deprecated_extract_struct_value_address (regcache);
2822 }
2823
2824 void
2825 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
2826 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
2827 {
2828 gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
2829 }
2830
2831 CORE_ADDR
2832 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2833 {
2834 gdb_assert (gdbarch != NULL);
2835 gdb_assert (gdbarch->skip_prologue != NULL);
2836 if (gdbarch_debug >= 2)
2837 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2838 return gdbarch->skip_prologue (ip);
2839 }
2840
2841 void
2842 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2843 gdbarch_skip_prologue_ftype skip_prologue)
2844 {
2845 gdbarch->skip_prologue = skip_prologue;
2846 }
2847
2848 int
2849 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2850 {
2851 gdb_assert (gdbarch != NULL);
2852 gdb_assert (gdbarch->inner_than != NULL);
2853 if (gdbarch_debug >= 2)
2854 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2855 return gdbarch->inner_than (lhs, rhs);
2856 }
2857
2858 void
2859 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2860 gdbarch_inner_than_ftype inner_than)
2861 {
2862 gdbarch->inner_than = inner_than;
2863 }
2864
2865 const gdb_byte *
2866 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2867 {
2868 gdb_assert (gdbarch != NULL);
2869 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2870 if (gdbarch_debug >= 2)
2871 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2872 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
2873 }
2874
2875 void
2876 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2877 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2878 {
2879 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2880 }
2881
2882 int
2883 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2884 {
2885 gdb_assert (gdbarch != NULL);
2886 return gdbarch->adjust_breakpoint_address != NULL;
2887 }
2888
2889 CORE_ADDR
2890 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2891 {
2892 gdb_assert (gdbarch != NULL);
2893 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2894 if (gdbarch_debug >= 2)
2895 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2896 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2897 }
2898
2899 void
2900 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2901 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2902 {
2903 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2904 }
2905
2906 int
2907 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2908 {
2909 gdb_assert (gdbarch != NULL);
2910 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2911 if (gdbarch_debug >= 2)
2912 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2913 return gdbarch->memory_insert_breakpoint (bp_tgt);
2914 }
2915
2916 void
2917 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2918 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2919 {
2920 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2921 }
2922
2923 int
2924 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2925 {
2926 gdb_assert (gdbarch != NULL);
2927 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2928 if (gdbarch_debug >= 2)
2929 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2930 return gdbarch->memory_remove_breakpoint (bp_tgt);
2931 }
2932
2933 void
2934 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2935 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2936 {
2937 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2938 }
2939
2940 CORE_ADDR
2941 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2942 {
2943 gdb_assert (gdbarch != NULL);
2944 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2945 if (gdbarch_debug >= 2)
2946 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2947 return gdbarch->decr_pc_after_break;
2948 }
2949
2950 void
2951 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2952 CORE_ADDR decr_pc_after_break)
2953 {
2954 gdbarch->decr_pc_after_break = decr_pc_after_break;
2955 }
2956
2957 CORE_ADDR
2958 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2959 {
2960 gdb_assert (gdbarch != NULL);
2961 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2962 if (gdbarch_debug >= 2)
2963 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2964 return gdbarch->deprecated_function_start_offset;
2965 }
2966
2967 void
2968 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2969 CORE_ADDR deprecated_function_start_offset)
2970 {
2971 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2972 }
2973
2974 void
2975 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)
2976 {
2977 gdb_assert (gdbarch != NULL);
2978 gdb_assert (gdbarch->remote_translate_xfer_address != NULL);
2979 if (gdbarch_debug >= 2)
2980 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
2981 gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len);
2982 }
2983
2984 void
2985 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
2986 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
2987 {
2988 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
2989 }
2990
2991 int
2992 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2993 {
2994 gdb_assert (gdbarch != NULL);
2995 return gdbarch->fetch_tls_load_module_address != NULL;
2996 }
2997
2998 CORE_ADDR
2999 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
3000 {
3001 gdb_assert (gdbarch != NULL);
3002 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
3003 if (gdbarch_debug >= 2)
3004 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
3005 return gdbarch->fetch_tls_load_module_address (objfile);
3006 }
3007
3008 void
3009 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
3010 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
3011 {
3012 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
3013 }
3014
3015 CORE_ADDR
3016 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
3017 {
3018 gdb_assert (gdbarch != NULL);
3019 /* Skip verify of frame_args_skip, invalid_p == 0 */
3020 if (gdbarch_debug >= 2)
3021 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
3022 return gdbarch->frame_args_skip;
3023 }
3024
3025 void
3026 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
3027 CORE_ADDR frame_args_skip)
3028 {
3029 gdbarch->frame_args_skip = frame_args_skip;
3030 }
3031
3032 int
3033 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
3034 {
3035 gdb_assert (gdbarch != NULL);
3036 return gdbarch->unwind_pc != NULL;
3037 }
3038
3039 CORE_ADDR
3040 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
3041 {
3042 gdb_assert (gdbarch != NULL);
3043 gdb_assert (gdbarch->unwind_pc != NULL);
3044 if (gdbarch_debug >= 2)
3045 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
3046 return gdbarch->unwind_pc (gdbarch, next_frame);
3047 }
3048
3049 void
3050 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
3051 gdbarch_unwind_pc_ftype unwind_pc)
3052 {
3053 gdbarch->unwind_pc = unwind_pc;
3054 }
3055
3056 int
3057 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
3058 {
3059 gdb_assert (gdbarch != NULL);
3060 return gdbarch->unwind_sp != NULL;
3061 }
3062
3063 CORE_ADDR
3064 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
3065 {
3066 gdb_assert (gdbarch != NULL);
3067 gdb_assert (gdbarch->unwind_sp != NULL);
3068 if (gdbarch_debug >= 2)
3069 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
3070 return gdbarch->unwind_sp (gdbarch, next_frame);
3071 }
3072
3073 void
3074 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
3075 gdbarch_unwind_sp_ftype unwind_sp)
3076 {
3077 gdbarch->unwind_sp = unwind_sp;
3078 }
3079
3080 int
3081 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
3082 {
3083 gdb_assert (gdbarch != NULL);
3084 return gdbarch->frame_num_args != NULL;
3085 }
3086
3087 int
3088 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
3089 {
3090 gdb_assert (gdbarch != NULL);
3091 gdb_assert (gdbarch->frame_num_args != NULL);
3092 if (gdbarch_debug >= 2)
3093 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
3094 return gdbarch->frame_num_args (frame);
3095 }
3096
3097 void
3098 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
3099 gdbarch_frame_num_args_ftype frame_num_args)
3100 {
3101 gdbarch->frame_num_args = frame_num_args;
3102 }
3103
3104 int
3105 gdbarch_deprecated_stack_align_p (struct gdbarch *gdbarch)
3106 {
3107 gdb_assert (gdbarch != NULL);
3108 return gdbarch->deprecated_stack_align != NULL;
3109 }
3110
3111 CORE_ADDR
3112 gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
3113 {
3114 gdb_assert (gdbarch != NULL);
3115 gdb_assert (gdbarch->deprecated_stack_align != NULL);
3116 if (gdbarch_debug >= 2)
3117 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_stack_align called\n");
3118 return gdbarch->deprecated_stack_align (sp);
3119 }
3120
3121 void
3122 set_gdbarch_deprecated_stack_align (struct gdbarch *gdbarch,
3123 gdbarch_deprecated_stack_align_ftype deprecated_stack_align)
3124 {
3125 gdbarch->deprecated_stack_align = deprecated_stack_align;
3126 }
3127
3128 int
3129 gdbarch_frame_align_p (struct gdbarch *gdbarch)
3130 {
3131 gdb_assert (gdbarch != NULL);
3132 return gdbarch->frame_align != NULL;
3133 }
3134
3135 CORE_ADDR
3136 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
3137 {
3138 gdb_assert (gdbarch != NULL);
3139 gdb_assert (gdbarch->frame_align != NULL);
3140 if (gdbarch_debug >= 2)
3141 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
3142 return gdbarch->frame_align (gdbarch, address);
3143 }
3144
3145 void
3146 set_gdbarch_frame_align (struct gdbarch *gdbarch,
3147 gdbarch_frame_align_ftype frame_align)
3148 {
3149 gdbarch->frame_align = frame_align;
3150 }
3151
3152 int
3153 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
3154 {
3155 gdb_assert (gdbarch != NULL);
3156 return gdbarch->deprecated_reg_struct_has_addr != NULL;
3157 }
3158
3159 int
3160 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
3161 {
3162 gdb_assert (gdbarch != NULL);
3163 gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
3164 if (gdbarch_debug >= 2)
3165 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
3166 return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
3167 }
3168
3169 void
3170 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
3171 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
3172 {
3173 gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
3174 }
3175
3176 int
3177 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
3178 {
3179 gdb_assert (gdbarch != NULL);
3180 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
3181 if (gdbarch_debug >= 2)
3182 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
3183 return gdbarch->stabs_argument_has_addr (gdbarch, type);
3184 }
3185
3186 void
3187 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
3188 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
3189 {
3190 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
3191 }
3192
3193 int
3194 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
3195 {
3196 gdb_assert (gdbarch != NULL);
3197 if (gdbarch_debug >= 2)
3198 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
3199 return gdbarch->frame_red_zone_size;
3200 }
3201
3202 void
3203 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
3204 int frame_red_zone_size)
3205 {
3206 gdbarch->frame_red_zone_size = frame_red_zone_size;
3207 }
3208
3209 CORE_ADDR
3210 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
3211 {
3212 gdb_assert (gdbarch != NULL);
3213 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
3214 if (gdbarch_debug >= 2)
3215 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
3216 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
3217 }
3218
3219 void
3220 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
3221 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
3222 {
3223 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
3224 }
3225
3226 CORE_ADDR
3227 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
3228 {
3229 gdb_assert (gdbarch != NULL);
3230 gdb_assert (gdbarch->addr_bits_remove != NULL);
3231 if (gdbarch_debug >= 2)
3232 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
3233 return gdbarch->addr_bits_remove (addr);
3234 }
3235
3236 void
3237 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
3238 gdbarch_addr_bits_remove_ftype addr_bits_remove)
3239 {
3240 gdbarch->addr_bits_remove = addr_bits_remove;
3241 }
3242
3243 CORE_ADDR
3244 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
3245 {
3246 gdb_assert (gdbarch != NULL);
3247 gdb_assert (gdbarch->smash_text_address != NULL);
3248 if (gdbarch_debug >= 2)
3249 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
3250 return gdbarch->smash_text_address (addr);
3251 }
3252
3253 void
3254 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
3255 gdbarch_smash_text_address_ftype smash_text_address)
3256 {
3257 gdbarch->smash_text_address = smash_text_address;
3258 }
3259
3260 int
3261 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
3262 {
3263 gdb_assert (gdbarch != NULL);
3264 return gdbarch->software_single_step != NULL;
3265 }
3266
3267 void
3268 gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
3269 {
3270 gdb_assert (gdbarch != NULL);
3271 gdb_assert (gdbarch->software_single_step != NULL);
3272 if (gdbarch_debug >= 2)
3273 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
3274 gdbarch->software_single_step (sig, insert_breakpoints_p);
3275 }
3276
3277 void
3278 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
3279 gdbarch_software_single_step_ftype software_single_step)
3280 {
3281 gdbarch->software_single_step = software_single_step;
3282 }
3283
3284 int
3285 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
3286 {
3287 gdb_assert (gdbarch != NULL);
3288 return gdbarch->single_step_through_delay != NULL;
3289 }
3290
3291 int
3292 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
3293 {
3294 gdb_assert (gdbarch != NULL);
3295 gdb_assert (gdbarch->single_step_through_delay != NULL);
3296 if (gdbarch_debug >= 2)
3297 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
3298 return gdbarch->single_step_through_delay (gdbarch, frame);
3299 }
3300
3301 void
3302 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
3303 gdbarch_single_step_through_delay_ftype single_step_through_delay)
3304 {
3305 gdbarch->single_step_through_delay = single_step_through_delay;
3306 }
3307
3308 int
3309 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
3310 {
3311 gdb_assert (gdbarch != NULL);
3312 gdb_assert (gdbarch->print_insn != NULL);
3313 if (gdbarch_debug >= 2)
3314 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
3315 return gdbarch->print_insn (vma, info);
3316 }
3317
3318 void
3319 set_gdbarch_print_insn (struct gdbarch *gdbarch,
3320 gdbarch_print_insn_ftype print_insn)
3321 {
3322 gdbarch->print_insn = print_insn;
3323 }
3324
3325 CORE_ADDR
3326 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
3327 {
3328 gdb_assert (gdbarch != NULL);
3329 gdb_assert (gdbarch->skip_trampoline_code != NULL);
3330 if (gdbarch_debug >= 2)
3331 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
3332 return gdbarch->skip_trampoline_code (pc);
3333 }
3334
3335 void
3336 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
3337 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
3338 {
3339 gdbarch->skip_trampoline_code = skip_trampoline_code;
3340 }
3341
3342 CORE_ADDR
3343 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
3344 {
3345 gdb_assert (gdbarch != NULL);
3346 gdb_assert (gdbarch->skip_solib_resolver != NULL);
3347 if (gdbarch_debug >= 2)
3348 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
3349 return gdbarch->skip_solib_resolver (gdbarch, pc);
3350 }
3351
3352 void
3353 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
3354 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
3355 {
3356 gdbarch->skip_solib_resolver = skip_solib_resolver;
3357 }
3358
3359 int
3360 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
3361 {
3362 gdb_assert (gdbarch != NULL);
3363 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
3364 if (gdbarch_debug >= 2)
3365 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
3366 return gdbarch->in_solib_return_trampoline (pc, name);
3367 }
3368
3369 void
3370 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
3371 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
3372 {
3373 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
3374 }
3375
3376 int
3377 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
3378 {
3379 gdb_assert (gdbarch != NULL);
3380 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
3381 if (gdbarch_debug >= 2)
3382 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
3383 return gdbarch->in_function_epilogue_p (gdbarch, addr);
3384 }
3385
3386 void
3387 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
3388 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
3389 {
3390 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
3391 }
3392
3393 char *
3394 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
3395 {
3396 gdb_assert (gdbarch != NULL);
3397 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
3398 if (gdbarch_debug >= 2)
3399 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
3400 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
3401 }
3402
3403 void
3404 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
3405 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
3406 {
3407 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
3408 }
3409
3410 void
3411 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
3412 {
3413 gdb_assert (gdbarch != NULL);
3414 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
3415 if (gdbarch_debug >= 2)
3416 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
3417 gdbarch->elf_make_msymbol_special (sym, msym);
3418 }
3419
3420 void
3421 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
3422 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
3423 {
3424 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
3425 }
3426
3427 void
3428 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
3429 {
3430 gdb_assert (gdbarch != NULL);
3431 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
3432 if (gdbarch_debug >= 2)
3433 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
3434 gdbarch->coff_make_msymbol_special (val, msym);
3435 }
3436
3437 void
3438 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
3439 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
3440 {
3441 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
3442 }
3443
3444 const char *
3445 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
3446 {
3447 gdb_assert (gdbarch != NULL);
3448 /* Skip verify of name_of_malloc, invalid_p == 0 */
3449 if (gdbarch_debug >= 2)
3450 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
3451 return gdbarch->name_of_malloc;
3452 }
3453
3454 void
3455 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
3456 const char * name_of_malloc)
3457 {
3458 gdbarch->name_of_malloc = name_of_malloc;
3459 }
3460
3461 int
3462 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
3463 {
3464 gdb_assert (gdbarch != NULL);
3465 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3466 if (gdbarch_debug >= 2)
3467 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
3468 return gdbarch->cannot_step_breakpoint;
3469 }
3470
3471 void
3472 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
3473 int cannot_step_breakpoint)
3474 {
3475 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
3476 }
3477
3478 int
3479 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
3480 {
3481 gdb_assert (gdbarch != NULL);
3482 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3483 if (gdbarch_debug >= 2)
3484 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
3485 return gdbarch->have_nonsteppable_watchpoint;
3486 }
3487
3488 void
3489 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
3490 int have_nonsteppable_watchpoint)
3491 {
3492 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
3493 }
3494
3495 int
3496 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
3497 {
3498 gdb_assert (gdbarch != NULL);
3499 return gdbarch->address_class_type_flags != NULL;
3500 }
3501
3502 int
3503 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
3504 {
3505 gdb_assert (gdbarch != NULL);
3506 gdb_assert (gdbarch->address_class_type_flags != NULL);
3507 if (gdbarch_debug >= 2)
3508 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
3509 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
3510 }
3511
3512 void
3513 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
3514 gdbarch_address_class_type_flags_ftype address_class_type_flags)
3515 {
3516 gdbarch->address_class_type_flags = address_class_type_flags;
3517 }
3518
3519 int
3520 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
3521 {
3522 gdb_assert (gdbarch != NULL);
3523 return gdbarch->address_class_type_flags_to_name != NULL;
3524 }
3525
3526 const char *
3527 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
3528 {
3529 gdb_assert (gdbarch != NULL);
3530 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
3531 if (gdbarch_debug >= 2)
3532 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
3533 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
3534 }
3535
3536 void
3537 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
3538 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
3539 {
3540 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
3541 }
3542
3543 int
3544 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
3545 {
3546 gdb_assert (gdbarch != NULL);
3547 return gdbarch->address_class_name_to_type_flags != NULL;
3548 }
3549
3550 int
3551 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
3552 {
3553 gdb_assert (gdbarch != NULL);
3554 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
3555 if (gdbarch_debug >= 2)
3556 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
3557 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
3558 }
3559
3560 void
3561 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
3562 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
3563 {
3564 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
3565 }
3566
3567 int
3568 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
3569 {
3570 gdb_assert (gdbarch != NULL);
3571 gdb_assert (gdbarch->register_reggroup_p != NULL);
3572 if (gdbarch_debug >= 2)
3573 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
3574 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
3575 }
3576
3577 void
3578 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
3579 gdbarch_register_reggroup_p_ftype register_reggroup_p)
3580 {
3581 gdbarch->register_reggroup_p = register_reggroup_p;
3582 }
3583
3584 int
3585 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
3586 {
3587 gdb_assert (gdbarch != NULL);
3588 return gdbarch->fetch_pointer_argument != NULL;
3589 }
3590
3591 CORE_ADDR
3592 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
3593 {
3594 gdb_assert (gdbarch != NULL);
3595 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
3596 if (gdbarch_debug >= 2)
3597 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
3598 return gdbarch->fetch_pointer_argument (frame, argi, type);
3599 }
3600
3601 void
3602 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
3603 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
3604 {
3605 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
3606 }
3607
3608 int
3609 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
3610 {
3611 gdb_assert (gdbarch != NULL);
3612 return gdbarch->regset_from_core_section != NULL;
3613 }
3614
3615 const struct regset *
3616 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
3617 {
3618 gdb_assert (gdbarch != NULL);
3619 gdb_assert (gdbarch->regset_from_core_section != NULL);
3620 if (gdbarch_debug >= 2)
3621 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
3622 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
3623 }
3624
3625 void
3626 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
3627 gdbarch_regset_from_core_section_ftype regset_from_core_section)
3628 {
3629 gdbarch->regset_from_core_section = regset_from_core_section;
3630 }
3631
3632 int
3633 gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
3634 {
3635 gdb_assert (gdbarch != NULL);
3636 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3637 if (gdbarch_debug >= 2)
3638 fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
3639 return gdbarch->vtable_function_descriptors;
3640 }
3641
3642 void
3643 set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
3644 int vtable_function_descriptors)
3645 {
3646 gdbarch->vtable_function_descriptors = vtable_function_descriptors;
3647 }
3648
3649 int
3650 gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
3651 {
3652 gdb_assert (gdbarch != NULL);
3653 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3654 if (gdbarch_debug >= 2)
3655 fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
3656 return gdbarch->vbit_in_delta;
3657 }
3658
3659 void
3660 set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
3661 int vbit_in_delta)
3662 {
3663 gdbarch->vbit_in_delta = vbit_in_delta;
3664 }
3665
3666
3667 /* Keep a registry of per-architecture data-pointers required by GDB
3668 modules. */
3669
3670 struct gdbarch_data
3671 {
3672 unsigned index;
3673 int init_p;
3674 gdbarch_data_pre_init_ftype *pre_init;
3675 gdbarch_data_post_init_ftype *post_init;
3676 };
3677
3678 struct gdbarch_data_registration
3679 {
3680 struct gdbarch_data *data;
3681 struct gdbarch_data_registration *next;
3682 };
3683
3684 struct gdbarch_data_registry
3685 {
3686 unsigned nr;
3687 struct gdbarch_data_registration *registrations;
3688 };
3689
3690 struct gdbarch_data_registry gdbarch_data_registry =
3691 {
3692 0, NULL,
3693 };
3694
3695 static struct gdbarch_data *
3696 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3697 gdbarch_data_post_init_ftype *post_init)
3698 {
3699 struct gdbarch_data_registration **curr;
3700 /* Append the new registraration. */
3701 for (curr = &gdbarch_data_registry.registrations;
3702 (*curr) != NULL;
3703 curr = &(*curr)->next);
3704 (*curr) = XMALLOC (struct gdbarch_data_registration);
3705 (*curr)->next = NULL;
3706 (*curr)->data = XMALLOC (struct gdbarch_data);
3707 (*curr)->data->index = gdbarch_data_registry.nr++;
3708 (*curr)->data->pre_init = pre_init;
3709 (*curr)->data->post_init = post_init;
3710 (*curr)->data->init_p = 1;
3711 return (*curr)->data;
3712 }
3713
3714 struct gdbarch_data *
3715 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3716 {
3717 return gdbarch_data_register (pre_init, NULL);
3718 }
3719
3720 struct gdbarch_data *
3721 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3722 {
3723 return gdbarch_data_register (NULL, post_init);
3724 }
3725
3726 /* Create/delete the gdbarch data vector. */
3727
3728 static void
3729 alloc_gdbarch_data (struct gdbarch *gdbarch)
3730 {
3731 gdb_assert (gdbarch->data == NULL);
3732 gdbarch->nr_data = gdbarch_data_registry.nr;
3733 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3734 }
3735
3736 /* Initialize the current value of the specified per-architecture
3737 data-pointer. */
3738
3739 void
3740 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3741 struct gdbarch_data *data,
3742 void *pointer)
3743 {
3744 gdb_assert (data->index < gdbarch->nr_data);
3745 gdb_assert (gdbarch->data[data->index] == NULL);
3746 gdb_assert (data->pre_init == NULL);
3747 gdbarch->data[data->index] = pointer;
3748 }
3749
3750 /* Return the current value of the specified per-architecture
3751 data-pointer. */
3752
3753 void *
3754 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3755 {
3756 gdb_assert (data->index < gdbarch->nr_data);
3757 if (gdbarch->data[data->index] == NULL)
3758 {
3759 /* The data-pointer isn't initialized, call init() to get a
3760 value. */
3761 if (data->pre_init != NULL)
3762 /* Mid architecture creation: pass just the obstack, and not
3763 the entire architecture, as that way it isn't possible for
3764 pre-init code to refer to undefined architecture
3765 fields. */
3766 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3767 else if (gdbarch->initialized_p
3768 && data->post_init != NULL)
3769 /* Post architecture creation: pass the entire architecture
3770 (as all fields are valid), but be careful to also detect
3771 recursive references. */
3772 {
3773 gdb_assert (data->init_p);
3774 data->init_p = 0;
3775 gdbarch->data[data->index] = data->post_init (gdbarch);
3776 data->init_p = 1;
3777 }
3778 else
3779 /* The architecture initialization hasn't completed - punt -
3780 hope that the caller knows what they are doing. Once
3781 deprecated_set_gdbarch_data has been initialized, this can be
3782 changed to an internal error. */
3783 return NULL;
3784 gdb_assert (gdbarch->data[data->index] != NULL);
3785 }
3786 return gdbarch->data[data->index];
3787 }
3788
3789
3790
3791 /* Keep a registry of swapped data required by GDB modules. */
3792
3793 struct gdbarch_swap
3794 {
3795 void *swap;
3796 struct gdbarch_swap_registration *source;
3797 struct gdbarch_swap *next;
3798 };
3799
3800 struct gdbarch_swap_registration
3801 {
3802 void *data;
3803 unsigned long sizeof_data;
3804 gdbarch_swap_ftype *init;
3805 struct gdbarch_swap_registration *next;
3806 };
3807
3808 struct gdbarch_swap_registry
3809 {
3810 int nr;
3811 struct gdbarch_swap_registration *registrations;
3812 };
3813
3814 struct gdbarch_swap_registry gdbarch_swap_registry =
3815 {
3816 0, NULL,
3817 };
3818
3819 void
3820 deprecated_register_gdbarch_swap (void *data,
3821 unsigned long sizeof_data,
3822 gdbarch_swap_ftype *init)
3823 {
3824 struct gdbarch_swap_registration **rego;
3825 for (rego = &gdbarch_swap_registry.registrations;
3826 (*rego) != NULL;
3827 rego = &(*rego)->next);
3828 (*rego) = XMALLOC (struct gdbarch_swap_registration);
3829 (*rego)->next = NULL;
3830 (*rego)->init = init;
3831 (*rego)->data = data;
3832 (*rego)->sizeof_data = sizeof_data;
3833 }
3834
3835 static void
3836 current_gdbarch_swap_init_hack (void)
3837 {
3838 struct gdbarch_swap_registration *rego;
3839 struct gdbarch_swap **curr = &current_gdbarch->swap;
3840 for (rego = gdbarch_swap_registry.registrations;
3841 rego != NULL;
3842 rego = rego->next)
3843 {
3844 if (rego->data != NULL)
3845 {
3846 (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch,
3847 struct gdbarch_swap);
3848 (*curr)->source = rego;
3849 (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch,
3850 rego->sizeof_data);
3851 (*curr)->next = NULL;
3852 curr = &(*curr)->next;
3853 }
3854 if (rego->init != NULL)
3855 rego->init ();
3856 }
3857 }
3858
3859 static struct gdbarch *
3860 current_gdbarch_swap_out_hack (void)
3861 {
3862 struct gdbarch *old_gdbarch = current_gdbarch;
3863 struct gdbarch_swap *curr;
3864
3865 gdb_assert (old_gdbarch != NULL);
3866 for (curr = old_gdbarch->swap;
3867 curr != NULL;
3868 curr = curr->next)
3869 {
3870 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
3871 memset (curr->source->data, 0, curr->source->sizeof_data);
3872 }
3873 current_gdbarch = NULL;
3874 return old_gdbarch;
3875 }
3876
3877 static void
3878 current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch)
3879 {
3880 struct gdbarch_swap *curr;
3881
3882 gdb_assert (current_gdbarch == NULL);
3883 for (curr = new_gdbarch->swap;
3884 curr != NULL;
3885 curr = curr->next)
3886 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
3887 current_gdbarch = new_gdbarch;
3888 }
3889
3890
3891 /* Keep a registry of the architectures known by GDB. */
3892
3893 struct gdbarch_registration
3894 {
3895 enum bfd_architecture bfd_architecture;
3896 gdbarch_init_ftype *init;
3897 gdbarch_dump_tdep_ftype *dump_tdep;
3898 struct gdbarch_list *arches;
3899 struct gdbarch_registration *next;
3900 };
3901
3902 static struct gdbarch_registration *gdbarch_registry = NULL;
3903
3904 static void
3905 append_name (const char ***buf, int *nr, const char *name)
3906 {
3907 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3908 (*buf)[*nr] = name;
3909 *nr += 1;
3910 }
3911
3912 const char **
3913 gdbarch_printable_names (void)
3914 {
3915 /* Accumulate a list of names based on the registed list of
3916 architectures. */
3917 enum bfd_architecture a;
3918 int nr_arches = 0;
3919 const char **arches = NULL;
3920 struct gdbarch_registration *rego;
3921 for (rego = gdbarch_registry;
3922 rego != NULL;
3923 rego = rego->next)
3924 {
3925 const struct bfd_arch_info *ap;
3926 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3927 if (ap == NULL)
3928 internal_error (__FILE__, __LINE__,
3929 _("gdbarch_architecture_names: multi-arch unknown"));
3930 do
3931 {
3932 append_name (&arches, &nr_arches, ap->printable_name);
3933 ap = ap->next;
3934 }
3935 while (ap != NULL);
3936 }
3937 append_name (&arches, &nr_arches, NULL);
3938 return arches;
3939 }
3940
3941
3942 void
3943 gdbarch_register (enum bfd_architecture bfd_architecture,
3944 gdbarch_init_ftype *init,
3945 gdbarch_dump_tdep_ftype *dump_tdep)
3946 {
3947 struct gdbarch_registration **curr;
3948 const struct bfd_arch_info *bfd_arch_info;
3949 /* Check that BFD recognizes this architecture */
3950 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3951 if (bfd_arch_info == NULL)
3952 {
3953 internal_error (__FILE__, __LINE__,
3954 _("gdbarch: Attempt to register unknown architecture (%d)"),
3955 bfd_architecture);
3956 }
3957 /* Check that we haven't seen this architecture before */
3958 for (curr = &gdbarch_registry;
3959 (*curr) != NULL;
3960 curr = &(*curr)->next)
3961 {
3962 if (bfd_architecture == (*curr)->bfd_architecture)
3963 internal_error (__FILE__, __LINE__,
3964 _("gdbarch: Duplicate registraration of architecture (%s)"),
3965 bfd_arch_info->printable_name);
3966 }
3967 /* log it */
3968 if (gdbarch_debug)
3969 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
3970 bfd_arch_info->printable_name,
3971 (long) init);
3972 /* Append it */
3973 (*curr) = XMALLOC (struct gdbarch_registration);
3974 (*curr)->bfd_architecture = bfd_architecture;
3975 (*curr)->init = init;
3976 (*curr)->dump_tdep = dump_tdep;
3977 (*curr)->arches = NULL;
3978 (*curr)->next = NULL;
3979 }
3980
3981 void
3982 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3983 gdbarch_init_ftype *init)
3984 {
3985 gdbarch_register (bfd_architecture, init, NULL);
3986 }
3987
3988
3989 /* Look for an architecture using gdbarch_info. */
3990
3991 struct gdbarch_list *
3992 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
3993 const struct gdbarch_info *info)
3994 {
3995 for (; arches != NULL; arches = arches->next)
3996 {
3997 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
3998 continue;
3999 if (info->byte_order != arches->gdbarch->byte_order)
4000 continue;
4001 if (info->osabi != arches->gdbarch->osabi)
4002 continue;
4003 if (info->target_desc != arches->gdbarch->target_desc)
4004 continue;
4005 return arches;
4006 }
4007 return NULL;
4008 }
4009
4010
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. */
4014
4015 static struct gdbarch *
4016 find_arch_by_info (struct gdbarch_info info)
4017 {
4018 struct gdbarch *new_gdbarch;
4019 struct gdbarch_registration *rego;
4020
4021 /* The existing architecture has been swapped out - all this code
4022 works from a clean slate. */
4023 gdb_assert (current_gdbarch == NULL);
4024
4025 /* Fill in missing parts of the INFO struct using a number of
4026 sources: "set ..."; INFOabfd supplied; and the global
4027 defaults. */
4028 gdbarch_info_fill (&info);
4029
4030 /* Must have found some sort of architecture. */
4031 gdb_assert (info.bfd_arch_info != NULL);
4032
4033 if (gdbarch_debug)
4034 {
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
4039 : "(null)"));
4040 fprintf_unfiltered (gdb_stdlog,
4041 "find_arch_by_info: info.byte_order %d (%s)\n",
4042 info.byte_order,
4043 (info.byte_order == BFD_ENDIAN_BIG ? "big"
4044 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
4045 : "default"));
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",
4051 (long) info.abfd);
4052 fprintf_unfiltered (gdb_stdlog,
4053 "find_arch_by_info: info.tdep_info 0x%lx\n",
4054 (long) info.tdep_info);
4055 }
4056
4057 /* Find the tdep code that knows about this architecture. */
4058 for (rego = gdbarch_registry;
4059 rego != NULL;
4060 rego = rego->next)
4061 if (rego->bfd_architecture == info.bfd_arch_info->arch)
4062 break;
4063 if (rego == NULL)
4064 {
4065 if (gdbarch_debug)
4066 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4067 "No matching architecture\n");
4068 return 0;
4069 }
4070
4071 /* Ask the tdep code for an architecture that matches "info". */
4072 new_gdbarch = rego->init (info, rego->arches);
4073
4074 /* Did the tdep code like it? No. Reject the change and revert to
4075 the old architecture. */
4076 if (new_gdbarch == NULL)
4077 {
4078 if (gdbarch_debug)
4079 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4080 "Target rejected architecture\n");
4081 return NULL;
4082 }
4083
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)
4088 {
4089 struct gdbarch_list **list;
4090 struct gdbarch_list *this;
4091 if (gdbarch_debug)
4092 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4093 "Previous architecture 0x%08lx (%s) selected\n",
4094 (long) new_gdbarch,
4095 new_gdbarch->bfd_arch_info->printable_name);
4096 /* Find the existing arch in the list. */
4097 for (list = &rego->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);
4102 /* Unlink THIS. */
4103 this = (*list);
4104 (*list) = this->next;
4105 /* Insert THIS at the front. */
4106 this->next = rego->arches;
4107 rego->arches = this;
4108 /* Return it. */
4109 return new_gdbarch;
4110 }
4111
4112 /* It's a new architecture. */
4113 if (gdbarch_debug)
4114 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4115 "New architecture 0x%08lx (%s) selected\n",
4116 (long) new_gdbarch,
4117 new_gdbarch->bfd_arch_info->printable_name);
4118
4119 /* Insert the new architecture into the front of the architecture
4120 list (keep the list sorted Most Recently Used). */
4121 {
4122 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
4123 this->next = rego->arches;
4124 this->gdbarch = new_gdbarch;
4125 rego->arches = this;
4126 }
4127
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;
4133
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 ();
4140
4141 if (gdbarch_debug)
4142 gdbarch_dump (new_gdbarch, gdb_stdlog);
4143
4144 return new_gdbarch;
4145 }
4146
4147 struct gdbarch *
4148 gdbarch_find_by_info (struct gdbarch_info info)
4149 {
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 ();
4157
4158 /* Find the specified architecture. */
4159 struct gdbarch *new_gdbarch = find_arch_by_info (info);
4160
4161 /* Restore the existing architecture. */
4162 gdb_assert (current_gdbarch == NULL);
4163 current_gdbarch_swap_in_hack (old_gdbarch);
4164
4165 return new_gdbarch;
4166 }
4167
4168 /* Make the specified architecture current, swapping the existing one
4169 out. */
4170
4171 void
4172 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
4173 {
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 ();
4180 flush_cached_frames ();
4181 }
4182
4183 extern void _initialize_gdbarch (void);
4184
4185 void
4186 _initialize_gdbarch (void)
4187 {
4188 struct cmd_list_element *c;
4189
4190 add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
4191 Set architecture debugging."), _("\
4192 Show architecture debugging."), _("\
4193 When non-zero, architecture debugging is enabled."),
4194 NULL,
4195 show_gdbarch_debug,
4196 &setdebuglist, &showdebuglist);
4197 }
This page took 0.119109 seconds and 5 git commands to generate.