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