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