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