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