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