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