* gdbarch.sh (struct regcache): Add opaque declaration.
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
2
3 /* Dynamic architecture support for GDB, the GNU debugger.
4 Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
5
6 This file is part of GDB.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
22
23 /* This file was created with the aid of ``gdbarch.sh''.
24
25 The Bourne shell script ``gdbarch.sh'' creates the files
26 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
27 against the existing ``gdbarch.[hc]''. Any differences found
28 being reported.
29
30 If editing this file, please also run gdbarch.sh and merge any
31 changes into that script. Conversely, when making sweeping changes
32 to this file, modifying gdbarch.sh and using its output may prove
33 easier. */
34
35
36 #include "defs.h"
37 #include "arch-utils.h"
38
39 #if GDB_MULTI_ARCH
40 #include "gdbcmd.h"
41 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
42 #else
43 /* Just include everything in sight so that the every old definition
44 of macro is visible. */
45 #include "gdb_string.h"
46 #include <ctype.h>
47 #include "symtab.h"
48 #include "frame.h"
49 #include "inferior.h"
50 #include "breakpoint.h"
51 #include "gdb_wait.h"
52 #include "gdbcore.h"
53 #include "gdbcmd.h"
54 #include "target.h"
55 #include "gdbthread.h"
56 #include "annotate.h"
57 #include "symfile.h" /* for overlay functions */
58 #include "value.h" /* For old tm.h/nm.h macros. */
59 #endif
60 #include "symcat.h"
61
62 #include "floatformat.h"
63
64 #include "gdb_assert.h"
65 #include "gdb-events.h"
66
67 /* Static function declarations */
68
69 static void verify_gdbarch (struct gdbarch *gdbarch);
70 static void alloc_gdbarch_data (struct gdbarch *);
71 static void free_gdbarch_data (struct gdbarch *);
72 static void init_gdbarch_swap (struct gdbarch *);
73 static void clear_gdbarch_swap (struct gdbarch *);
74 static void swapout_gdbarch_swap (struct gdbarch *);
75 static void swapin_gdbarch_swap (struct gdbarch *);
76
77 /* Non-zero if we want to trace architecture code. */
78
79 #ifndef GDBARCH_DEBUG
80 #define GDBARCH_DEBUG 0
81 #endif
82 int gdbarch_debug = GDBARCH_DEBUG;
83
84
85 /* Maintain the struct gdbarch object */
86
87 struct gdbarch
88 {
89 /* Has this architecture been fully initialized? */
90 int initialized_p;
91 /* basic architectural information */
92 const struct bfd_arch_info * bfd_arch_info;
93 int byte_order;
94
95 /* target specific vector. */
96 struct gdbarch_tdep *tdep;
97 gdbarch_dump_tdep_ftype *dump_tdep;
98
99 /* per-architecture data-pointers */
100 unsigned nr_data;
101 void **data;
102
103 /* per-architecture swap-regions */
104 struct gdbarch_swap *swap;
105
106 /* Multi-arch values.
107
108 When extending this structure you must:
109
110 Add the field below.
111
112 Declare set/get functions and define the corresponding
113 macro in gdbarch.h.
114
115 gdbarch_alloc(): If zero/NULL is not a suitable default,
116 initialize the new field.
117
118 verify_gdbarch(): Confirm that the target updated the field
119 correctly.
120
121 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
122 field is dumped out
123
124 ``startup_gdbarch()'': Append an initial value to the static
125 variable (base values on the host's c-type system).
126
127 get_gdbarch(): Implement the set/get functions (probably using
128 the macro's as shortcuts).
129
130 */
131
132 int short_bit;
133 int int_bit;
134 int long_bit;
135 int long_long_bit;
136 int float_bit;
137 int double_bit;
138 int long_double_bit;
139 int ptr_bit;
140 int addr_bit;
141 int bfd_vma_bit;
142 int char_signed;
143 gdbarch_read_pc_ftype *read_pc;
144 gdbarch_write_pc_ftype *write_pc;
145 gdbarch_read_fp_ftype *read_fp;
146 gdbarch_read_sp_ftype *read_sp;
147 gdbarch_write_sp_ftype *write_sp;
148 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
149 gdbarch_register_read_ftype *register_read;
150 gdbarch_register_write_ftype *register_write;
151 int num_regs;
152 int num_pseudo_regs;
153 int sp_regnum;
154 int fp_regnum;
155 int pc_regnum;
156 int ps_regnum;
157 int fp0_regnum;
158 int npc_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 int register_size;
166 int register_bytes;
167 gdbarch_register_byte_ftype *register_byte;
168 gdbarch_register_raw_size_ftype *register_raw_size;
169 int max_register_raw_size;
170 gdbarch_register_virtual_size_ftype *register_virtual_size;
171 int max_register_virtual_size;
172 gdbarch_register_virtual_type_ftype *register_virtual_type;
173 gdbarch_do_registers_info_ftype *do_registers_info;
174 gdbarch_print_float_info_ftype *print_float_info;
175 gdbarch_register_sim_regno_ftype *register_sim_regno;
176 gdbarch_register_bytes_ok_ftype *register_bytes_ok;
177 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
178 gdbarch_cannot_store_register_ftype *cannot_store_register;
179 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
180 int use_generic_dummy_frames;
181 int call_dummy_location;
182 gdbarch_call_dummy_address_ftype *call_dummy_address;
183 CORE_ADDR call_dummy_start_offset;
184 CORE_ADDR call_dummy_breakpoint_offset;
185 int call_dummy_breakpoint_offset_p;
186 int call_dummy_length;
187 gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy;
188 int call_dummy_p;
189 LONGEST * call_dummy_words;
190 int sizeof_call_dummy_words;
191 int call_dummy_stack_adjust_p;
192 int call_dummy_stack_adjust;
193 gdbarch_fix_call_dummy_ftype *fix_call_dummy;
194 gdbarch_init_frame_pc_first_ftype *init_frame_pc_first;
195 gdbarch_init_frame_pc_ftype *init_frame_pc;
196 int believe_pcc_promotion;
197 int believe_pcc_promotion_type;
198 gdbarch_coerce_float_to_double_ftype *coerce_float_to_double;
199 gdbarch_get_saved_register_ftype *get_saved_register;
200 gdbarch_register_convertible_ftype *register_convertible;
201 gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
202 gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
203 gdbarch_convert_register_p_ftype *convert_register_p;
204 gdbarch_register_to_value_ftype *register_to_value;
205 gdbarch_value_to_register_ftype *value_to_register;
206 gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register;
207 gdbarch_store_pseudo_register_ftype *store_pseudo_register;
208 gdbarch_pointer_to_address_ftype *pointer_to_address;
209 gdbarch_address_to_pointer_ftype *address_to_pointer;
210 gdbarch_integer_to_address_ftype *integer_to_address;
211 gdbarch_return_value_on_stack_ftype *return_value_on_stack;
212 gdbarch_extract_return_value_ftype *extract_return_value;
213 gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value;
214 gdbarch_push_arguments_ftype *push_arguments;
215 gdbarch_push_dummy_frame_ftype *push_dummy_frame;
216 gdbarch_push_return_address_ftype *push_return_address;
217 gdbarch_pop_frame_ftype *pop_frame;
218 gdbarch_store_struct_return_ftype *store_struct_return;
219 gdbarch_store_return_value_ftype *store_return_value;
220 gdbarch_extract_struct_value_address_ftype *extract_struct_value_address;
221 gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
222 gdbarch_use_struct_convention_ftype *use_struct_convention;
223 gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs;
224 gdbarch_init_extra_frame_info_ftype *init_extra_frame_info;
225 gdbarch_skip_prologue_ftype *skip_prologue;
226 gdbarch_prologue_frameless_p_ftype *prologue_frameless_p;
227 gdbarch_inner_than_ftype *inner_than;
228 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
229 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
230 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
231 CORE_ADDR decr_pc_after_break;
232 gdbarch_prepare_to_proceed_ftype *prepare_to_proceed;
233 CORE_ADDR function_start_offset;
234 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
235 CORE_ADDR frame_args_skip;
236 gdbarch_frameless_function_invocation_ftype *frameless_function_invocation;
237 gdbarch_frame_chain_ftype *frame_chain;
238 gdbarch_frame_chain_valid_ftype *frame_chain_valid;
239 gdbarch_frame_saved_pc_ftype *frame_saved_pc;
240 gdbarch_frame_args_address_ftype *frame_args_address;
241 gdbarch_frame_locals_address_ftype *frame_locals_address;
242 gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
243 gdbarch_frame_num_args_ftype *frame_num_args;
244 gdbarch_stack_align_ftype *stack_align;
245 int extra_stack_alignment_needed;
246 gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
247 gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
248 int parm_boundary;
249 const struct floatformat * float_format;
250 const struct floatformat * double_format;
251 const struct floatformat * long_double_format;
252 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
253 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
254 gdbarch_smash_text_address_ftype *smash_text_address;
255 gdbarch_software_single_step_ftype *software_single_step;
256 gdbarch_print_insn_ftype *print_insn;
257 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
258 gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
259 gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp;
260 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
261 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
262 gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info;
263 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
264 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
265 };
266
267
268 /* The default architecture uses host values (for want of a better
269 choice). */
270
271 extern const struct bfd_arch_info bfd_default_arch_struct;
272
273 struct gdbarch startup_gdbarch =
274 {
275 1, /* Always initialized. */
276 /* basic architecture information */
277 &bfd_default_arch_struct,
278 BFD_ENDIAN_BIG,
279 /* target specific vector and its dump routine */
280 NULL, NULL,
281 /*per-architecture data-pointers and swap regions */
282 0, NULL, NULL,
283 /* Multi-arch values */
284 8 * sizeof (short),
285 8 * sizeof (int),
286 8 * sizeof (long),
287 8 * sizeof (LONGEST),
288 8 * sizeof (float),
289 8 * sizeof (double),
290 8 * sizeof (long double),
291 8 * sizeof (void*),
292 8 * sizeof (void*),
293 8 * sizeof (void*),
294 1,
295 0,
296 0,
297 0,
298 0,
299 0,
300 0,
301 0,
302 0,
303 0,
304 0,
305 -1,
306 -1,
307 -1,
308 -1,
309 0,
310 0,
311 0,
312 0,
313 0,
314 0,
315 0,
316 0,
317 0,
318 0,
319 0,
320 generic_register_size,
321 0,
322 generic_register_size,
323 0,
324 0,
325 0,
326 default_print_float_info,
327 0,
328 0,
329 0,
330 0,
331 0,
332 0,
333 0,
334 0,
335 0,
336 0,
337 0,
338 0,
339 0,
340 0,
341 0,
342 0,
343 0,
344 0,
345 0,
346 0,
347 0,
348 0,
349 0,
350 0,
351 0,
352 0,
353 0,
354 0,
355 0,
356 0,
357 0,
358 0,
359 0,
360 0,
361 0,
362 0,
363 0,
364 0,
365 0,
366 0,
367 0,
368 0,
369 0,
370 0,
371 0,
372 0,
373 0,
374 0,
375 0,
376 0,
377 0,
378 0,
379 0,
380 0,
381 0,
382 0,
383 0,
384 0,
385 0,
386 0,
387 0,
388 0,
389 0,
390 0,
391 0,
392 0,
393 0,
394 0,
395 0,
396 0,
397 0,
398 0,
399 0,
400 0,
401 0,
402 0,
403 0,
404 0,
405 0,
406 0,
407 0,
408 0,
409 0,
410 0,
411 0,
412 generic_in_function_epilogue_p,
413 construct_inferior_arguments,
414 0,
415 0,
416 0,
417 /* startup_gdbarch() */
418 };
419
420 struct gdbarch *current_gdbarch = &startup_gdbarch;
421
422 /* Do any initialization needed for a non-multiarch configuration
423 after the _initialize_MODULE functions have been run. */
424 void
425 initialize_non_multiarch ()
426 {
427 alloc_gdbarch_data (&startup_gdbarch);
428 /* Ensure that all swap areas are zeroed so that they again think
429 they are starting from scratch. */
430 clear_gdbarch_swap (&startup_gdbarch);
431 init_gdbarch_swap (&startup_gdbarch);
432 }
433
434
435 /* Create a new ``struct gdbarch'' based on information provided by
436 ``struct gdbarch_info''. */
437
438 struct gdbarch *
439 gdbarch_alloc (const struct gdbarch_info *info,
440 struct gdbarch_tdep *tdep)
441 {
442 /* NOTE: The new architecture variable is named ``current_gdbarch''
443 so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
444 the current local architecture and not the previous global
445 architecture. This ensures that the new architectures initial
446 values are not influenced by the previous architecture. Once
447 everything is parameterised with gdbarch, this will go away. */
448 struct gdbarch *current_gdbarch = XMALLOC (struct gdbarch);
449 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
450
451 alloc_gdbarch_data (current_gdbarch);
452
453 current_gdbarch->tdep = tdep;
454
455 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
456 current_gdbarch->byte_order = info->byte_order;
457
458 /* Force the explicit initialization of these. */
459 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
460 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
461 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
462 current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
463 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
464 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
465 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
466 current_gdbarch->ptr_bit = TARGET_INT_BIT;
467 current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
468 current_gdbarch->char_signed = -1;
469 current_gdbarch->read_pc = generic_target_read_pc;
470 current_gdbarch->write_pc = generic_target_write_pc;
471 current_gdbarch->read_fp = generic_target_read_fp;
472 current_gdbarch->read_sp = generic_target_read_sp;
473 current_gdbarch->write_sp = generic_target_write_sp;
474 current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
475 current_gdbarch->num_regs = -1;
476 current_gdbarch->sp_regnum = -1;
477 current_gdbarch->fp_regnum = -1;
478 current_gdbarch->pc_regnum = -1;
479 current_gdbarch->ps_regnum = -1;
480 current_gdbarch->fp0_regnum = -1;
481 current_gdbarch->npc_regnum = -1;
482 current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
483 current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
484 current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
485 current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
486 current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
487 current_gdbarch->register_name = legacy_register_name;
488 current_gdbarch->register_size = -1;
489 current_gdbarch->register_bytes = -1;
490 current_gdbarch->register_raw_size = generic_register_size;
491 current_gdbarch->max_register_raw_size = -1;
492 current_gdbarch->register_virtual_size = generic_register_size;
493 current_gdbarch->max_register_virtual_size = -1;
494 current_gdbarch->do_registers_info = do_registers_info;
495 current_gdbarch->print_float_info = default_print_float_info;
496 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
497 current_gdbarch->cannot_fetch_register = cannot_register_not;
498 current_gdbarch->cannot_store_register = cannot_register_not;
499 current_gdbarch->use_generic_dummy_frames = -1;
500 current_gdbarch->call_dummy_start_offset = -1;
501 current_gdbarch->call_dummy_breakpoint_offset = -1;
502 current_gdbarch->call_dummy_breakpoint_offset_p = -1;
503 current_gdbarch->call_dummy_length = -1;
504 current_gdbarch->call_dummy_p = -1;
505 current_gdbarch->call_dummy_words = legacy_call_dummy_words;
506 current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
507 current_gdbarch->call_dummy_stack_adjust_p = -1;
508 current_gdbarch->init_frame_pc_first = init_frame_pc_noop;
509 current_gdbarch->init_frame_pc = init_frame_pc_default;
510 current_gdbarch->coerce_float_to_double = default_coerce_float_to_double;
511 current_gdbarch->get_saved_register = generic_unwind_get_saved_register;
512 current_gdbarch->register_convertible = generic_register_convertible_not;
513 current_gdbarch->convert_register_p = legacy_convert_register_p;
514 current_gdbarch->register_to_value = legacy_register_to_value;
515 current_gdbarch->value_to_register = legacy_value_to_register;
516 current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
517 current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
518 current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
519 current_gdbarch->extract_return_value = legacy_extract_return_value;
520 current_gdbarch->push_arguments = default_push_arguments;
521 current_gdbarch->use_struct_convention = generic_use_struct_convention;
522 current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
523 current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
524 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
525 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
526 current_gdbarch->decr_pc_after_break = -1;
527 current_gdbarch->prepare_to_proceed = default_prepare_to_proceed;
528 current_gdbarch->function_start_offset = -1;
529 current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
530 current_gdbarch->frame_args_skip = -1;
531 current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
532 current_gdbarch->frame_chain_valid = generic_func_frame_chain_valid;
533 current_gdbarch->extra_stack_alignment_needed = 1;
534 current_gdbarch->convert_from_func_ptr_addr = core_addr_identity;
535 current_gdbarch->addr_bits_remove = core_addr_identity;
536 current_gdbarch->smash_text_address = core_addr_identity;
537 current_gdbarch->print_insn = legacy_print_insn;
538 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
539 current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
540 current_gdbarch->pc_in_sigtramp = legacy_pc_in_sigtramp;
541 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
542 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
543 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
544 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
545 /* gdbarch_alloc() */
546
547 return current_gdbarch;
548 }
549
550
551 /* Free a gdbarch struct. This should never happen in normal
552 operation --- once you've created a gdbarch, you keep it around.
553 However, if an architecture's init function encounters an error
554 building the structure, it may need to clean up a partially
555 constructed gdbarch. */
556
557 void
558 gdbarch_free (struct gdbarch *arch)
559 {
560 gdb_assert (arch != NULL);
561 free_gdbarch_data (arch);
562 xfree (arch);
563 }
564
565
566 /* Ensure that all values in a GDBARCH are reasonable. */
567
568 static void
569 verify_gdbarch (struct gdbarch *gdbarch)
570 {
571 struct ui_file *log;
572 struct cleanup *cleanups;
573 long dummy;
574 char *buf;
575 /* Only perform sanity checks on a multi-arch target. */
576 if (!GDB_MULTI_ARCH)
577 return;
578 log = mem_fileopen ();
579 cleanups = make_cleanup_ui_file_delete (log);
580 /* fundamental */
581 if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
582 fprintf_unfiltered (log, "\n\tbyte-order");
583 if (gdbarch->bfd_arch_info == NULL)
584 fprintf_unfiltered (log, "\n\tbfd_arch_info");
585 /* Check those that need to be defined for the given multi-arch level. */
586 /* Skip verify of short_bit, invalid_p == 0 */
587 /* Skip verify of int_bit, invalid_p == 0 */
588 /* Skip verify of long_bit, invalid_p == 0 */
589 /* Skip verify of long_long_bit, invalid_p == 0 */
590 /* Skip verify of float_bit, invalid_p == 0 */
591 /* Skip verify of double_bit, invalid_p == 0 */
592 /* Skip verify of long_double_bit, invalid_p == 0 */
593 /* Skip verify of ptr_bit, invalid_p == 0 */
594 if (gdbarch->addr_bit == 0)
595 gdbarch->addr_bit = TARGET_PTR_BIT;
596 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
597 if (gdbarch->char_signed == -1)
598 gdbarch->char_signed = 1;
599 /* Skip verify of read_pc, invalid_p == 0 */
600 /* Skip verify of write_pc, invalid_p == 0 */
601 /* Skip verify of read_fp, invalid_p == 0 */
602 /* Skip verify of read_sp, invalid_p == 0 */
603 /* Skip verify of write_sp, invalid_p == 0 */
604 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
605 /* Skip verify of register_read, has predicate */
606 /* Skip verify of register_write, has predicate */
607 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
608 && (gdbarch->num_regs == -1))
609 fprintf_unfiltered (log, "\n\tnum_regs");
610 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
611 /* Skip verify of sp_regnum, invalid_p == 0 */
612 /* Skip verify of fp_regnum, invalid_p == 0 */
613 /* Skip verify of pc_regnum, invalid_p == 0 */
614 /* Skip verify of ps_regnum, invalid_p == 0 */
615 /* Skip verify of fp0_regnum, invalid_p == 0 */
616 /* Skip verify of npc_regnum, invalid_p == 0 */
617 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
618 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
619 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
620 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
621 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
622 /* Skip verify of register_name, invalid_p == 0 */
623 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
624 && (gdbarch->register_size == -1))
625 fprintf_unfiltered (log, "\n\tregister_size");
626 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
627 && (gdbarch->register_bytes == -1))
628 fprintf_unfiltered (log, "\n\tregister_bytes");
629 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
630 && (gdbarch->register_byte == 0))
631 fprintf_unfiltered (log, "\n\tregister_byte");
632 /* Skip verify of register_raw_size, invalid_p == 0 */
633 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
634 && (gdbarch->max_register_raw_size == -1))
635 fprintf_unfiltered (log, "\n\tmax_register_raw_size");
636 /* Skip verify of register_virtual_size, invalid_p == 0 */
637 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
638 && (gdbarch->max_register_virtual_size == -1))
639 fprintf_unfiltered (log, "\n\tmax_register_virtual_size");
640 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
641 && (gdbarch->register_virtual_type == 0))
642 fprintf_unfiltered (log, "\n\tregister_virtual_type");
643 /* Skip verify of do_registers_info, invalid_p == 0 */
644 /* Skip verify of print_float_info, invalid_p == 0 */
645 /* Skip verify of register_sim_regno, invalid_p == 0 */
646 /* Skip verify of register_bytes_ok, has predicate */
647 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
648 /* Skip verify of cannot_store_register, invalid_p == 0 */
649 /* Skip verify of get_longjmp_target, has predicate */
650 if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
651 && (gdbarch->use_generic_dummy_frames == -1))
652 fprintf_unfiltered (log, "\n\tuse_generic_dummy_frames");
653 if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
654 && (gdbarch->call_dummy_location == 0))
655 fprintf_unfiltered (log, "\n\tcall_dummy_location");
656 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
657 && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
658 fprintf_unfiltered (log, "\n\tcall_dummy_address");
659 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
660 && (gdbarch->call_dummy_start_offset == -1))
661 fprintf_unfiltered (log, "\n\tcall_dummy_start_offset");
662 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
663 && (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1))
664 fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset");
665 if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
666 && (gdbarch->call_dummy_breakpoint_offset_p == -1))
667 fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset_p");
668 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
669 && (gdbarch->call_dummy_length == -1))
670 fprintf_unfiltered (log, "\n\tcall_dummy_length");
671 if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
672 && (gdbarch->pc_in_call_dummy == 0))
673 fprintf_unfiltered (log, "\n\tpc_in_call_dummy");
674 if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
675 && (gdbarch->call_dummy_p == -1))
676 fprintf_unfiltered (log, "\n\tcall_dummy_p");
677 /* Skip verify of call_dummy_words, invalid_p == 0 */
678 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
679 if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
680 && (gdbarch->call_dummy_stack_adjust_p == -1))
681 fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust_p");
682 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
683 && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0))
684 fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust");
685 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
686 && (gdbarch->fix_call_dummy == 0))
687 fprintf_unfiltered (log, "\n\tfix_call_dummy");
688 /* Skip verify of init_frame_pc_first, invalid_p == 0 */
689 /* Skip verify of init_frame_pc, invalid_p == 0 */
690 /* Skip verify of coerce_float_to_double, invalid_p == 0 */
691 /* Skip verify of get_saved_register, invalid_p == 0 */
692 /* Skip verify of register_convertible, invalid_p == 0 */
693 /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
694 /* Skip verify of register_convert_to_raw, invalid_p == 0 */
695 /* Skip verify of convert_register_p, invalid_p == 0 */
696 /* Skip verify of register_to_value, invalid_p == 0 */
697 /* Skip verify of value_to_register, invalid_p == 0 */
698 /* Skip verify of fetch_pseudo_register, has predicate */
699 /* Skip verify of store_pseudo_register, has predicate */
700 /* Skip verify of pointer_to_address, invalid_p == 0 */
701 /* Skip verify of address_to_pointer, invalid_p == 0 */
702 /* Skip verify of integer_to_address, has predicate */
703 /* Skip verify of return_value_on_stack, invalid_p == 0 */
704 /* Skip verify of extract_return_value, invalid_p == 0 */
705 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
706 && (gdbarch->deprecated_extract_return_value == 0))
707 fprintf_unfiltered (log, "\n\tdeprecated_extract_return_value");
708 /* Skip verify of push_arguments, invalid_p == 0 */
709 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
710 && (gdbarch->push_dummy_frame == 0))
711 fprintf_unfiltered (log, "\n\tpush_dummy_frame");
712 /* Skip verify of push_return_address, has predicate */
713 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
714 && (gdbarch->pop_frame == 0))
715 fprintf_unfiltered (log, "\n\tpop_frame");
716 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
717 && (gdbarch->store_struct_return == 0))
718 fprintf_unfiltered (log, "\n\tstore_struct_return");
719 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
720 && (gdbarch->store_return_value == 0))
721 fprintf_unfiltered (log, "\n\tstore_return_value");
722 /* Skip verify of extract_struct_value_address, has predicate */
723 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
724 /* Skip verify of use_struct_convention, invalid_p == 0 */
725 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
726 && (gdbarch->frame_init_saved_regs == 0))
727 fprintf_unfiltered (log, "\n\tframe_init_saved_regs");
728 /* Skip verify of init_extra_frame_info, has predicate */
729 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
730 && (gdbarch->skip_prologue == 0))
731 fprintf_unfiltered (log, "\n\tskip_prologue");
732 /* Skip verify of prologue_frameless_p, invalid_p == 0 */
733 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
734 && (gdbarch->inner_than == 0))
735 fprintf_unfiltered (log, "\n\tinner_than");
736 /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
737 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
738 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
739 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
740 && (gdbarch->decr_pc_after_break == -1))
741 fprintf_unfiltered (log, "\n\tdecr_pc_after_break");
742 /* Skip verify of prepare_to_proceed, invalid_p == 0 */
743 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
744 && (gdbarch->function_start_offset == -1))
745 fprintf_unfiltered (log, "\n\tfunction_start_offset");
746 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
747 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
748 && (gdbarch->frame_args_skip == -1))
749 fprintf_unfiltered (log, "\n\tframe_args_skip");
750 /* Skip verify of frameless_function_invocation, invalid_p == 0 */
751 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
752 && (gdbarch->frame_chain == 0))
753 fprintf_unfiltered (log, "\n\tframe_chain");
754 /* Skip verify of frame_chain_valid, invalid_p == 0 */
755 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
756 && (gdbarch->frame_saved_pc == 0))
757 fprintf_unfiltered (log, "\n\tframe_saved_pc");
758 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
759 && (gdbarch->frame_args_address == 0))
760 fprintf_unfiltered (log, "\n\tframe_args_address");
761 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
762 && (gdbarch->frame_locals_address == 0))
763 fprintf_unfiltered (log, "\n\tframe_locals_address");
764 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
765 && (gdbarch->saved_pc_after_call == 0))
766 fprintf_unfiltered (log, "\n\tsaved_pc_after_call");
767 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
768 && (gdbarch->frame_num_args == 0))
769 fprintf_unfiltered (log, "\n\tframe_num_args");
770 /* Skip verify of stack_align, has predicate */
771 /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
772 /* Skip verify of reg_struct_has_addr, has predicate */
773 /* Skip verify of save_dummy_frame_tos, has predicate */
774 if (gdbarch->float_format == 0)
775 gdbarch->float_format = default_float_format (gdbarch);
776 if (gdbarch->double_format == 0)
777 gdbarch->double_format = default_double_format (gdbarch);
778 if (gdbarch->long_double_format == 0)
779 gdbarch->long_double_format = default_double_format (gdbarch);
780 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
781 /* Skip verify of addr_bits_remove, invalid_p == 0 */
782 /* Skip verify of smash_text_address, invalid_p == 0 */
783 /* Skip verify of software_single_step, has predicate */
784 /* Skip verify of print_insn, invalid_p == 0 */
785 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
786 /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
787 /* Skip verify of pc_in_sigtramp, invalid_p == 0 */
788 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
789 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
790 /* Skip verify of dwarf2_build_frame_info, has predicate */
791 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
792 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
793 buf = ui_file_xstrdup (log, &dummy);
794 make_cleanup (xfree, buf);
795 if (strlen (buf) > 0)
796 internal_error (__FILE__, __LINE__,
797 "verify_gdbarch: the following are invalid ...%s",
798 buf);
799 do_cleanups (cleanups);
800 }
801
802
803 /* Print out the details of the current architecture. */
804
805 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
806 just happens to match the global variable ``current_gdbarch''. That
807 way macros refering to that variable get the local and not the global
808 version - ulgh. Once everything is parameterised with gdbarch, this
809 will go away. */
810
811 void
812 gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
813 {
814 fprintf_unfiltered (file,
815 "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
816 GDB_MULTI_ARCH);
817 if (GDB_MULTI_ARCH)
818 fprintf_unfiltered (file,
819 "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
820 (long) current_gdbarch->in_function_epilogue_p);
821 if (GDB_MULTI_ARCH)
822 fprintf_unfiltered (file,
823 "gdbarch_dump: register_read = 0x%08lx\n",
824 (long) current_gdbarch->register_read);
825 if (GDB_MULTI_ARCH)
826 fprintf_unfiltered (file,
827 "gdbarch_dump: register_write = 0x%08lx\n",
828 (long) current_gdbarch->register_write);
829 #ifdef ADDRESS_TO_POINTER
830 #if GDB_MULTI_ARCH
831 /* Macro might contain `[{}]' when not multi-arch */
832 fprintf_unfiltered (file,
833 "gdbarch_dump: %s # %s\n",
834 "ADDRESS_TO_POINTER(type, buf, addr)",
835 XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
836 #endif
837 if (GDB_MULTI_ARCH)
838 fprintf_unfiltered (file,
839 "gdbarch_dump: ADDRESS_TO_POINTER = 0x%08lx\n",
840 (long) current_gdbarch->address_to_pointer
841 /*ADDRESS_TO_POINTER ()*/);
842 #endif
843 #ifdef ADDR_BITS_REMOVE
844 fprintf_unfiltered (file,
845 "gdbarch_dump: %s # %s\n",
846 "ADDR_BITS_REMOVE(addr)",
847 XSTRING (ADDR_BITS_REMOVE (addr)));
848 if (GDB_MULTI_ARCH)
849 fprintf_unfiltered (file,
850 "gdbarch_dump: ADDR_BITS_REMOVE = 0x%08lx\n",
851 (long) current_gdbarch->addr_bits_remove
852 /*ADDR_BITS_REMOVE ()*/);
853 #endif
854 #ifdef BELIEVE_PCC_PROMOTION
855 fprintf_unfiltered (file,
856 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
857 XSTRING (BELIEVE_PCC_PROMOTION));
858 fprintf_unfiltered (file,
859 "gdbarch_dump: BELIEVE_PCC_PROMOTION = %d\n",
860 BELIEVE_PCC_PROMOTION);
861 #endif
862 #ifdef BELIEVE_PCC_PROMOTION_TYPE
863 fprintf_unfiltered (file,
864 "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n",
865 XSTRING (BELIEVE_PCC_PROMOTION_TYPE));
866 fprintf_unfiltered (file,
867 "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %d\n",
868 BELIEVE_PCC_PROMOTION_TYPE);
869 #endif
870 #ifdef BREAKPOINT_FROM_PC
871 fprintf_unfiltered (file,
872 "gdbarch_dump: %s # %s\n",
873 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
874 XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
875 if (GDB_MULTI_ARCH)
876 fprintf_unfiltered (file,
877 "gdbarch_dump: BREAKPOINT_FROM_PC = 0x%08lx\n",
878 (long) current_gdbarch->breakpoint_from_pc
879 /*BREAKPOINT_FROM_PC ()*/);
880 #endif
881 #ifdef CALL_DUMMY_ADDRESS
882 fprintf_unfiltered (file,
883 "gdbarch_dump: %s # %s\n",
884 "CALL_DUMMY_ADDRESS()",
885 XSTRING (CALL_DUMMY_ADDRESS ()));
886 if (GDB_MULTI_ARCH)
887 fprintf_unfiltered (file,
888 "gdbarch_dump: CALL_DUMMY_ADDRESS = 0x%08lx\n",
889 (long) current_gdbarch->call_dummy_address
890 /*CALL_DUMMY_ADDRESS ()*/);
891 #endif
892 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET
893 fprintf_unfiltered (file,
894 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
895 XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET));
896 if (CALL_DUMMY_BREAKPOINT_OFFSET_P)
897 fprintf_unfiltered (file,
898 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
899 (long) CALL_DUMMY_BREAKPOINT_OFFSET);
900 #endif
901 #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
902 fprintf_unfiltered (file,
903 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P # %s\n",
904 XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET_P));
905 fprintf_unfiltered (file,
906 "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P = %d\n",
907 CALL_DUMMY_BREAKPOINT_OFFSET_P);
908 #endif
909 #ifdef CALL_DUMMY_LENGTH
910 fprintf_unfiltered (file,
911 "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n",
912 XSTRING (CALL_DUMMY_LENGTH));
913 if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END)
914 fprintf_unfiltered (file,
915 "gdbarch_dump: CALL_DUMMY_LENGTH = %d\n",
916 CALL_DUMMY_LENGTH);
917 #endif
918 #ifdef CALL_DUMMY_LOCATION
919 fprintf_unfiltered (file,
920 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
921 XSTRING (CALL_DUMMY_LOCATION));
922 fprintf_unfiltered (file,
923 "gdbarch_dump: CALL_DUMMY_LOCATION = %d\n",
924 CALL_DUMMY_LOCATION);
925 #endif
926 #ifdef CALL_DUMMY_P
927 fprintf_unfiltered (file,
928 "gdbarch_dump: CALL_DUMMY_P # %s\n",
929 XSTRING (CALL_DUMMY_P));
930 fprintf_unfiltered (file,
931 "gdbarch_dump: CALL_DUMMY_P = %d\n",
932 CALL_DUMMY_P);
933 #endif
934 #ifdef CALL_DUMMY_STACK_ADJUST
935 fprintf_unfiltered (file,
936 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n",
937 XSTRING (CALL_DUMMY_STACK_ADJUST));
938 if (CALL_DUMMY_STACK_ADJUST_P)
939 fprintf_unfiltered (file,
940 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
941 (long) CALL_DUMMY_STACK_ADJUST);
942 #endif
943 #ifdef CALL_DUMMY_STACK_ADJUST_P
944 fprintf_unfiltered (file,
945 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P # %s\n",
946 XSTRING (CALL_DUMMY_STACK_ADJUST_P));
947 fprintf_unfiltered (file,
948 "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
949 (long) CALL_DUMMY_STACK_ADJUST_P);
950 #endif
951 #ifdef CALL_DUMMY_START_OFFSET
952 fprintf_unfiltered (file,
953 "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n",
954 XSTRING (CALL_DUMMY_START_OFFSET));
955 fprintf_unfiltered (file,
956 "gdbarch_dump: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
957 (long) CALL_DUMMY_START_OFFSET);
958 #endif
959 #ifdef CALL_DUMMY_WORDS
960 fprintf_unfiltered (file,
961 "gdbarch_dump: CALL_DUMMY_WORDS # %s\n",
962 XSTRING (CALL_DUMMY_WORDS));
963 fprintf_unfiltered (file,
964 "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n",
965 (long) CALL_DUMMY_WORDS);
966 #endif
967 #ifdef CANNOT_FETCH_REGISTER
968 fprintf_unfiltered (file,
969 "gdbarch_dump: %s # %s\n",
970 "CANNOT_FETCH_REGISTER(regnum)",
971 XSTRING (CANNOT_FETCH_REGISTER (regnum)));
972 if (GDB_MULTI_ARCH)
973 fprintf_unfiltered (file,
974 "gdbarch_dump: CANNOT_FETCH_REGISTER = 0x%08lx\n",
975 (long) current_gdbarch->cannot_fetch_register
976 /*CANNOT_FETCH_REGISTER ()*/);
977 #endif
978 #ifdef CANNOT_STORE_REGISTER
979 fprintf_unfiltered (file,
980 "gdbarch_dump: %s # %s\n",
981 "CANNOT_STORE_REGISTER(regnum)",
982 XSTRING (CANNOT_STORE_REGISTER (regnum)));
983 if (GDB_MULTI_ARCH)
984 fprintf_unfiltered (file,
985 "gdbarch_dump: CANNOT_STORE_REGISTER = 0x%08lx\n",
986 (long) current_gdbarch->cannot_store_register
987 /*CANNOT_STORE_REGISTER ()*/);
988 #endif
989 #ifdef COERCE_FLOAT_TO_DOUBLE
990 fprintf_unfiltered (file,
991 "gdbarch_dump: %s # %s\n",
992 "COERCE_FLOAT_TO_DOUBLE(formal, actual)",
993 XSTRING (COERCE_FLOAT_TO_DOUBLE (formal, actual)));
994 if (GDB_MULTI_ARCH)
995 fprintf_unfiltered (file,
996 "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
997 (long) current_gdbarch->coerce_float_to_double
998 /*COERCE_FLOAT_TO_DOUBLE ()*/);
999 #endif
1000 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
1001 #if GDB_MULTI_ARCH
1002 /* Macro might contain `[{}]' when not multi-arch */
1003 fprintf_unfiltered (file,
1004 "gdbarch_dump: %s # %s\n",
1005 "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
1006 XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
1007 #endif
1008 if (GDB_MULTI_ARCH)
1009 fprintf_unfiltered (file,
1010 "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n",
1011 (long) current_gdbarch->coff_make_msymbol_special
1012 /*COFF_MAKE_MSYMBOL_SPECIAL ()*/);
1013 #endif
1014 if (GDB_MULTI_ARCH)
1015 fprintf_unfiltered (file,
1016 "gdbarch_dump: construct_inferior_arguments = 0x%08lx\n",
1017 (long) current_gdbarch->construct_inferior_arguments);
1018 #ifdef CONVERT_FROM_FUNC_PTR_ADDR
1019 fprintf_unfiltered (file,
1020 "gdbarch_dump: %s # %s\n",
1021 "CONVERT_FROM_FUNC_PTR_ADDR(addr)",
1022 XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr)));
1023 if (GDB_MULTI_ARCH)
1024 fprintf_unfiltered (file,
1025 "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = 0x%08lx\n",
1026 (long) current_gdbarch->convert_from_func_ptr_addr
1027 /*CONVERT_FROM_FUNC_PTR_ADDR ()*/);
1028 #endif
1029 #ifdef CONVERT_REGISTER_P
1030 fprintf_unfiltered (file,
1031 "gdbarch_dump: %s # %s\n",
1032 "CONVERT_REGISTER_P(regnum)",
1033 XSTRING (CONVERT_REGISTER_P (regnum)));
1034 if (GDB_MULTI_ARCH)
1035 fprintf_unfiltered (file,
1036 "gdbarch_dump: CONVERT_REGISTER_P = 0x%08lx\n",
1037 (long) current_gdbarch->convert_register_p
1038 /*CONVERT_REGISTER_P ()*/);
1039 #endif
1040 #ifdef DECR_PC_AFTER_BREAK
1041 fprintf_unfiltered (file,
1042 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
1043 XSTRING (DECR_PC_AFTER_BREAK));
1044 fprintf_unfiltered (file,
1045 "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
1046 (long) DECR_PC_AFTER_BREAK);
1047 #endif
1048 #ifdef DEPRECATED_EXTRACT_RETURN_VALUE
1049 #if GDB_MULTI_ARCH
1050 /* Macro might contain `[{}]' when not multi-arch */
1051 fprintf_unfiltered (file,
1052 "gdbarch_dump: %s # %s\n",
1053 "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
1054 XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
1055 #endif
1056 if (GDB_MULTI_ARCH)
1057 fprintf_unfiltered (file,
1058 "gdbarch_dump: DEPRECATED_EXTRACT_RETURN_VALUE = 0x%08lx\n",
1059 (long) current_gdbarch->deprecated_extract_return_value
1060 /*DEPRECATED_EXTRACT_RETURN_VALUE ()*/);
1061 #endif
1062 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
1063 fprintf_unfiltered (file,
1064 "gdbarch_dump: %s # %s\n",
1065 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
1066 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
1067 if (GDB_MULTI_ARCH)
1068 fprintf_unfiltered (file,
1069 "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
1070 (long) current_gdbarch->deprecated_extract_struct_value_address
1071 /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
1072 #endif
1073 #ifdef DO_REGISTERS_INFO
1074 #if GDB_MULTI_ARCH
1075 /* Macro might contain `[{}]' when not multi-arch */
1076 fprintf_unfiltered (file,
1077 "gdbarch_dump: %s # %s\n",
1078 "DO_REGISTERS_INFO(reg_nr, fpregs)",
1079 XSTRING (DO_REGISTERS_INFO (reg_nr, fpregs)));
1080 #endif
1081 if (GDB_MULTI_ARCH)
1082 fprintf_unfiltered (file,
1083 "gdbarch_dump: DO_REGISTERS_INFO = 0x%08lx\n",
1084 (long) current_gdbarch->do_registers_info
1085 /*DO_REGISTERS_INFO ()*/);
1086 #endif
1087 #ifdef DWARF2_BUILD_FRAME_INFO
1088 #if GDB_MULTI_ARCH
1089 /* Macro might contain `[{}]' when not multi-arch */
1090 fprintf_unfiltered (file,
1091 "gdbarch_dump: %s # %s\n",
1092 "DWARF2_BUILD_FRAME_INFO(objfile)",
1093 XSTRING (DWARF2_BUILD_FRAME_INFO (objfile)));
1094 #endif
1095 if (GDB_MULTI_ARCH)
1096 fprintf_unfiltered (file,
1097 "gdbarch_dump: DWARF2_BUILD_FRAME_INFO = 0x%08lx\n",
1098 (long) current_gdbarch->dwarf2_build_frame_info
1099 /*DWARF2_BUILD_FRAME_INFO ()*/);
1100 #endif
1101 #ifdef DWARF2_REG_TO_REGNUM
1102 fprintf_unfiltered (file,
1103 "gdbarch_dump: %s # %s\n",
1104 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
1105 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
1106 if (GDB_MULTI_ARCH)
1107 fprintf_unfiltered (file,
1108 "gdbarch_dump: DWARF2_REG_TO_REGNUM = 0x%08lx\n",
1109 (long) current_gdbarch->dwarf2_reg_to_regnum
1110 /*DWARF2_REG_TO_REGNUM ()*/);
1111 #endif
1112 #ifdef DWARF_REG_TO_REGNUM
1113 fprintf_unfiltered (file,
1114 "gdbarch_dump: %s # %s\n",
1115 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1116 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
1117 if (GDB_MULTI_ARCH)
1118 fprintf_unfiltered (file,
1119 "gdbarch_dump: DWARF_REG_TO_REGNUM = 0x%08lx\n",
1120 (long) current_gdbarch->dwarf_reg_to_regnum
1121 /*DWARF_REG_TO_REGNUM ()*/);
1122 #endif
1123 #ifdef ECOFF_REG_TO_REGNUM
1124 fprintf_unfiltered (file,
1125 "gdbarch_dump: %s # %s\n",
1126 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1127 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
1128 if (GDB_MULTI_ARCH)
1129 fprintf_unfiltered (file,
1130 "gdbarch_dump: ECOFF_REG_TO_REGNUM = 0x%08lx\n",
1131 (long) current_gdbarch->ecoff_reg_to_regnum
1132 /*ECOFF_REG_TO_REGNUM ()*/);
1133 #endif
1134 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
1135 #if GDB_MULTI_ARCH
1136 /* Macro might contain `[{}]' when not multi-arch */
1137 fprintf_unfiltered (file,
1138 "gdbarch_dump: %s # %s\n",
1139 "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1140 XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
1141 #endif
1142 if (GDB_MULTI_ARCH)
1143 fprintf_unfiltered (file,
1144 "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n",
1145 (long) current_gdbarch->elf_make_msymbol_special
1146 /*ELF_MAKE_MSYMBOL_SPECIAL ()*/);
1147 #endif
1148 #ifdef EXTRACT_RETURN_VALUE
1149 #if GDB_MULTI_ARCH
1150 /* Macro might contain `[{}]' when not multi-arch */
1151 fprintf_unfiltered (file,
1152 "gdbarch_dump: %s # %s\n",
1153 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1154 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
1155 #endif
1156 if (GDB_MULTI_ARCH)
1157 fprintf_unfiltered (file,
1158 "gdbarch_dump: EXTRACT_RETURN_VALUE = 0x%08lx\n",
1159 (long) current_gdbarch->extract_return_value
1160 /*EXTRACT_RETURN_VALUE ()*/);
1161 #endif
1162 #ifdef EXTRACT_STRUCT_VALUE_ADDRESS
1163 fprintf_unfiltered (file,
1164 "gdbarch_dump: %s # %s\n",
1165 "EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
1166 XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
1167 if (GDB_MULTI_ARCH)
1168 fprintf_unfiltered (file,
1169 "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
1170 (long) current_gdbarch->extract_struct_value_address
1171 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
1172 #endif
1173 #ifdef EXTRA_STACK_ALIGNMENT_NEEDED
1174 fprintf_unfiltered (file,
1175 "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n",
1176 XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED));
1177 fprintf_unfiltered (file,
1178 "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %d\n",
1179 EXTRA_STACK_ALIGNMENT_NEEDED);
1180 #endif
1181 #ifdef FETCH_PSEUDO_REGISTER
1182 #if GDB_MULTI_ARCH
1183 /* Macro might contain `[{}]' when not multi-arch */
1184 fprintf_unfiltered (file,
1185 "gdbarch_dump: %s # %s\n",
1186 "FETCH_PSEUDO_REGISTER(regnum)",
1187 XSTRING (FETCH_PSEUDO_REGISTER (regnum)));
1188 #endif
1189 if (GDB_MULTI_ARCH)
1190 fprintf_unfiltered (file,
1191 "gdbarch_dump: FETCH_PSEUDO_REGISTER = 0x%08lx\n",
1192 (long) current_gdbarch->fetch_pseudo_register
1193 /*FETCH_PSEUDO_REGISTER ()*/);
1194 #endif
1195 #ifdef FIX_CALL_DUMMY
1196 #if GDB_MULTI_ARCH
1197 /* Macro might contain `[{}]' when not multi-arch */
1198 fprintf_unfiltered (file,
1199 "gdbarch_dump: %s # %s\n",
1200 "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
1201 XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
1202 #endif
1203 if (GDB_MULTI_ARCH)
1204 fprintf_unfiltered (file,
1205 "gdbarch_dump: FIX_CALL_DUMMY = 0x%08lx\n",
1206 (long) current_gdbarch->fix_call_dummy
1207 /*FIX_CALL_DUMMY ()*/);
1208 #endif
1209 #ifdef FP0_REGNUM
1210 fprintf_unfiltered (file,
1211 "gdbarch_dump: FP0_REGNUM # %s\n",
1212 XSTRING (FP0_REGNUM));
1213 fprintf_unfiltered (file,
1214 "gdbarch_dump: FP0_REGNUM = %d\n",
1215 FP0_REGNUM);
1216 #endif
1217 #ifdef FP_REGNUM
1218 fprintf_unfiltered (file,
1219 "gdbarch_dump: FP_REGNUM # %s\n",
1220 XSTRING (FP_REGNUM));
1221 fprintf_unfiltered (file,
1222 "gdbarch_dump: FP_REGNUM = %d\n",
1223 FP_REGNUM);
1224 #endif
1225 #ifdef FRAMELESS_FUNCTION_INVOCATION
1226 fprintf_unfiltered (file,
1227 "gdbarch_dump: %s # %s\n",
1228 "FRAMELESS_FUNCTION_INVOCATION(fi)",
1229 XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi)));
1230 if (GDB_MULTI_ARCH)
1231 fprintf_unfiltered (file,
1232 "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
1233 (long) current_gdbarch->frameless_function_invocation
1234 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
1235 #endif
1236 #ifdef FRAME_ARGS_ADDRESS
1237 fprintf_unfiltered (file,
1238 "gdbarch_dump: %s # %s\n",
1239 "FRAME_ARGS_ADDRESS(fi)",
1240 XSTRING (FRAME_ARGS_ADDRESS (fi)));
1241 if (GDB_MULTI_ARCH)
1242 fprintf_unfiltered (file,
1243 "gdbarch_dump: FRAME_ARGS_ADDRESS = 0x%08lx\n",
1244 (long) current_gdbarch->frame_args_address
1245 /*FRAME_ARGS_ADDRESS ()*/);
1246 #endif
1247 #ifdef FRAME_ARGS_SKIP
1248 fprintf_unfiltered (file,
1249 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1250 XSTRING (FRAME_ARGS_SKIP));
1251 fprintf_unfiltered (file,
1252 "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n",
1253 (long) FRAME_ARGS_SKIP);
1254 #endif
1255 #ifdef FRAME_CHAIN
1256 fprintf_unfiltered (file,
1257 "gdbarch_dump: %s # %s\n",
1258 "FRAME_CHAIN(frame)",
1259 XSTRING (FRAME_CHAIN (frame)));
1260 if (GDB_MULTI_ARCH)
1261 fprintf_unfiltered (file,
1262 "gdbarch_dump: FRAME_CHAIN = 0x%08lx\n",
1263 (long) current_gdbarch->frame_chain
1264 /*FRAME_CHAIN ()*/);
1265 #endif
1266 #ifdef FRAME_CHAIN_VALID
1267 fprintf_unfiltered (file,
1268 "gdbarch_dump: %s # %s\n",
1269 "FRAME_CHAIN_VALID(chain, thisframe)",
1270 XSTRING (FRAME_CHAIN_VALID (chain, thisframe)));
1271 if (GDB_MULTI_ARCH)
1272 fprintf_unfiltered (file,
1273 "gdbarch_dump: FRAME_CHAIN_VALID = 0x%08lx\n",
1274 (long) current_gdbarch->frame_chain_valid
1275 /*FRAME_CHAIN_VALID ()*/);
1276 #endif
1277 #ifdef FRAME_INIT_SAVED_REGS
1278 #if GDB_MULTI_ARCH
1279 /* Macro might contain `[{}]' when not multi-arch */
1280 fprintf_unfiltered (file,
1281 "gdbarch_dump: %s # %s\n",
1282 "FRAME_INIT_SAVED_REGS(frame)",
1283 XSTRING (FRAME_INIT_SAVED_REGS (frame)));
1284 #endif
1285 if (GDB_MULTI_ARCH)
1286 fprintf_unfiltered (file,
1287 "gdbarch_dump: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
1288 (long) current_gdbarch->frame_init_saved_regs
1289 /*FRAME_INIT_SAVED_REGS ()*/);
1290 #endif
1291 #ifdef FRAME_LOCALS_ADDRESS
1292 fprintf_unfiltered (file,
1293 "gdbarch_dump: %s # %s\n",
1294 "FRAME_LOCALS_ADDRESS(fi)",
1295 XSTRING (FRAME_LOCALS_ADDRESS (fi)));
1296 if (GDB_MULTI_ARCH)
1297 fprintf_unfiltered (file,
1298 "gdbarch_dump: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
1299 (long) current_gdbarch->frame_locals_address
1300 /*FRAME_LOCALS_ADDRESS ()*/);
1301 #endif
1302 #ifdef FRAME_NUM_ARGS
1303 fprintf_unfiltered (file,
1304 "gdbarch_dump: %s # %s\n",
1305 "FRAME_NUM_ARGS(frame)",
1306 XSTRING (FRAME_NUM_ARGS (frame)));
1307 if (GDB_MULTI_ARCH)
1308 fprintf_unfiltered (file,
1309 "gdbarch_dump: FRAME_NUM_ARGS = 0x%08lx\n",
1310 (long) current_gdbarch->frame_num_args
1311 /*FRAME_NUM_ARGS ()*/);
1312 #endif
1313 #ifdef FRAME_SAVED_PC
1314 fprintf_unfiltered (file,
1315 "gdbarch_dump: %s # %s\n",
1316 "FRAME_SAVED_PC(fi)",
1317 XSTRING (FRAME_SAVED_PC (fi)));
1318 if (GDB_MULTI_ARCH)
1319 fprintf_unfiltered (file,
1320 "gdbarch_dump: FRAME_SAVED_PC = 0x%08lx\n",
1321 (long) current_gdbarch->frame_saved_pc
1322 /*FRAME_SAVED_PC ()*/);
1323 #endif
1324 #ifdef FUNCTION_START_OFFSET
1325 fprintf_unfiltered (file,
1326 "gdbarch_dump: FUNCTION_START_OFFSET # %s\n",
1327 XSTRING (FUNCTION_START_OFFSET));
1328 fprintf_unfiltered (file,
1329 "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n",
1330 (long) FUNCTION_START_OFFSET);
1331 #endif
1332 #ifdef GET_LONGJMP_TARGET
1333 fprintf_unfiltered (file,
1334 "gdbarch_dump: %s # %s\n",
1335 "GET_LONGJMP_TARGET(pc)",
1336 XSTRING (GET_LONGJMP_TARGET (pc)));
1337 if (GDB_MULTI_ARCH)
1338 fprintf_unfiltered (file,
1339 "gdbarch_dump: GET_LONGJMP_TARGET = 0x%08lx\n",
1340 (long) current_gdbarch->get_longjmp_target
1341 /*GET_LONGJMP_TARGET ()*/);
1342 #endif
1343 #ifdef GET_SAVED_REGISTER
1344 #if GDB_MULTI_ARCH
1345 /* Macro might contain `[{}]' when not multi-arch */
1346 fprintf_unfiltered (file,
1347 "gdbarch_dump: %s # %s\n",
1348 "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
1349 XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
1350 #endif
1351 if (GDB_MULTI_ARCH)
1352 fprintf_unfiltered (file,
1353 "gdbarch_dump: GET_SAVED_REGISTER = 0x%08lx\n",
1354 (long) current_gdbarch->get_saved_register
1355 /*GET_SAVED_REGISTER ()*/);
1356 #endif
1357 #ifdef INIT_EXTRA_FRAME_INFO
1358 #if GDB_MULTI_ARCH
1359 /* Macro might contain `[{}]' when not multi-arch */
1360 fprintf_unfiltered (file,
1361 "gdbarch_dump: %s # %s\n",
1362 "INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
1363 XSTRING (INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
1364 #endif
1365 if (GDB_MULTI_ARCH)
1366 fprintf_unfiltered (file,
1367 "gdbarch_dump: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
1368 (long) current_gdbarch->init_extra_frame_info
1369 /*INIT_EXTRA_FRAME_INFO ()*/);
1370 #endif
1371 #ifdef INIT_FRAME_PC
1372 #if GDB_MULTI_ARCH
1373 /* Macro might contain `[{}]' when not multi-arch */
1374 fprintf_unfiltered (file,
1375 "gdbarch_dump: %s # %s\n",
1376 "INIT_FRAME_PC(fromleaf, prev)",
1377 XSTRING (INIT_FRAME_PC (fromleaf, prev)));
1378 #endif
1379 if (GDB_MULTI_ARCH)
1380 fprintf_unfiltered (file,
1381 "gdbarch_dump: INIT_FRAME_PC = 0x%08lx\n",
1382 (long) current_gdbarch->init_frame_pc
1383 /*INIT_FRAME_PC ()*/);
1384 #endif
1385 #ifdef INIT_FRAME_PC_FIRST
1386 #if GDB_MULTI_ARCH
1387 /* Macro might contain `[{}]' when not multi-arch */
1388 fprintf_unfiltered (file,
1389 "gdbarch_dump: %s # %s\n",
1390 "INIT_FRAME_PC_FIRST(fromleaf, prev)",
1391 XSTRING (INIT_FRAME_PC_FIRST (fromleaf, prev)));
1392 #endif
1393 if (GDB_MULTI_ARCH)
1394 fprintf_unfiltered (file,
1395 "gdbarch_dump: INIT_FRAME_PC_FIRST = 0x%08lx\n",
1396 (long) current_gdbarch->init_frame_pc_first
1397 /*INIT_FRAME_PC_FIRST ()*/);
1398 #endif
1399 #ifdef INNER_THAN
1400 fprintf_unfiltered (file,
1401 "gdbarch_dump: %s # %s\n",
1402 "INNER_THAN(lhs, rhs)",
1403 XSTRING (INNER_THAN (lhs, rhs)));
1404 if (GDB_MULTI_ARCH)
1405 fprintf_unfiltered (file,
1406 "gdbarch_dump: INNER_THAN = 0x%08lx\n",
1407 (long) current_gdbarch->inner_than
1408 /*INNER_THAN ()*/);
1409 #endif
1410 #ifdef INTEGER_TO_ADDRESS
1411 fprintf_unfiltered (file,
1412 "gdbarch_dump: %s # %s\n",
1413 "INTEGER_TO_ADDRESS(type, buf)",
1414 XSTRING (INTEGER_TO_ADDRESS (type, buf)));
1415 if (GDB_MULTI_ARCH)
1416 fprintf_unfiltered (file,
1417 "gdbarch_dump: INTEGER_TO_ADDRESS = 0x%08lx\n",
1418 (long) current_gdbarch->integer_to_address
1419 /*INTEGER_TO_ADDRESS ()*/);
1420 #endif
1421 #ifdef IN_SOLIB_CALL_TRAMPOLINE
1422 fprintf_unfiltered (file,
1423 "gdbarch_dump: %s # %s\n",
1424 "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
1425 XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
1426 if (GDB_MULTI_ARCH)
1427 fprintf_unfiltered (file,
1428 "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = 0x%08lx\n",
1429 (long) current_gdbarch->in_solib_call_trampoline
1430 /*IN_SOLIB_CALL_TRAMPOLINE ()*/);
1431 #endif
1432 #ifdef MAX_REGISTER_RAW_SIZE
1433 fprintf_unfiltered (file,
1434 "gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n",
1435 XSTRING (MAX_REGISTER_RAW_SIZE));
1436 fprintf_unfiltered (file,
1437 "gdbarch_dump: MAX_REGISTER_RAW_SIZE = %d\n",
1438 MAX_REGISTER_RAW_SIZE);
1439 #endif
1440 #ifdef MAX_REGISTER_VIRTUAL_SIZE
1441 fprintf_unfiltered (file,
1442 "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE # %s\n",
1443 XSTRING (MAX_REGISTER_VIRTUAL_SIZE));
1444 fprintf_unfiltered (file,
1445 "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE = %d\n",
1446 MAX_REGISTER_VIRTUAL_SIZE);
1447 #endif
1448 #ifdef MEMORY_INSERT_BREAKPOINT
1449 fprintf_unfiltered (file,
1450 "gdbarch_dump: %s # %s\n",
1451 "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1452 XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
1453 if (GDB_MULTI_ARCH)
1454 fprintf_unfiltered (file,
1455 "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
1456 (long) current_gdbarch->memory_insert_breakpoint
1457 /*MEMORY_INSERT_BREAKPOINT ()*/);
1458 #endif
1459 #ifdef MEMORY_REMOVE_BREAKPOINT
1460 fprintf_unfiltered (file,
1461 "gdbarch_dump: %s # %s\n",
1462 "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1463 XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
1464 if (GDB_MULTI_ARCH)
1465 fprintf_unfiltered (file,
1466 "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
1467 (long) current_gdbarch->memory_remove_breakpoint
1468 /*MEMORY_REMOVE_BREAKPOINT ()*/);
1469 #endif
1470 #ifdef NPC_REGNUM
1471 fprintf_unfiltered (file,
1472 "gdbarch_dump: NPC_REGNUM # %s\n",
1473 XSTRING (NPC_REGNUM));
1474 fprintf_unfiltered (file,
1475 "gdbarch_dump: NPC_REGNUM = %d\n",
1476 NPC_REGNUM);
1477 #endif
1478 #ifdef NUM_PSEUDO_REGS
1479 fprintf_unfiltered (file,
1480 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1481 XSTRING (NUM_PSEUDO_REGS));
1482 fprintf_unfiltered (file,
1483 "gdbarch_dump: NUM_PSEUDO_REGS = %d\n",
1484 NUM_PSEUDO_REGS);
1485 #endif
1486 #ifdef NUM_REGS
1487 fprintf_unfiltered (file,
1488 "gdbarch_dump: NUM_REGS # %s\n",
1489 XSTRING (NUM_REGS));
1490 fprintf_unfiltered (file,
1491 "gdbarch_dump: NUM_REGS = %d\n",
1492 NUM_REGS);
1493 #endif
1494 #ifdef PARM_BOUNDARY
1495 fprintf_unfiltered (file,
1496 "gdbarch_dump: PARM_BOUNDARY # %s\n",
1497 XSTRING (PARM_BOUNDARY));
1498 fprintf_unfiltered (file,
1499 "gdbarch_dump: PARM_BOUNDARY = %d\n",
1500 PARM_BOUNDARY);
1501 #endif
1502 #ifdef PC_IN_CALL_DUMMY
1503 fprintf_unfiltered (file,
1504 "gdbarch_dump: %s # %s\n",
1505 "PC_IN_CALL_DUMMY(pc, sp, frame_address)",
1506 XSTRING (PC_IN_CALL_DUMMY (pc, sp, frame_address)));
1507 if (GDB_MULTI_ARCH)
1508 fprintf_unfiltered (file,
1509 "gdbarch_dump: PC_IN_CALL_DUMMY = 0x%08lx\n",
1510 (long) current_gdbarch->pc_in_call_dummy
1511 /*PC_IN_CALL_DUMMY ()*/);
1512 #endif
1513 #ifdef PC_IN_SIGTRAMP
1514 fprintf_unfiltered (file,
1515 "gdbarch_dump: %s # %s\n",
1516 "PC_IN_SIGTRAMP(pc, name)",
1517 XSTRING (PC_IN_SIGTRAMP (pc, name)));
1518 if (GDB_MULTI_ARCH)
1519 fprintf_unfiltered (file,
1520 "gdbarch_dump: PC_IN_SIGTRAMP = 0x%08lx\n",
1521 (long) current_gdbarch->pc_in_sigtramp
1522 /*PC_IN_SIGTRAMP ()*/);
1523 #endif
1524 #ifdef PC_REGNUM
1525 fprintf_unfiltered (file,
1526 "gdbarch_dump: PC_REGNUM # %s\n",
1527 XSTRING (PC_REGNUM));
1528 fprintf_unfiltered (file,
1529 "gdbarch_dump: PC_REGNUM = %d\n",
1530 PC_REGNUM);
1531 #endif
1532 #ifdef POINTER_TO_ADDRESS
1533 fprintf_unfiltered (file,
1534 "gdbarch_dump: %s # %s\n",
1535 "POINTER_TO_ADDRESS(type, buf)",
1536 XSTRING (POINTER_TO_ADDRESS (type, buf)));
1537 if (GDB_MULTI_ARCH)
1538 fprintf_unfiltered (file,
1539 "gdbarch_dump: POINTER_TO_ADDRESS = 0x%08lx\n",
1540 (long) current_gdbarch->pointer_to_address
1541 /*POINTER_TO_ADDRESS ()*/);
1542 #endif
1543 #ifdef POP_FRAME
1544 #if GDB_MULTI_ARCH
1545 /* Macro might contain `[{}]' when not multi-arch */
1546 fprintf_unfiltered (file,
1547 "gdbarch_dump: %s # %s\n",
1548 "POP_FRAME(-)",
1549 XSTRING (POP_FRAME (-)));
1550 #endif
1551 if (GDB_MULTI_ARCH)
1552 fprintf_unfiltered (file,
1553 "gdbarch_dump: POP_FRAME = 0x%08lx\n",
1554 (long) current_gdbarch->pop_frame
1555 /*POP_FRAME ()*/);
1556 #endif
1557 #ifdef PREPARE_TO_PROCEED
1558 fprintf_unfiltered (file,
1559 "gdbarch_dump: %s # %s\n",
1560 "PREPARE_TO_PROCEED(select_it)",
1561 XSTRING (PREPARE_TO_PROCEED (select_it)));
1562 if (GDB_MULTI_ARCH)
1563 fprintf_unfiltered (file,
1564 "gdbarch_dump: PREPARE_TO_PROCEED = 0x%08lx\n",
1565 (long) current_gdbarch->prepare_to_proceed
1566 /*PREPARE_TO_PROCEED ()*/);
1567 #endif
1568 if (GDB_MULTI_ARCH)
1569 fprintf_unfiltered (file,
1570 "gdbarch_dump: print_float_info = 0x%08lx\n",
1571 (long) current_gdbarch->print_float_info);
1572 #ifdef PROLOGUE_FRAMELESS_P
1573 fprintf_unfiltered (file,
1574 "gdbarch_dump: %s # %s\n",
1575 "PROLOGUE_FRAMELESS_P(ip)",
1576 XSTRING (PROLOGUE_FRAMELESS_P (ip)));
1577 if (GDB_MULTI_ARCH)
1578 fprintf_unfiltered (file,
1579 "gdbarch_dump: PROLOGUE_FRAMELESS_P = 0x%08lx\n",
1580 (long) current_gdbarch->prologue_frameless_p
1581 /*PROLOGUE_FRAMELESS_P ()*/);
1582 #endif
1583 #ifdef PS_REGNUM
1584 fprintf_unfiltered (file,
1585 "gdbarch_dump: PS_REGNUM # %s\n",
1586 XSTRING (PS_REGNUM));
1587 fprintf_unfiltered (file,
1588 "gdbarch_dump: PS_REGNUM = %d\n",
1589 PS_REGNUM);
1590 #endif
1591 #ifdef PUSH_ARGUMENTS
1592 fprintf_unfiltered (file,
1593 "gdbarch_dump: %s # %s\n",
1594 "PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
1595 XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
1596 if (GDB_MULTI_ARCH)
1597 fprintf_unfiltered (file,
1598 "gdbarch_dump: PUSH_ARGUMENTS = 0x%08lx\n",
1599 (long) current_gdbarch->push_arguments
1600 /*PUSH_ARGUMENTS ()*/);
1601 #endif
1602 #ifdef PUSH_DUMMY_FRAME
1603 #if GDB_MULTI_ARCH
1604 /* Macro might contain `[{}]' when not multi-arch */
1605 fprintf_unfiltered (file,
1606 "gdbarch_dump: %s # %s\n",
1607 "PUSH_DUMMY_FRAME(-)",
1608 XSTRING (PUSH_DUMMY_FRAME (-)));
1609 #endif
1610 if (GDB_MULTI_ARCH)
1611 fprintf_unfiltered (file,
1612 "gdbarch_dump: PUSH_DUMMY_FRAME = 0x%08lx\n",
1613 (long) current_gdbarch->push_dummy_frame
1614 /*PUSH_DUMMY_FRAME ()*/);
1615 #endif
1616 #ifdef PUSH_RETURN_ADDRESS
1617 fprintf_unfiltered (file,
1618 "gdbarch_dump: %s # %s\n",
1619 "PUSH_RETURN_ADDRESS(pc, sp)",
1620 XSTRING (PUSH_RETURN_ADDRESS (pc, sp)));
1621 if (GDB_MULTI_ARCH)
1622 fprintf_unfiltered (file,
1623 "gdbarch_dump: PUSH_RETURN_ADDRESS = 0x%08lx\n",
1624 (long) current_gdbarch->push_return_address
1625 /*PUSH_RETURN_ADDRESS ()*/);
1626 #endif
1627 #ifdef REGISTER_BYTE
1628 fprintf_unfiltered (file,
1629 "gdbarch_dump: %s # %s\n",
1630 "REGISTER_BYTE(reg_nr)",
1631 XSTRING (REGISTER_BYTE (reg_nr)));
1632 if (GDB_MULTI_ARCH)
1633 fprintf_unfiltered (file,
1634 "gdbarch_dump: REGISTER_BYTE = 0x%08lx\n",
1635 (long) current_gdbarch->register_byte
1636 /*REGISTER_BYTE ()*/);
1637 #endif
1638 #ifdef REGISTER_BYTES
1639 fprintf_unfiltered (file,
1640 "gdbarch_dump: REGISTER_BYTES # %s\n",
1641 XSTRING (REGISTER_BYTES));
1642 fprintf_unfiltered (file,
1643 "gdbarch_dump: REGISTER_BYTES = %d\n",
1644 REGISTER_BYTES);
1645 #endif
1646 #ifdef REGISTER_BYTES_OK
1647 fprintf_unfiltered (file,
1648 "gdbarch_dump: %s # %s\n",
1649 "REGISTER_BYTES_OK(nr_bytes)",
1650 XSTRING (REGISTER_BYTES_OK (nr_bytes)));
1651 if (GDB_MULTI_ARCH)
1652 fprintf_unfiltered (file,
1653 "gdbarch_dump: REGISTER_BYTES_OK = 0x%08lx\n",
1654 (long) current_gdbarch->register_bytes_ok
1655 /*REGISTER_BYTES_OK ()*/);
1656 #endif
1657 #ifdef REGISTER_CONVERTIBLE
1658 fprintf_unfiltered (file,
1659 "gdbarch_dump: %s # %s\n",
1660 "REGISTER_CONVERTIBLE(nr)",
1661 XSTRING (REGISTER_CONVERTIBLE (nr)));
1662 if (GDB_MULTI_ARCH)
1663 fprintf_unfiltered (file,
1664 "gdbarch_dump: REGISTER_CONVERTIBLE = 0x%08lx\n",
1665 (long) current_gdbarch->register_convertible
1666 /*REGISTER_CONVERTIBLE ()*/);
1667 #endif
1668 #ifdef REGISTER_CONVERT_TO_RAW
1669 #if GDB_MULTI_ARCH
1670 /* Macro might contain `[{}]' when not multi-arch */
1671 fprintf_unfiltered (file,
1672 "gdbarch_dump: %s # %s\n",
1673 "REGISTER_CONVERT_TO_RAW(type, regnum, from, to)",
1674 XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to)));
1675 #endif
1676 if (GDB_MULTI_ARCH)
1677 fprintf_unfiltered (file,
1678 "gdbarch_dump: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
1679 (long) current_gdbarch->register_convert_to_raw
1680 /*REGISTER_CONVERT_TO_RAW ()*/);
1681 #endif
1682 #ifdef REGISTER_CONVERT_TO_VIRTUAL
1683 #if GDB_MULTI_ARCH
1684 /* Macro might contain `[{}]' when not multi-arch */
1685 fprintf_unfiltered (file,
1686 "gdbarch_dump: %s # %s\n",
1687 "REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)",
1688 XSTRING (REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to)));
1689 #endif
1690 if (GDB_MULTI_ARCH)
1691 fprintf_unfiltered (file,
1692 "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
1693 (long) current_gdbarch->register_convert_to_virtual
1694 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
1695 #endif
1696 #ifdef REGISTER_NAME
1697 fprintf_unfiltered (file,
1698 "gdbarch_dump: %s # %s\n",
1699 "REGISTER_NAME(regnr)",
1700 XSTRING (REGISTER_NAME (regnr)));
1701 if (GDB_MULTI_ARCH)
1702 fprintf_unfiltered (file,
1703 "gdbarch_dump: REGISTER_NAME = 0x%08lx\n",
1704 (long) current_gdbarch->register_name
1705 /*REGISTER_NAME ()*/);
1706 #endif
1707 #ifdef REGISTER_RAW_SIZE
1708 fprintf_unfiltered (file,
1709 "gdbarch_dump: %s # %s\n",
1710 "REGISTER_RAW_SIZE(reg_nr)",
1711 XSTRING (REGISTER_RAW_SIZE (reg_nr)));
1712 if (GDB_MULTI_ARCH)
1713 fprintf_unfiltered (file,
1714 "gdbarch_dump: REGISTER_RAW_SIZE = 0x%08lx\n",
1715 (long) current_gdbarch->register_raw_size
1716 /*REGISTER_RAW_SIZE ()*/);
1717 #endif
1718 #ifdef REGISTER_SIM_REGNO
1719 fprintf_unfiltered (file,
1720 "gdbarch_dump: %s # %s\n",
1721 "REGISTER_SIM_REGNO(reg_nr)",
1722 XSTRING (REGISTER_SIM_REGNO (reg_nr)));
1723 if (GDB_MULTI_ARCH)
1724 fprintf_unfiltered (file,
1725 "gdbarch_dump: REGISTER_SIM_REGNO = 0x%08lx\n",
1726 (long) current_gdbarch->register_sim_regno
1727 /*REGISTER_SIM_REGNO ()*/);
1728 #endif
1729 #ifdef REGISTER_SIZE
1730 fprintf_unfiltered (file,
1731 "gdbarch_dump: REGISTER_SIZE # %s\n",
1732 XSTRING (REGISTER_SIZE));
1733 fprintf_unfiltered (file,
1734 "gdbarch_dump: REGISTER_SIZE = %d\n",
1735 REGISTER_SIZE);
1736 #endif
1737 #ifdef REGISTER_TO_VALUE
1738 #if GDB_MULTI_ARCH
1739 /* Macro might contain `[{}]' when not multi-arch */
1740 fprintf_unfiltered (file,
1741 "gdbarch_dump: %s # %s\n",
1742 "REGISTER_TO_VALUE(regnum, type, from, to)",
1743 XSTRING (REGISTER_TO_VALUE (regnum, type, from, to)));
1744 #endif
1745 if (GDB_MULTI_ARCH)
1746 fprintf_unfiltered (file,
1747 "gdbarch_dump: REGISTER_TO_VALUE = 0x%08lx\n",
1748 (long) current_gdbarch->register_to_value
1749 /*REGISTER_TO_VALUE ()*/);
1750 #endif
1751 #ifdef REGISTER_VIRTUAL_SIZE
1752 fprintf_unfiltered (file,
1753 "gdbarch_dump: %s # %s\n",
1754 "REGISTER_VIRTUAL_SIZE(reg_nr)",
1755 XSTRING (REGISTER_VIRTUAL_SIZE (reg_nr)));
1756 if (GDB_MULTI_ARCH)
1757 fprintf_unfiltered (file,
1758 "gdbarch_dump: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
1759 (long) current_gdbarch->register_virtual_size
1760 /*REGISTER_VIRTUAL_SIZE ()*/);
1761 #endif
1762 #ifdef REGISTER_VIRTUAL_TYPE
1763 fprintf_unfiltered (file,
1764 "gdbarch_dump: %s # %s\n",
1765 "REGISTER_VIRTUAL_TYPE(reg_nr)",
1766 XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr)));
1767 if (GDB_MULTI_ARCH)
1768 fprintf_unfiltered (file,
1769 "gdbarch_dump: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
1770 (long) current_gdbarch->register_virtual_type
1771 /*REGISTER_VIRTUAL_TYPE ()*/);
1772 #endif
1773 #ifdef REG_STRUCT_HAS_ADDR
1774 fprintf_unfiltered (file,
1775 "gdbarch_dump: %s # %s\n",
1776 "REG_STRUCT_HAS_ADDR(gcc_p, type)",
1777 XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type)));
1778 if (GDB_MULTI_ARCH)
1779 fprintf_unfiltered (file,
1780 "gdbarch_dump: REG_STRUCT_HAS_ADDR = 0x%08lx\n",
1781 (long) current_gdbarch->reg_struct_has_addr
1782 /*REG_STRUCT_HAS_ADDR ()*/);
1783 #endif
1784 #ifdef REMOTE_TRANSLATE_XFER_ADDRESS
1785 #if GDB_MULTI_ARCH
1786 /* Macro might contain `[{}]' when not multi-arch */
1787 fprintf_unfiltered (file,
1788 "gdbarch_dump: %s # %s\n",
1789 "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)",
1790 XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len)));
1791 #endif
1792 if (GDB_MULTI_ARCH)
1793 fprintf_unfiltered (file,
1794 "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
1795 (long) current_gdbarch->remote_translate_xfer_address
1796 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
1797 #endif
1798 #ifdef RETURN_VALUE_ON_STACK
1799 fprintf_unfiltered (file,
1800 "gdbarch_dump: %s # %s\n",
1801 "RETURN_VALUE_ON_STACK(type)",
1802 XSTRING (RETURN_VALUE_ON_STACK (type)));
1803 if (GDB_MULTI_ARCH)
1804 fprintf_unfiltered (file,
1805 "gdbarch_dump: RETURN_VALUE_ON_STACK = 0x%08lx\n",
1806 (long) current_gdbarch->return_value_on_stack
1807 /*RETURN_VALUE_ON_STACK ()*/);
1808 #endif
1809 #ifdef SAVED_PC_AFTER_CALL
1810 fprintf_unfiltered (file,
1811 "gdbarch_dump: %s # %s\n",
1812 "SAVED_PC_AFTER_CALL(frame)",
1813 XSTRING (SAVED_PC_AFTER_CALL (frame)));
1814 if (GDB_MULTI_ARCH)
1815 fprintf_unfiltered (file,
1816 "gdbarch_dump: SAVED_PC_AFTER_CALL = 0x%08lx\n",
1817 (long) current_gdbarch->saved_pc_after_call
1818 /*SAVED_PC_AFTER_CALL ()*/);
1819 #endif
1820 #ifdef SAVE_DUMMY_FRAME_TOS
1821 #if GDB_MULTI_ARCH
1822 /* Macro might contain `[{}]' when not multi-arch */
1823 fprintf_unfiltered (file,
1824 "gdbarch_dump: %s # %s\n",
1825 "SAVE_DUMMY_FRAME_TOS(sp)",
1826 XSTRING (SAVE_DUMMY_FRAME_TOS (sp)));
1827 #endif
1828 if (GDB_MULTI_ARCH)
1829 fprintf_unfiltered (file,
1830 "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n",
1831 (long) current_gdbarch->save_dummy_frame_tos
1832 /*SAVE_DUMMY_FRAME_TOS ()*/);
1833 #endif
1834 #ifdef SDB_REG_TO_REGNUM
1835 fprintf_unfiltered (file,
1836 "gdbarch_dump: %s # %s\n",
1837 "SDB_REG_TO_REGNUM(sdb_regnr)",
1838 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
1839 if (GDB_MULTI_ARCH)
1840 fprintf_unfiltered (file,
1841 "gdbarch_dump: SDB_REG_TO_REGNUM = 0x%08lx\n",
1842 (long) current_gdbarch->sdb_reg_to_regnum
1843 /*SDB_REG_TO_REGNUM ()*/);
1844 #endif
1845 #ifdef SIZEOF_CALL_DUMMY_WORDS
1846 fprintf_unfiltered (file,
1847 "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n",
1848 XSTRING (SIZEOF_CALL_DUMMY_WORDS));
1849 fprintf_unfiltered (file,
1850 "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
1851 (long) SIZEOF_CALL_DUMMY_WORDS);
1852 #endif
1853 #ifdef SKIP_PROLOGUE
1854 fprintf_unfiltered (file,
1855 "gdbarch_dump: %s # %s\n",
1856 "SKIP_PROLOGUE(ip)",
1857 XSTRING (SKIP_PROLOGUE (ip)));
1858 if (GDB_MULTI_ARCH)
1859 fprintf_unfiltered (file,
1860 "gdbarch_dump: SKIP_PROLOGUE = 0x%08lx\n",
1861 (long) current_gdbarch->skip_prologue
1862 /*SKIP_PROLOGUE ()*/);
1863 #endif
1864 #ifdef SKIP_TRAMPOLINE_CODE
1865 fprintf_unfiltered (file,
1866 "gdbarch_dump: %s # %s\n",
1867 "SKIP_TRAMPOLINE_CODE(pc)",
1868 XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
1869 if (GDB_MULTI_ARCH)
1870 fprintf_unfiltered (file,
1871 "gdbarch_dump: SKIP_TRAMPOLINE_CODE = 0x%08lx\n",
1872 (long) current_gdbarch->skip_trampoline_code
1873 /*SKIP_TRAMPOLINE_CODE ()*/);
1874 #endif
1875 #ifdef SMASH_TEXT_ADDRESS
1876 fprintf_unfiltered (file,
1877 "gdbarch_dump: %s # %s\n",
1878 "SMASH_TEXT_ADDRESS(addr)",
1879 XSTRING (SMASH_TEXT_ADDRESS (addr)));
1880 if (GDB_MULTI_ARCH)
1881 fprintf_unfiltered (file,
1882 "gdbarch_dump: SMASH_TEXT_ADDRESS = 0x%08lx\n",
1883 (long) current_gdbarch->smash_text_address
1884 /*SMASH_TEXT_ADDRESS ()*/);
1885 #endif
1886 #ifdef SOFTWARE_SINGLE_STEP
1887 #if GDB_MULTI_ARCH
1888 /* Macro might contain `[{}]' when not multi-arch */
1889 fprintf_unfiltered (file,
1890 "gdbarch_dump: %s # %s\n",
1891 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
1892 XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
1893 #endif
1894 if (GDB_MULTI_ARCH)
1895 fprintf_unfiltered (file,
1896 "gdbarch_dump: SOFTWARE_SINGLE_STEP = 0x%08lx\n",
1897 (long) current_gdbarch->software_single_step
1898 /*SOFTWARE_SINGLE_STEP ()*/);
1899 #endif
1900 #ifdef SP_REGNUM
1901 fprintf_unfiltered (file,
1902 "gdbarch_dump: SP_REGNUM # %s\n",
1903 XSTRING (SP_REGNUM));
1904 fprintf_unfiltered (file,
1905 "gdbarch_dump: SP_REGNUM = %d\n",
1906 SP_REGNUM);
1907 #endif
1908 #ifdef STAB_REG_TO_REGNUM
1909 fprintf_unfiltered (file,
1910 "gdbarch_dump: %s # %s\n",
1911 "STAB_REG_TO_REGNUM(stab_regnr)",
1912 XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
1913 if (GDB_MULTI_ARCH)
1914 fprintf_unfiltered (file,
1915 "gdbarch_dump: STAB_REG_TO_REGNUM = 0x%08lx\n",
1916 (long) current_gdbarch->stab_reg_to_regnum
1917 /*STAB_REG_TO_REGNUM ()*/);
1918 #endif
1919 #ifdef STACK_ALIGN
1920 fprintf_unfiltered (file,
1921 "gdbarch_dump: %s # %s\n",
1922 "STACK_ALIGN(sp)",
1923 XSTRING (STACK_ALIGN (sp)));
1924 if (GDB_MULTI_ARCH)
1925 fprintf_unfiltered (file,
1926 "gdbarch_dump: STACK_ALIGN = 0x%08lx\n",
1927 (long) current_gdbarch->stack_align
1928 /*STACK_ALIGN ()*/);
1929 #endif
1930 #ifdef STORE_PSEUDO_REGISTER
1931 #if GDB_MULTI_ARCH
1932 /* Macro might contain `[{}]' when not multi-arch */
1933 fprintf_unfiltered (file,
1934 "gdbarch_dump: %s # %s\n",
1935 "STORE_PSEUDO_REGISTER(regnum)",
1936 XSTRING (STORE_PSEUDO_REGISTER (regnum)));
1937 #endif
1938 if (GDB_MULTI_ARCH)
1939 fprintf_unfiltered (file,
1940 "gdbarch_dump: STORE_PSEUDO_REGISTER = 0x%08lx\n",
1941 (long) current_gdbarch->store_pseudo_register
1942 /*STORE_PSEUDO_REGISTER ()*/);
1943 #endif
1944 #ifdef STORE_RETURN_VALUE
1945 #if GDB_MULTI_ARCH
1946 /* Macro might contain `[{}]' when not multi-arch */
1947 fprintf_unfiltered (file,
1948 "gdbarch_dump: %s # %s\n",
1949 "STORE_RETURN_VALUE(type, valbuf)",
1950 XSTRING (STORE_RETURN_VALUE (type, valbuf)));
1951 #endif
1952 if (GDB_MULTI_ARCH)
1953 fprintf_unfiltered (file,
1954 "gdbarch_dump: STORE_RETURN_VALUE = 0x%08lx\n",
1955 (long) current_gdbarch->store_return_value
1956 /*STORE_RETURN_VALUE ()*/);
1957 #endif
1958 #ifdef STORE_STRUCT_RETURN
1959 #if GDB_MULTI_ARCH
1960 /* Macro might contain `[{}]' when not multi-arch */
1961 fprintf_unfiltered (file,
1962 "gdbarch_dump: %s # %s\n",
1963 "STORE_STRUCT_RETURN(addr, sp)",
1964 XSTRING (STORE_STRUCT_RETURN (addr, sp)));
1965 #endif
1966 if (GDB_MULTI_ARCH)
1967 fprintf_unfiltered (file,
1968 "gdbarch_dump: STORE_STRUCT_RETURN = 0x%08lx\n",
1969 (long) current_gdbarch->store_struct_return
1970 /*STORE_STRUCT_RETURN ()*/);
1971 #endif
1972 #ifdef TARGET_ADDR_BIT
1973 fprintf_unfiltered (file,
1974 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
1975 XSTRING (TARGET_ADDR_BIT));
1976 fprintf_unfiltered (file,
1977 "gdbarch_dump: TARGET_ADDR_BIT = %d\n",
1978 TARGET_ADDR_BIT);
1979 #endif
1980 #ifdef TARGET_ARCHITECTURE
1981 fprintf_unfiltered (file,
1982 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
1983 XSTRING (TARGET_ARCHITECTURE));
1984 if (TARGET_ARCHITECTURE != NULL)
1985 fprintf_unfiltered (file,
1986 "gdbarch_dump: TARGET_ARCHITECTURE = %s\n",
1987 TARGET_ARCHITECTURE->printable_name);
1988 #endif
1989 #ifdef TARGET_BFD_VMA_BIT
1990 fprintf_unfiltered (file,
1991 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
1992 XSTRING (TARGET_BFD_VMA_BIT));
1993 fprintf_unfiltered (file,
1994 "gdbarch_dump: TARGET_BFD_VMA_BIT = %d\n",
1995 TARGET_BFD_VMA_BIT);
1996 #endif
1997 #ifdef TARGET_BYTE_ORDER
1998 fprintf_unfiltered (file,
1999 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
2000 XSTRING (TARGET_BYTE_ORDER));
2001 fprintf_unfiltered (file,
2002 "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
2003 (long) TARGET_BYTE_ORDER);
2004 #endif
2005 #ifdef TARGET_CHAR_SIGNED
2006 fprintf_unfiltered (file,
2007 "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
2008 XSTRING (TARGET_CHAR_SIGNED));
2009 fprintf_unfiltered (file,
2010 "gdbarch_dump: TARGET_CHAR_SIGNED = %d\n",
2011 TARGET_CHAR_SIGNED);
2012 #endif
2013 #ifdef TARGET_DOUBLE_BIT
2014 fprintf_unfiltered (file,
2015 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
2016 XSTRING (TARGET_DOUBLE_BIT));
2017 fprintf_unfiltered (file,
2018 "gdbarch_dump: TARGET_DOUBLE_BIT = %d\n",
2019 TARGET_DOUBLE_BIT);
2020 #endif
2021 #ifdef TARGET_DOUBLE_FORMAT
2022 fprintf_unfiltered (file,
2023 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
2024 XSTRING (TARGET_DOUBLE_FORMAT));
2025 fprintf_unfiltered (file,
2026 "gdbarch_dump: TARGET_DOUBLE_FORMAT = %ld\n",
2027 (long) TARGET_DOUBLE_FORMAT);
2028 #endif
2029 #ifdef TARGET_FLOAT_BIT
2030 fprintf_unfiltered (file,
2031 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
2032 XSTRING (TARGET_FLOAT_BIT));
2033 fprintf_unfiltered (file,
2034 "gdbarch_dump: TARGET_FLOAT_BIT = %d\n",
2035 TARGET_FLOAT_BIT);
2036 #endif
2037 #ifdef TARGET_FLOAT_FORMAT
2038 fprintf_unfiltered (file,
2039 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
2040 XSTRING (TARGET_FLOAT_FORMAT));
2041 fprintf_unfiltered (file,
2042 "gdbarch_dump: TARGET_FLOAT_FORMAT = %ld\n",
2043 (long) TARGET_FLOAT_FORMAT);
2044 #endif
2045 #ifdef TARGET_INT_BIT
2046 fprintf_unfiltered (file,
2047 "gdbarch_dump: TARGET_INT_BIT # %s\n",
2048 XSTRING (TARGET_INT_BIT));
2049 fprintf_unfiltered (file,
2050 "gdbarch_dump: TARGET_INT_BIT = %d\n",
2051 TARGET_INT_BIT);
2052 #endif
2053 #ifdef TARGET_LONG_BIT
2054 fprintf_unfiltered (file,
2055 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
2056 XSTRING (TARGET_LONG_BIT));
2057 fprintf_unfiltered (file,
2058 "gdbarch_dump: TARGET_LONG_BIT = %d\n",
2059 TARGET_LONG_BIT);
2060 #endif
2061 #ifdef TARGET_LONG_DOUBLE_BIT
2062 fprintf_unfiltered (file,
2063 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
2064 XSTRING (TARGET_LONG_DOUBLE_BIT));
2065 fprintf_unfiltered (file,
2066 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %d\n",
2067 TARGET_LONG_DOUBLE_BIT);
2068 #endif
2069 #ifdef TARGET_LONG_DOUBLE_FORMAT
2070 fprintf_unfiltered (file,
2071 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
2072 XSTRING (TARGET_LONG_DOUBLE_FORMAT));
2073 fprintf_unfiltered (file,
2074 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %ld\n",
2075 (long) TARGET_LONG_DOUBLE_FORMAT);
2076 #endif
2077 #ifdef TARGET_LONG_LONG_BIT
2078 fprintf_unfiltered (file,
2079 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
2080 XSTRING (TARGET_LONG_LONG_BIT));
2081 fprintf_unfiltered (file,
2082 "gdbarch_dump: TARGET_LONG_LONG_BIT = %d\n",
2083 TARGET_LONG_LONG_BIT);
2084 #endif
2085 #ifdef TARGET_PRINT_INSN
2086 fprintf_unfiltered (file,
2087 "gdbarch_dump: %s # %s\n",
2088 "TARGET_PRINT_INSN(vma, info)",
2089 XSTRING (TARGET_PRINT_INSN (vma, info)));
2090 if (GDB_MULTI_ARCH)
2091 fprintf_unfiltered (file,
2092 "gdbarch_dump: TARGET_PRINT_INSN = 0x%08lx\n",
2093 (long) current_gdbarch->print_insn
2094 /*TARGET_PRINT_INSN ()*/);
2095 #endif
2096 #ifdef TARGET_PTR_BIT
2097 fprintf_unfiltered (file,
2098 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
2099 XSTRING (TARGET_PTR_BIT));
2100 fprintf_unfiltered (file,
2101 "gdbarch_dump: TARGET_PTR_BIT = %d\n",
2102 TARGET_PTR_BIT);
2103 #endif
2104 #ifdef TARGET_READ_FP
2105 fprintf_unfiltered (file,
2106 "gdbarch_dump: %s # %s\n",
2107 "TARGET_READ_FP()",
2108 XSTRING (TARGET_READ_FP ()));
2109 if (GDB_MULTI_ARCH)
2110 fprintf_unfiltered (file,
2111 "gdbarch_dump: TARGET_READ_FP = 0x%08lx\n",
2112 (long) current_gdbarch->read_fp
2113 /*TARGET_READ_FP ()*/);
2114 #endif
2115 #ifdef TARGET_READ_PC
2116 fprintf_unfiltered (file,
2117 "gdbarch_dump: %s # %s\n",
2118 "TARGET_READ_PC(ptid)",
2119 XSTRING (TARGET_READ_PC (ptid)));
2120 if (GDB_MULTI_ARCH)
2121 fprintf_unfiltered (file,
2122 "gdbarch_dump: TARGET_READ_PC = 0x%08lx\n",
2123 (long) current_gdbarch->read_pc
2124 /*TARGET_READ_PC ()*/);
2125 #endif
2126 #ifdef TARGET_READ_SP
2127 fprintf_unfiltered (file,
2128 "gdbarch_dump: %s # %s\n",
2129 "TARGET_READ_SP()",
2130 XSTRING (TARGET_READ_SP ()));
2131 if (GDB_MULTI_ARCH)
2132 fprintf_unfiltered (file,
2133 "gdbarch_dump: TARGET_READ_SP = 0x%08lx\n",
2134 (long) current_gdbarch->read_sp
2135 /*TARGET_READ_SP ()*/);
2136 #endif
2137 #ifdef TARGET_SHORT_BIT
2138 fprintf_unfiltered (file,
2139 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
2140 XSTRING (TARGET_SHORT_BIT));
2141 fprintf_unfiltered (file,
2142 "gdbarch_dump: TARGET_SHORT_BIT = %d\n",
2143 TARGET_SHORT_BIT);
2144 #endif
2145 #ifdef TARGET_VIRTUAL_FRAME_POINTER
2146 #if GDB_MULTI_ARCH
2147 /* Macro might contain `[{}]' when not multi-arch */
2148 fprintf_unfiltered (file,
2149 "gdbarch_dump: %s # %s\n",
2150 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
2151 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
2152 #endif
2153 if (GDB_MULTI_ARCH)
2154 fprintf_unfiltered (file,
2155 "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = 0x%08lx\n",
2156 (long) current_gdbarch->virtual_frame_pointer
2157 /*TARGET_VIRTUAL_FRAME_POINTER ()*/);
2158 #endif
2159 #ifdef TARGET_WRITE_PC
2160 #if GDB_MULTI_ARCH
2161 /* Macro might contain `[{}]' when not multi-arch */
2162 fprintf_unfiltered (file,
2163 "gdbarch_dump: %s # %s\n",
2164 "TARGET_WRITE_PC(val, ptid)",
2165 XSTRING (TARGET_WRITE_PC (val, ptid)));
2166 #endif
2167 if (GDB_MULTI_ARCH)
2168 fprintf_unfiltered (file,
2169 "gdbarch_dump: TARGET_WRITE_PC = 0x%08lx\n",
2170 (long) current_gdbarch->write_pc
2171 /*TARGET_WRITE_PC ()*/);
2172 #endif
2173 #ifdef TARGET_WRITE_SP
2174 #if GDB_MULTI_ARCH
2175 /* Macro might contain `[{}]' when not multi-arch */
2176 fprintf_unfiltered (file,
2177 "gdbarch_dump: %s # %s\n",
2178 "TARGET_WRITE_SP(val)",
2179 XSTRING (TARGET_WRITE_SP (val)));
2180 #endif
2181 if (GDB_MULTI_ARCH)
2182 fprintf_unfiltered (file,
2183 "gdbarch_dump: TARGET_WRITE_SP = 0x%08lx\n",
2184 (long) current_gdbarch->write_sp
2185 /*TARGET_WRITE_SP ()*/);
2186 #endif
2187 #ifdef USE_GENERIC_DUMMY_FRAMES
2188 fprintf_unfiltered (file,
2189 "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n",
2190 XSTRING (USE_GENERIC_DUMMY_FRAMES));
2191 fprintf_unfiltered (file,
2192 "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %d\n",
2193 USE_GENERIC_DUMMY_FRAMES);
2194 #endif
2195 #ifdef USE_STRUCT_CONVENTION
2196 fprintf_unfiltered (file,
2197 "gdbarch_dump: %s # %s\n",
2198 "USE_STRUCT_CONVENTION(gcc_p, value_type)",
2199 XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type)));
2200 if (GDB_MULTI_ARCH)
2201 fprintf_unfiltered (file,
2202 "gdbarch_dump: USE_STRUCT_CONVENTION = 0x%08lx\n",
2203 (long) current_gdbarch->use_struct_convention
2204 /*USE_STRUCT_CONVENTION ()*/);
2205 #endif
2206 #ifdef VALUE_TO_REGISTER
2207 #if GDB_MULTI_ARCH
2208 /* Macro might contain `[{}]' when not multi-arch */
2209 fprintf_unfiltered (file,
2210 "gdbarch_dump: %s # %s\n",
2211 "VALUE_TO_REGISTER(type, regnum, from, to)",
2212 XSTRING (VALUE_TO_REGISTER (type, regnum, from, to)));
2213 #endif
2214 if (GDB_MULTI_ARCH)
2215 fprintf_unfiltered (file,
2216 "gdbarch_dump: VALUE_TO_REGISTER = 0x%08lx\n",
2217 (long) current_gdbarch->value_to_register
2218 /*VALUE_TO_REGISTER ()*/);
2219 #endif
2220 if (current_gdbarch->dump_tdep != NULL)
2221 current_gdbarch->dump_tdep (current_gdbarch, file);
2222 }
2223
2224 struct gdbarch_tdep *
2225 gdbarch_tdep (struct gdbarch *gdbarch)
2226 {
2227 if (gdbarch_debug >= 2)
2228 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
2229 return gdbarch->tdep;
2230 }
2231
2232
2233 const struct bfd_arch_info *
2234 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
2235 {
2236 gdb_assert (gdbarch != NULL);
2237 if (gdbarch_debug >= 2)
2238 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
2239 return gdbarch->bfd_arch_info;
2240 }
2241
2242 int
2243 gdbarch_byte_order (struct gdbarch *gdbarch)
2244 {
2245 gdb_assert (gdbarch != NULL);
2246 if (gdbarch_debug >= 2)
2247 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
2248 return gdbarch->byte_order;
2249 }
2250
2251 int
2252 gdbarch_short_bit (struct gdbarch *gdbarch)
2253 {
2254 gdb_assert (gdbarch != NULL);
2255 /* Skip verify of short_bit, invalid_p == 0 */
2256 if (gdbarch_debug >= 2)
2257 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
2258 return gdbarch->short_bit;
2259 }
2260
2261 void
2262 set_gdbarch_short_bit (struct gdbarch *gdbarch,
2263 int short_bit)
2264 {
2265 gdbarch->short_bit = short_bit;
2266 }
2267
2268 int
2269 gdbarch_int_bit (struct gdbarch *gdbarch)
2270 {
2271 gdb_assert (gdbarch != NULL);
2272 /* Skip verify of int_bit, invalid_p == 0 */
2273 if (gdbarch_debug >= 2)
2274 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
2275 return gdbarch->int_bit;
2276 }
2277
2278 void
2279 set_gdbarch_int_bit (struct gdbarch *gdbarch,
2280 int int_bit)
2281 {
2282 gdbarch->int_bit = int_bit;
2283 }
2284
2285 int
2286 gdbarch_long_bit (struct gdbarch *gdbarch)
2287 {
2288 gdb_assert (gdbarch != NULL);
2289 /* Skip verify of long_bit, invalid_p == 0 */
2290 if (gdbarch_debug >= 2)
2291 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
2292 return gdbarch->long_bit;
2293 }
2294
2295 void
2296 set_gdbarch_long_bit (struct gdbarch *gdbarch,
2297 int long_bit)
2298 {
2299 gdbarch->long_bit = long_bit;
2300 }
2301
2302 int
2303 gdbarch_long_long_bit (struct gdbarch *gdbarch)
2304 {
2305 gdb_assert (gdbarch != NULL);
2306 /* Skip verify of long_long_bit, invalid_p == 0 */
2307 if (gdbarch_debug >= 2)
2308 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
2309 return gdbarch->long_long_bit;
2310 }
2311
2312 void
2313 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
2314 int long_long_bit)
2315 {
2316 gdbarch->long_long_bit = long_long_bit;
2317 }
2318
2319 int
2320 gdbarch_float_bit (struct gdbarch *gdbarch)
2321 {
2322 gdb_assert (gdbarch != NULL);
2323 /* Skip verify of float_bit, invalid_p == 0 */
2324 if (gdbarch_debug >= 2)
2325 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
2326 return gdbarch->float_bit;
2327 }
2328
2329 void
2330 set_gdbarch_float_bit (struct gdbarch *gdbarch,
2331 int float_bit)
2332 {
2333 gdbarch->float_bit = float_bit;
2334 }
2335
2336 int
2337 gdbarch_double_bit (struct gdbarch *gdbarch)
2338 {
2339 gdb_assert (gdbarch != NULL);
2340 /* Skip verify of double_bit, invalid_p == 0 */
2341 if (gdbarch_debug >= 2)
2342 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
2343 return gdbarch->double_bit;
2344 }
2345
2346 void
2347 set_gdbarch_double_bit (struct gdbarch *gdbarch,
2348 int double_bit)
2349 {
2350 gdbarch->double_bit = double_bit;
2351 }
2352
2353 int
2354 gdbarch_long_double_bit (struct gdbarch *gdbarch)
2355 {
2356 gdb_assert (gdbarch != NULL);
2357 /* Skip verify of long_double_bit, invalid_p == 0 */
2358 if (gdbarch_debug >= 2)
2359 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
2360 return gdbarch->long_double_bit;
2361 }
2362
2363 void
2364 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
2365 int long_double_bit)
2366 {
2367 gdbarch->long_double_bit = long_double_bit;
2368 }
2369
2370 int
2371 gdbarch_ptr_bit (struct gdbarch *gdbarch)
2372 {
2373 gdb_assert (gdbarch != NULL);
2374 /* Skip verify of ptr_bit, invalid_p == 0 */
2375 if (gdbarch_debug >= 2)
2376 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
2377 return gdbarch->ptr_bit;
2378 }
2379
2380 void
2381 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
2382 int ptr_bit)
2383 {
2384 gdbarch->ptr_bit = ptr_bit;
2385 }
2386
2387 int
2388 gdbarch_addr_bit (struct gdbarch *gdbarch)
2389 {
2390 gdb_assert (gdbarch != NULL);
2391 if (gdbarch->addr_bit == 0)
2392 internal_error (__FILE__, __LINE__,
2393 "gdbarch: gdbarch_addr_bit invalid");
2394 if (gdbarch_debug >= 2)
2395 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
2396 return gdbarch->addr_bit;
2397 }
2398
2399 void
2400 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
2401 int addr_bit)
2402 {
2403 gdbarch->addr_bit = addr_bit;
2404 }
2405
2406 int
2407 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
2408 {
2409 gdb_assert (gdbarch != NULL);
2410 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
2411 if (gdbarch_debug >= 2)
2412 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
2413 return gdbarch->bfd_vma_bit;
2414 }
2415
2416 void
2417 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
2418 int bfd_vma_bit)
2419 {
2420 gdbarch->bfd_vma_bit = bfd_vma_bit;
2421 }
2422
2423 int
2424 gdbarch_char_signed (struct gdbarch *gdbarch)
2425 {
2426 gdb_assert (gdbarch != NULL);
2427 if (gdbarch->char_signed == -1)
2428 internal_error (__FILE__, __LINE__,
2429 "gdbarch: gdbarch_char_signed invalid");
2430 if (gdbarch_debug >= 2)
2431 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
2432 return gdbarch->char_signed;
2433 }
2434
2435 void
2436 set_gdbarch_char_signed (struct gdbarch *gdbarch,
2437 int char_signed)
2438 {
2439 gdbarch->char_signed = char_signed;
2440 }
2441
2442 CORE_ADDR
2443 gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
2444 {
2445 gdb_assert (gdbarch != NULL);
2446 if (gdbarch->read_pc == 0)
2447 internal_error (__FILE__, __LINE__,
2448 "gdbarch: gdbarch_read_pc invalid");
2449 if (gdbarch_debug >= 2)
2450 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
2451 return gdbarch->read_pc (ptid);
2452 }
2453
2454 void
2455 set_gdbarch_read_pc (struct gdbarch *gdbarch,
2456 gdbarch_read_pc_ftype read_pc)
2457 {
2458 gdbarch->read_pc = read_pc;
2459 }
2460
2461 void
2462 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
2463 {
2464 gdb_assert (gdbarch != NULL);
2465 if (gdbarch->write_pc == 0)
2466 internal_error (__FILE__, __LINE__,
2467 "gdbarch: gdbarch_write_pc invalid");
2468 if (gdbarch_debug >= 2)
2469 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
2470 gdbarch->write_pc (val, ptid);
2471 }
2472
2473 void
2474 set_gdbarch_write_pc (struct gdbarch *gdbarch,
2475 gdbarch_write_pc_ftype write_pc)
2476 {
2477 gdbarch->write_pc = write_pc;
2478 }
2479
2480 CORE_ADDR
2481 gdbarch_read_fp (struct gdbarch *gdbarch)
2482 {
2483 gdb_assert (gdbarch != NULL);
2484 if (gdbarch->read_fp == 0)
2485 internal_error (__FILE__, __LINE__,
2486 "gdbarch: gdbarch_read_fp invalid");
2487 if (gdbarch_debug >= 2)
2488 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n");
2489 return gdbarch->read_fp ();
2490 }
2491
2492 void
2493 set_gdbarch_read_fp (struct gdbarch *gdbarch,
2494 gdbarch_read_fp_ftype read_fp)
2495 {
2496 gdbarch->read_fp = read_fp;
2497 }
2498
2499 CORE_ADDR
2500 gdbarch_read_sp (struct gdbarch *gdbarch)
2501 {
2502 gdb_assert (gdbarch != NULL);
2503 if (gdbarch->read_sp == 0)
2504 internal_error (__FILE__, __LINE__,
2505 "gdbarch: gdbarch_read_sp invalid");
2506 if (gdbarch_debug >= 2)
2507 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
2508 return gdbarch->read_sp ();
2509 }
2510
2511 void
2512 set_gdbarch_read_sp (struct gdbarch *gdbarch,
2513 gdbarch_read_sp_ftype read_sp)
2514 {
2515 gdbarch->read_sp = read_sp;
2516 }
2517
2518 void
2519 gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
2520 {
2521 gdb_assert (gdbarch != NULL);
2522 if (gdbarch->write_sp == 0)
2523 internal_error (__FILE__, __LINE__,
2524 "gdbarch: gdbarch_write_sp invalid");
2525 if (gdbarch_debug >= 2)
2526 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n");
2527 gdbarch->write_sp (val);
2528 }
2529
2530 void
2531 set_gdbarch_write_sp (struct gdbarch *gdbarch,
2532 gdbarch_write_sp_ftype write_sp)
2533 {
2534 gdbarch->write_sp = write_sp;
2535 }
2536
2537 void
2538 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
2539 {
2540 gdb_assert (gdbarch != NULL);
2541 if (gdbarch->virtual_frame_pointer == 0)
2542 internal_error (__FILE__, __LINE__,
2543 "gdbarch: gdbarch_virtual_frame_pointer invalid");
2544 if (gdbarch_debug >= 2)
2545 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
2546 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
2547 }
2548
2549 void
2550 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
2551 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
2552 {
2553 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
2554 }
2555
2556 int
2557 gdbarch_register_read_p (struct gdbarch *gdbarch)
2558 {
2559 gdb_assert (gdbarch != NULL);
2560 return gdbarch->register_read != 0;
2561 }
2562
2563 void
2564 gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf)
2565 {
2566 gdb_assert (gdbarch != NULL);
2567 if (gdbarch->register_read == 0)
2568 internal_error (__FILE__, __LINE__,
2569 "gdbarch: gdbarch_register_read invalid");
2570 if (gdbarch_debug >= 2)
2571 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_read called\n");
2572 gdbarch->register_read (gdbarch, regnum, buf);
2573 }
2574
2575 void
2576 set_gdbarch_register_read (struct gdbarch *gdbarch,
2577 gdbarch_register_read_ftype register_read)
2578 {
2579 gdbarch->register_read = register_read;
2580 }
2581
2582 int
2583 gdbarch_register_write_p (struct gdbarch *gdbarch)
2584 {
2585 gdb_assert (gdbarch != NULL);
2586 return gdbarch->register_write != 0;
2587 }
2588
2589 void
2590 gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf)
2591 {
2592 gdb_assert (gdbarch != NULL);
2593 if (gdbarch->register_write == 0)
2594 internal_error (__FILE__, __LINE__,
2595 "gdbarch: gdbarch_register_write invalid");
2596 if (gdbarch_debug >= 2)
2597 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_write called\n");
2598 gdbarch->register_write (gdbarch, regnum, buf);
2599 }
2600
2601 void
2602 set_gdbarch_register_write (struct gdbarch *gdbarch,
2603 gdbarch_register_write_ftype register_write)
2604 {
2605 gdbarch->register_write = register_write;
2606 }
2607
2608 int
2609 gdbarch_num_regs (struct gdbarch *gdbarch)
2610 {
2611 gdb_assert (gdbarch != NULL);
2612 if (gdbarch->num_regs == -1)
2613 internal_error (__FILE__, __LINE__,
2614 "gdbarch: gdbarch_num_regs invalid");
2615 if (gdbarch_debug >= 2)
2616 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
2617 return gdbarch->num_regs;
2618 }
2619
2620 void
2621 set_gdbarch_num_regs (struct gdbarch *gdbarch,
2622 int num_regs)
2623 {
2624 gdbarch->num_regs = num_regs;
2625 }
2626
2627 int
2628 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
2629 {
2630 gdb_assert (gdbarch != NULL);
2631 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2632 if (gdbarch_debug >= 2)
2633 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
2634 return gdbarch->num_pseudo_regs;
2635 }
2636
2637 void
2638 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
2639 int num_pseudo_regs)
2640 {
2641 gdbarch->num_pseudo_regs = num_pseudo_regs;
2642 }
2643
2644 int
2645 gdbarch_sp_regnum (struct gdbarch *gdbarch)
2646 {
2647 gdb_assert (gdbarch != NULL);
2648 /* Skip verify of sp_regnum, invalid_p == 0 */
2649 if (gdbarch_debug >= 2)
2650 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2651 return gdbarch->sp_regnum;
2652 }
2653
2654 void
2655 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2656 int sp_regnum)
2657 {
2658 gdbarch->sp_regnum = sp_regnum;
2659 }
2660
2661 int
2662 gdbarch_fp_regnum (struct gdbarch *gdbarch)
2663 {
2664 gdb_assert (gdbarch != NULL);
2665 /* Skip verify of fp_regnum, invalid_p == 0 */
2666 if (gdbarch_debug >= 2)
2667 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
2668 return gdbarch->fp_regnum;
2669 }
2670
2671 void
2672 set_gdbarch_fp_regnum (struct gdbarch *gdbarch,
2673 int fp_regnum)
2674 {
2675 gdbarch->fp_regnum = fp_regnum;
2676 }
2677
2678 int
2679 gdbarch_pc_regnum (struct gdbarch *gdbarch)
2680 {
2681 gdb_assert (gdbarch != NULL);
2682 /* Skip verify of pc_regnum, invalid_p == 0 */
2683 if (gdbarch_debug >= 2)
2684 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2685 return gdbarch->pc_regnum;
2686 }
2687
2688 void
2689 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2690 int pc_regnum)
2691 {
2692 gdbarch->pc_regnum = pc_regnum;
2693 }
2694
2695 int
2696 gdbarch_ps_regnum (struct gdbarch *gdbarch)
2697 {
2698 gdb_assert (gdbarch != NULL);
2699 /* Skip verify of ps_regnum, invalid_p == 0 */
2700 if (gdbarch_debug >= 2)
2701 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
2702 return gdbarch->ps_regnum;
2703 }
2704
2705 void
2706 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
2707 int ps_regnum)
2708 {
2709 gdbarch->ps_regnum = ps_regnum;
2710 }
2711
2712 int
2713 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2714 {
2715 gdb_assert (gdbarch != NULL);
2716 /* Skip verify of fp0_regnum, invalid_p == 0 */
2717 if (gdbarch_debug >= 2)
2718 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2719 return gdbarch->fp0_regnum;
2720 }
2721
2722 void
2723 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2724 int fp0_regnum)
2725 {
2726 gdbarch->fp0_regnum = fp0_regnum;
2727 }
2728
2729 int
2730 gdbarch_npc_regnum (struct gdbarch *gdbarch)
2731 {
2732 gdb_assert (gdbarch != NULL);
2733 /* Skip verify of npc_regnum, invalid_p == 0 */
2734 if (gdbarch_debug >= 2)
2735 fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
2736 return gdbarch->npc_regnum;
2737 }
2738
2739 void
2740 set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
2741 int npc_regnum)
2742 {
2743 gdbarch->npc_regnum = npc_regnum;
2744 }
2745
2746 int
2747 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
2748 {
2749 gdb_assert (gdbarch != NULL);
2750 if (gdbarch->stab_reg_to_regnum == 0)
2751 internal_error (__FILE__, __LINE__,
2752 "gdbarch: gdbarch_stab_reg_to_regnum invalid");
2753 if (gdbarch_debug >= 2)
2754 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
2755 return gdbarch->stab_reg_to_regnum (stab_regnr);
2756 }
2757
2758 void
2759 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
2760 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
2761 {
2762 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
2763 }
2764
2765 int
2766 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
2767 {
2768 gdb_assert (gdbarch != NULL);
2769 if (gdbarch->ecoff_reg_to_regnum == 0)
2770 internal_error (__FILE__, __LINE__,
2771 "gdbarch: gdbarch_ecoff_reg_to_regnum invalid");
2772 if (gdbarch_debug >= 2)
2773 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
2774 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
2775 }
2776
2777 void
2778 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
2779 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
2780 {
2781 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
2782 }
2783
2784 int
2785 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
2786 {
2787 gdb_assert (gdbarch != NULL);
2788 if (gdbarch->dwarf_reg_to_regnum == 0)
2789 internal_error (__FILE__, __LINE__,
2790 "gdbarch: gdbarch_dwarf_reg_to_regnum invalid");
2791 if (gdbarch_debug >= 2)
2792 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
2793 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
2794 }
2795
2796 void
2797 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
2798 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
2799 {
2800 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
2801 }
2802
2803 int
2804 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
2805 {
2806 gdb_assert (gdbarch != NULL);
2807 if (gdbarch->sdb_reg_to_regnum == 0)
2808 internal_error (__FILE__, __LINE__,
2809 "gdbarch: gdbarch_sdb_reg_to_regnum invalid");
2810 if (gdbarch_debug >= 2)
2811 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
2812 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
2813 }
2814
2815 void
2816 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2817 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2818 {
2819 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2820 }
2821
2822 int
2823 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2824 {
2825 gdb_assert (gdbarch != NULL);
2826 if (gdbarch->dwarf2_reg_to_regnum == 0)
2827 internal_error (__FILE__, __LINE__,
2828 "gdbarch: gdbarch_dwarf2_reg_to_regnum invalid");
2829 if (gdbarch_debug >= 2)
2830 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
2831 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
2832 }
2833
2834 void
2835 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2836 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2837 {
2838 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2839 }
2840
2841 const char *
2842 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2843 {
2844 gdb_assert (gdbarch != NULL);
2845 if (gdbarch->register_name == 0)
2846 internal_error (__FILE__, __LINE__,
2847 "gdbarch: gdbarch_register_name invalid");
2848 if (gdbarch_debug >= 2)
2849 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2850 return gdbarch->register_name (regnr);
2851 }
2852
2853 void
2854 set_gdbarch_register_name (struct gdbarch *gdbarch,
2855 gdbarch_register_name_ftype register_name)
2856 {
2857 gdbarch->register_name = register_name;
2858 }
2859
2860 int
2861 gdbarch_register_size (struct gdbarch *gdbarch)
2862 {
2863 gdb_assert (gdbarch != NULL);
2864 if (gdbarch->register_size == -1)
2865 internal_error (__FILE__, __LINE__,
2866 "gdbarch: gdbarch_register_size invalid");
2867 if (gdbarch_debug >= 2)
2868 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n");
2869 return gdbarch->register_size;
2870 }
2871
2872 void
2873 set_gdbarch_register_size (struct gdbarch *gdbarch,
2874 int register_size)
2875 {
2876 gdbarch->register_size = register_size;
2877 }
2878
2879 int
2880 gdbarch_register_bytes (struct gdbarch *gdbarch)
2881 {
2882 gdb_assert (gdbarch != NULL);
2883 if (gdbarch->register_bytes == -1)
2884 internal_error (__FILE__, __LINE__,
2885 "gdbarch: gdbarch_register_bytes invalid");
2886 if (gdbarch_debug >= 2)
2887 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n");
2888 return gdbarch->register_bytes;
2889 }
2890
2891 void
2892 set_gdbarch_register_bytes (struct gdbarch *gdbarch,
2893 int register_bytes)
2894 {
2895 gdbarch->register_bytes = register_bytes;
2896 }
2897
2898 int
2899 gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
2900 {
2901 gdb_assert (gdbarch != NULL);
2902 if (gdbarch->register_byte == 0)
2903 internal_error (__FILE__, __LINE__,
2904 "gdbarch: gdbarch_register_byte invalid");
2905 if (gdbarch_debug >= 2)
2906 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n");
2907 return gdbarch->register_byte (reg_nr);
2908 }
2909
2910 void
2911 set_gdbarch_register_byte (struct gdbarch *gdbarch,
2912 gdbarch_register_byte_ftype register_byte)
2913 {
2914 gdbarch->register_byte = register_byte;
2915 }
2916
2917 int
2918 gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
2919 {
2920 gdb_assert (gdbarch != NULL);
2921 if (gdbarch->register_raw_size == 0)
2922 internal_error (__FILE__, __LINE__,
2923 "gdbarch: gdbarch_register_raw_size invalid");
2924 if (gdbarch_debug >= 2)
2925 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n");
2926 return gdbarch->register_raw_size (reg_nr);
2927 }
2928
2929 void
2930 set_gdbarch_register_raw_size (struct gdbarch *gdbarch,
2931 gdbarch_register_raw_size_ftype register_raw_size)
2932 {
2933 gdbarch->register_raw_size = register_raw_size;
2934 }
2935
2936 int
2937 gdbarch_max_register_raw_size (struct gdbarch *gdbarch)
2938 {
2939 gdb_assert (gdbarch != NULL);
2940 if (gdbarch->max_register_raw_size == -1)
2941 internal_error (__FILE__, __LINE__,
2942 "gdbarch: gdbarch_max_register_raw_size invalid");
2943 if (gdbarch_debug >= 2)
2944 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n");
2945 return gdbarch->max_register_raw_size;
2946 }
2947
2948 void
2949 set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch,
2950 int max_register_raw_size)
2951 {
2952 gdbarch->max_register_raw_size = max_register_raw_size;
2953 }
2954
2955 int
2956 gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
2957 {
2958 gdb_assert (gdbarch != NULL);
2959 if (gdbarch->register_virtual_size == 0)
2960 internal_error (__FILE__, __LINE__,
2961 "gdbarch: gdbarch_register_virtual_size invalid");
2962 if (gdbarch_debug >= 2)
2963 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n");
2964 return gdbarch->register_virtual_size (reg_nr);
2965 }
2966
2967 void
2968 set_gdbarch_register_virtual_size (struct gdbarch *gdbarch,
2969 gdbarch_register_virtual_size_ftype register_virtual_size)
2970 {
2971 gdbarch->register_virtual_size = register_virtual_size;
2972 }
2973
2974 int
2975 gdbarch_max_register_virtual_size (struct gdbarch *gdbarch)
2976 {
2977 gdb_assert (gdbarch != NULL);
2978 if (gdbarch->max_register_virtual_size == -1)
2979 internal_error (__FILE__, __LINE__,
2980 "gdbarch: gdbarch_max_register_virtual_size invalid");
2981 if (gdbarch_debug >= 2)
2982 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n");
2983 return gdbarch->max_register_virtual_size;
2984 }
2985
2986 void
2987 set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch,
2988 int max_register_virtual_size)
2989 {
2990 gdbarch->max_register_virtual_size = max_register_virtual_size;
2991 }
2992
2993 struct type *
2994 gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
2995 {
2996 gdb_assert (gdbarch != NULL);
2997 if (gdbarch->register_virtual_type == 0)
2998 internal_error (__FILE__, __LINE__,
2999 "gdbarch: gdbarch_register_virtual_type invalid");
3000 if (gdbarch_debug >= 2)
3001 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n");
3002 return gdbarch->register_virtual_type (reg_nr);
3003 }
3004
3005 void
3006 set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
3007 gdbarch_register_virtual_type_ftype register_virtual_type)
3008 {
3009 gdbarch->register_virtual_type = register_virtual_type;
3010 }
3011
3012 void
3013 gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
3014 {
3015 gdb_assert (gdbarch != NULL);
3016 if (gdbarch->do_registers_info == 0)
3017 internal_error (__FILE__, __LINE__,
3018 "gdbarch: gdbarch_do_registers_info invalid");
3019 if (gdbarch_debug >= 2)
3020 fprintf_unfiltered (gdb_stdlog, "gdbarch_do_registers_info called\n");
3021 gdbarch->do_registers_info (reg_nr, fpregs);
3022 }
3023
3024 void
3025 set_gdbarch_do_registers_info (struct gdbarch *gdbarch,
3026 gdbarch_do_registers_info_ftype do_registers_info)
3027 {
3028 gdbarch->do_registers_info = do_registers_info;
3029 }
3030
3031 void
3032 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame)
3033 {
3034 gdb_assert (gdbarch != NULL);
3035 if (gdbarch->print_float_info == 0)
3036 internal_error (__FILE__, __LINE__,
3037 "gdbarch: gdbarch_print_float_info invalid");
3038 if (gdbarch_debug >= 2)
3039 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
3040 gdbarch->print_float_info (gdbarch, file, frame);
3041 }
3042
3043 void
3044 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
3045 gdbarch_print_float_info_ftype print_float_info)
3046 {
3047 gdbarch->print_float_info = print_float_info;
3048 }
3049
3050 int
3051 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
3052 {
3053 gdb_assert (gdbarch != NULL);
3054 if (gdbarch->register_sim_regno == 0)
3055 internal_error (__FILE__, __LINE__,
3056 "gdbarch: gdbarch_register_sim_regno invalid");
3057 if (gdbarch_debug >= 2)
3058 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
3059 return gdbarch->register_sim_regno (reg_nr);
3060 }
3061
3062 void
3063 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
3064 gdbarch_register_sim_regno_ftype register_sim_regno)
3065 {
3066 gdbarch->register_sim_regno = register_sim_regno;
3067 }
3068
3069 int
3070 gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
3071 {
3072 gdb_assert (gdbarch != NULL);
3073 return gdbarch->register_bytes_ok != 0;
3074 }
3075
3076 int
3077 gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
3078 {
3079 gdb_assert (gdbarch != NULL);
3080 if (gdbarch->register_bytes_ok == 0)
3081 internal_error (__FILE__, __LINE__,
3082 "gdbarch: gdbarch_register_bytes_ok invalid");
3083 if (gdbarch_debug >= 2)
3084 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
3085 return gdbarch->register_bytes_ok (nr_bytes);
3086 }
3087
3088 void
3089 set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
3090 gdbarch_register_bytes_ok_ftype register_bytes_ok)
3091 {
3092 gdbarch->register_bytes_ok = register_bytes_ok;
3093 }
3094
3095 int
3096 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
3097 {
3098 gdb_assert (gdbarch != NULL);
3099 if (gdbarch->cannot_fetch_register == 0)
3100 internal_error (__FILE__, __LINE__,
3101 "gdbarch: gdbarch_cannot_fetch_register invalid");
3102 if (gdbarch_debug >= 2)
3103 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
3104 return gdbarch->cannot_fetch_register (regnum);
3105 }
3106
3107 void
3108 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
3109 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
3110 {
3111 gdbarch->cannot_fetch_register = cannot_fetch_register;
3112 }
3113
3114 int
3115 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
3116 {
3117 gdb_assert (gdbarch != NULL);
3118 if (gdbarch->cannot_store_register == 0)
3119 internal_error (__FILE__, __LINE__,
3120 "gdbarch: gdbarch_cannot_store_register invalid");
3121 if (gdbarch_debug >= 2)
3122 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
3123 return gdbarch->cannot_store_register (regnum);
3124 }
3125
3126 void
3127 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
3128 gdbarch_cannot_store_register_ftype cannot_store_register)
3129 {
3130 gdbarch->cannot_store_register = cannot_store_register;
3131 }
3132
3133 int
3134 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
3135 {
3136 gdb_assert (gdbarch != NULL);
3137 return gdbarch->get_longjmp_target != 0;
3138 }
3139
3140 int
3141 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
3142 {
3143 gdb_assert (gdbarch != NULL);
3144 if (gdbarch->get_longjmp_target == 0)
3145 internal_error (__FILE__, __LINE__,
3146 "gdbarch: gdbarch_get_longjmp_target invalid");
3147 if (gdbarch_debug >= 2)
3148 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
3149 return gdbarch->get_longjmp_target (pc);
3150 }
3151
3152 void
3153 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
3154 gdbarch_get_longjmp_target_ftype get_longjmp_target)
3155 {
3156 gdbarch->get_longjmp_target = get_longjmp_target;
3157 }
3158
3159 int
3160 gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
3161 {
3162 gdb_assert (gdbarch != NULL);
3163 if (gdbarch->use_generic_dummy_frames == -1)
3164 internal_error (__FILE__, __LINE__,
3165 "gdbarch: gdbarch_use_generic_dummy_frames invalid");
3166 if (gdbarch_debug >= 2)
3167 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n");
3168 return gdbarch->use_generic_dummy_frames;
3169 }
3170
3171 void
3172 set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch,
3173 int use_generic_dummy_frames)
3174 {
3175 gdbarch->use_generic_dummy_frames = use_generic_dummy_frames;
3176 }
3177
3178 int
3179 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
3180 {
3181 gdb_assert (gdbarch != NULL);
3182 if (gdbarch->call_dummy_location == 0)
3183 internal_error (__FILE__, __LINE__,
3184 "gdbarch: gdbarch_call_dummy_location invalid");
3185 if (gdbarch_debug >= 2)
3186 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
3187 return gdbarch->call_dummy_location;
3188 }
3189
3190 void
3191 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
3192 int call_dummy_location)
3193 {
3194 gdbarch->call_dummy_location = call_dummy_location;
3195 }
3196
3197 CORE_ADDR
3198 gdbarch_call_dummy_address (struct gdbarch *gdbarch)
3199 {
3200 gdb_assert (gdbarch != NULL);
3201 if (gdbarch->call_dummy_address == 0)
3202 internal_error (__FILE__, __LINE__,
3203 "gdbarch: gdbarch_call_dummy_address invalid");
3204 if (gdbarch_debug >= 2)
3205 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n");
3206 return gdbarch->call_dummy_address ();
3207 }
3208
3209 void
3210 set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
3211 gdbarch_call_dummy_address_ftype call_dummy_address)
3212 {
3213 gdbarch->call_dummy_address = call_dummy_address;
3214 }
3215
3216 CORE_ADDR
3217 gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch)
3218 {
3219 gdb_assert (gdbarch != NULL);
3220 if (gdbarch->call_dummy_start_offset == -1)
3221 internal_error (__FILE__, __LINE__,
3222 "gdbarch: gdbarch_call_dummy_start_offset invalid");
3223 if (gdbarch_debug >= 2)
3224 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n");
3225 return gdbarch->call_dummy_start_offset;
3226 }
3227
3228 void
3229 set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch,
3230 CORE_ADDR call_dummy_start_offset)
3231 {
3232 gdbarch->call_dummy_start_offset = call_dummy_start_offset;
3233 }
3234
3235 CORE_ADDR
3236 gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
3237 {
3238 gdb_assert (gdbarch != NULL);
3239 if (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1)
3240 internal_error (__FILE__, __LINE__,
3241 "gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
3242 if (gdbarch_debug >= 2)
3243 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n");
3244 return gdbarch->call_dummy_breakpoint_offset;
3245 }
3246
3247 void
3248 set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
3249 CORE_ADDR call_dummy_breakpoint_offset)
3250 {
3251 gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset;
3252 }
3253
3254 int
3255 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch)
3256 {
3257 gdb_assert (gdbarch != NULL);
3258 if (gdbarch->call_dummy_breakpoint_offset_p == -1)
3259 internal_error (__FILE__, __LINE__,
3260 "gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
3261 if (gdbarch_debug >= 2)
3262 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n");
3263 return gdbarch->call_dummy_breakpoint_offset_p;
3264 }
3265
3266 void
3267 set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch,
3268 int call_dummy_breakpoint_offset_p)
3269 {
3270 gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p;
3271 }
3272
3273 int
3274 gdbarch_call_dummy_length (struct gdbarch *gdbarch)
3275 {
3276 gdb_assert (gdbarch != NULL);
3277 if (gdbarch->call_dummy_length == -1)
3278 internal_error (__FILE__, __LINE__,
3279 "gdbarch: gdbarch_call_dummy_length invalid");
3280 if (gdbarch_debug >= 2)
3281 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n");
3282 return gdbarch->call_dummy_length;
3283 }
3284
3285 void
3286 set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
3287 int call_dummy_length)
3288 {
3289 gdbarch->call_dummy_length = call_dummy_length;
3290 }
3291
3292 int
3293 gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
3294 {
3295 gdb_assert (gdbarch != NULL);
3296 if (gdbarch->pc_in_call_dummy == 0)
3297 internal_error (__FILE__, __LINE__,
3298 "gdbarch: gdbarch_pc_in_call_dummy invalid");
3299 if (gdbarch_debug >= 2)
3300 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n");
3301 return gdbarch->pc_in_call_dummy (pc, sp, frame_address);
3302 }
3303
3304 void
3305 set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch,
3306 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy)
3307 {
3308 gdbarch->pc_in_call_dummy = pc_in_call_dummy;
3309 }
3310
3311 int
3312 gdbarch_call_dummy_p (struct gdbarch *gdbarch)
3313 {
3314 gdb_assert (gdbarch != NULL);
3315 if (gdbarch->call_dummy_p == -1)
3316 internal_error (__FILE__, __LINE__,
3317 "gdbarch: gdbarch_call_dummy_p invalid");
3318 if (gdbarch_debug >= 2)
3319 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n");
3320 return gdbarch->call_dummy_p;
3321 }
3322
3323 void
3324 set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
3325 int call_dummy_p)
3326 {
3327 gdbarch->call_dummy_p = call_dummy_p;
3328 }
3329
3330 LONGEST *
3331 gdbarch_call_dummy_words (struct gdbarch *gdbarch)
3332 {
3333 gdb_assert (gdbarch != NULL);
3334 /* Skip verify of call_dummy_words, invalid_p == 0 */
3335 if (gdbarch_debug >= 2)
3336 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
3337 return gdbarch->call_dummy_words;
3338 }
3339
3340 void
3341 set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
3342 LONGEST * call_dummy_words)
3343 {
3344 gdbarch->call_dummy_words = call_dummy_words;
3345 }
3346
3347 int
3348 gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
3349 {
3350 gdb_assert (gdbarch != NULL);
3351 /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
3352 if (gdbarch_debug >= 2)
3353 fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
3354 return gdbarch->sizeof_call_dummy_words;
3355 }
3356
3357 void
3358 set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch,
3359 int sizeof_call_dummy_words)
3360 {
3361 gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words;
3362 }
3363
3364 int
3365 gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch)
3366 {
3367 gdb_assert (gdbarch != NULL);
3368 if (gdbarch->call_dummy_stack_adjust_p == -1)
3369 internal_error (__FILE__, __LINE__,
3370 "gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
3371 if (gdbarch_debug >= 2)
3372 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n");
3373 return gdbarch->call_dummy_stack_adjust_p;
3374 }
3375
3376 void
3377 set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch,
3378 int call_dummy_stack_adjust_p)
3379 {
3380 gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p;
3381 }
3382
3383 int
3384 gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch)
3385 {
3386 gdb_assert (gdbarch != NULL);
3387 if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
3388 internal_error (__FILE__, __LINE__,
3389 "gdbarch: gdbarch_call_dummy_stack_adjust invalid");
3390 if (gdbarch_debug >= 2)
3391 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n");
3392 return gdbarch->call_dummy_stack_adjust;
3393 }
3394
3395 void
3396 set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch,
3397 int call_dummy_stack_adjust)
3398 {
3399 gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust;
3400 }
3401
3402 void
3403 gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p)
3404 {
3405 gdb_assert (gdbarch != NULL);
3406 if (gdbarch->fix_call_dummy == 0)
3407 internal_error (__FILE__, __LINE__,
3408 "gdbarch: gdbarch_fix_call_dummy invalid");
3409 if (gdbarch_debug >= 2)
3410 fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n");
3411 gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
3412 }
3413
3414 void
3415 set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
3416 gdbarch_fix_call_dummy_ftype fix_call_dummy)
3417 {
3418 gdbarch->fix_call_dummy = fix_call_dummy;
3419 }
3420
3421 void
3422 gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
3423 {
3424 gdb_assert (gdbarch != NULL);
3425 if (gdbarch->init_frame_pc_first == 0)
3426 internal_error (__FILE__, __LINE__,
3427 "gdbarch: gdbarch_init_frame_pc_first invalid");
3428 if (gdbarch_debug >= 2)
3429 fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc_first called\n");
3430 gdbarch->init_frame_pc_first (fromleaf, prev);
3431 }
3432
3433 void
3434 set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch,
3435 gdbarch_init_frame_pc_first_ftype init_frame_pc_first)
3436 {
3437 gdbarch->init_frame_pc_first = init_frame_pc_first;
3438 }
3439
3440 void
3441 gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
3442 {
3443 gdb_assert (gdbarch != NULL);
3444 if (gdbarch->init_frame_pc == 0)
3445 internal_error (__FILE__, __LINE__,
3446 "gdbarch: gdbarch_init_frame_pc invalid");
3447 if (gdbarch_debug >= 2)
3448 fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc called\n");
3449 gdbarch->init_frame_pc (fromleaf, prev);
3450 }
3451
3452 void
3453 set_gdbarch_init_frame_pc (struct gdbarch *gdbarch,
3454 gdbarch_init_frame_pc_ftype init_frame_pc)
3455 {
3456 gdbarch->init_frame_pc = init_frame_pc;
3457 }
3458
3459 int
3460 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
3461 {
3462 gdb_assert (gdbarch != NULL);
3463 if (gdbarch_debug >= 2)
3464 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
3465 return gdbarch->believe_pcc_promotion;
3466 }
3467
3468 void
3469 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
3470 int believe_pcc_promotion)
3471 {
3472 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
3473 }
3474
3475 int
3476 gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch)
3477 {
3478 gdb_assert (gdbarch != NULL);
3479 if (gdbarch_debug >= 2)
3480 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
3481 return gdbarch->believe_pcc_promotion_type;
3482 }
3483
3484 void
3485 set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
3486 int believe_pcc_promotion_type)
3487 {
3488 gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type;
3489 }
3490
3491 int
3492 gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual)
3493 {
3494 gdb_assert (gdbarch != NULL);
3495 if (gdbarch->coerce_float_to_double == 0)
3496 internal_error (__FILE__, __LINE__,
3497 "gdbarch: gdbarch_coerce_float_to_double invalid");
3498 if (gdbarch_debug >= 2)
3499 fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n");
3500 return gdbarch->coerce_float_to_double (formal, actual);
3501 }
3502
3503 void
3504 set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch,
3505 gdbarch_coerce_float_to_double_ftype coerce_float_to_double)
3506 {
3507 gdbarch->coerce_float_to_double = coerce_float_to_double;
3508 }
3509
3510 void
3511 gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)
3512 {
3513 gdb_assert (gdbarch != NULL);
3514 if (gdbarch->get_saved_register == 0)
3515 internal_error (__FILE__, __LINE__,
3516 "gdbarch: gdbarch_get_saved_register invalid");
3517 if (gdbarch_debug >= 2)
3518 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n");
3519 gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
3520 }
3521
3522 void
3523 set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
3524 gdbarch_get_saved_register_ftype get_saved_register)
3525 {
3526 gdbarch->get_saved_register = get_saved_register;
3527 }
3528
3529 int
3530 gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
3531 {
3532 gdb_assert (gdbarch != NULL);
3533 if (gdbarch->register_convertible == 0)
3534 internal_error (__FILE__, __LINE__,
3535 "gdbarch: gdbarch_register_convertible invalid");
3536 if (gdbarch_debug >= 2)
3537 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n");
3538 return gdbarch->register_convertible (nr);
3539 }
3540
3541 void
3542 set_gdbarch_register_convertible (struct gdbarch *gdbarch,
3543 gdbarch_register_convertible_ftype register_convertible)
3544 {
3545 gdbarch->register_convertible = register_convertible;
3546 }
3547
3548 void
3549 gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
3550 {
3551 gdb_assert (gdbarch != NULL);
3552 if (gdbarch->register_convert_to_virtual == 0)
3553 internal_error (__FILE__, __LINE__,
3554 "gdbarch: gdbarch_register_convert_to_virtual invalid");
3555 if (gdbarch_debug >= 2)
3556 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n");
3557 gdbarch->register_convert_to_virtual (regnum, type, from, to);
3558 }
3559
3560 void
3561 set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch,
3562 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual)
3563 {
3564 gdbarch->register_convert_to_virtual = register_convert_to_virtual;
3565 }
3566
3567 void
3568 gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
3569 {
3570 gdb_assert (gdbarch != NULL);
3571 if (gdbarch->register_convert_to_raw == 0)
3572 internal_error (__FILE__, __LINE__,
3573 "gdbarch: gdbarch_register_convert_to_raw invalid");
3574 if (gdbarch_debug >= 2)
3575 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n");
3576 gdbarch->register_convert_to_raw (type, regnum, from, to);
3577 }
3578
3579 void
3580 set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch,
3581 gdbarch_register_convert_to_raw_ftype register_convert_to_raw)
3582 {
3583 gdbarch->register_convert_to_raw = register_convert_to_raw;
3584 }
3585
3586 int
3587 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum)
3588 {
3589 gdb_assert (gdbarch != NULL);
3590 if (gdbarch->convert_register_p == 0)
3591 internal_error (__FILE__, __LINE__,
3592 "gdbarch: gdbarch_convert_register_p invalid");
3593 if (gdbarch_debug >= 2)
3594 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
3595 return gdbarch->convert_register_p (regnum);
3596 }
3597
3598 void
3599 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
3600 gdbarch_convert_register_p_ftype convert_register_p)
3601 {
3602 gdbarch->convert_register_p = convert_register_p;
3603 }
3604
3605 void
3606 gdbarch_register_to_value (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
3607 {
3608 gdb_assert (gdbarch != NULL);
3609 if (gdbarch->register_to_value == 0)
3610 internal_error (__FILE__, __LINE__,
3611 "gdbarch: gdbarch_register_to_value invalid");
3612 if (gdbarch_debug >= 2)
3613 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
3614 gdbarch->register_to_value (regnum, type, from, to);
3615 }
3616
3617 void
3618 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
3619 gdbarch_register_to_value_ftype register_to_value)
3620 {
3621 gdbarch->register_to_value = register_to_value;
3622 }
3623
3624 void
3625 gdbarch_value_to_register (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
3626 {
3627 gdb_assert (gdbarch != NULL);
3628 if (gdbarch->value_to_register == 0)
3629 internal_error (__FILE__, __LINE__,
3630 "gdbarch: gdbarch_value_to_register invalid");
3631 if (gdbarch_debug >= 2)
3632 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
3633 gdbarch->value_to_register (type, regnum, from, to);
3634 }
3635
3636 void
3637 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
3638 gdbarch_value_to_register_ftype value_to_register)
3639 {
3640 gdbarch->value_to_register = value_to_register;
3641 }
3642
3643 int
3644 gdbarch_fetch_pseudo_register_p (struct gdbarch *gdbarch)
3645 {
3646 gdb_assert (gdbarch != NULL);
3647 return gdbarch->fetch_pseudo_register != 0;
3648 }
3649
3650 void
3651 gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum)
3652 {
3653 gdb_assert (gdbarch != NULL);
3654 if (gdbarch->fetch_pseudo_register == 0)
3655 internal_error (__FILE__, __LINE__,
3656 "gdbarch: gdbarch_fetch_pseudo_register invalid");
3657 if (gdbarch_debug >= 2)
3658 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pseudo_register called\n");
3659 gdbarch->fetch_pseudo_register (regnum);
3660 }
3661
3662 void
3663 set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch,
3664 gdbarch_fetch_pseudo_register_ftype fetch_pseudo_register)
3665 {
3666 gdbarch->fetch_pseudo_register = fetch_pseudo_register;
3667 }
3668
3669 int
3670 gdbarch_store_pseudo_register_p (struct gdbarch *gdbarch)
3671 {
3672 gdb_assert (gdbarch != NULL);
3673 return gdbarch->store_pseudo_register != 0;
3674 }
3675
3676 void
3677 gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum)
3678 {
3679 gdb_assert (gdbarch != NULL);
3680 if (gdbarch->store_pseudo_register == 0)
3681 internal_error (__FILE__, __LINE__,
3682 "gdbarch: gdbarch_store_pseudo_register invalid");
3683 if (gdbarch_debug >= 2)
3684 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_pseudo_register called\n");
3685 gdbarch->store_pseudo_register (regnum);
3686 }
3687
3688 void
3689 set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch,
3690 gdbarch_store_pseudo_register_ftype store_pseudo_register)
3691 {
3692 gdbarch->store_pseudo_register = store_pseudo_register;
3693 }
3694
3695 CORE_ADDR
3696 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
3697 {
3698 gdb_assert (gdbarch != NULL);
3699 if (gdbarch->pointer_to_address == 0)
3700 internal_error (__FILE__, __LINE__,
3701 "gdbarch: gdbarch_pointer_to_address invalid");
3702 if (gdbarch_debug >= 2)
3703 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
3704 return gdbarch->pointer_to_address (type, buf);
3705 }
3706
3707 void
3708 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
3709 gdbarch_pointer_to_address_ftype pointer_to_address)
3710 {
3711 gdbarch->pointer_to_address = pointer_to_address;
3712 }
3713
3714 void
3715 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
3716 {
3717 gdb_assert (gdbarch != NULL);
3718 if (gdbarch->address_to_pointer == 0)
3719 internal_error (__FILE__, __LINE__,
3720 "gdbarch: gdbarch_address_to_pointer invalid");
3721 if (gdbarch_debug >= 2)
3722 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
3723 gdbarch->address_to_pointer (type, buf, addr);
3724 }
3725
3726 void
3727 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
3728 gdbarch_address_to_pointer_ftype address_to_pointer)
3729 {
3730 gdbarch->address_to_pointer = address_to_pointer;
3731 }
3732
3733 int
3734 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
3735 {
3736 gdb_assert (gdbarch != NULL);
3737 return gdbarch->integer_to_address != 0;
3738 }
3739
3740 CORE_ADDR
3741 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
3742 {
3743 gdb_assert (gdbarch != NULL);
3744 if (gdbarch->integer_to_address == 0)
3745 internal_error (__FILE__, __LINE__,
3746 "gdbarch: gdbarch_integer_to_address invalid");
3747 if (gdbarch_debug >= 2)
3748 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
3749 return gdbarch->integer_to_address (type, buf);
3750 }
3751
3752 void
3753 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
3754 gdbarch_integer_to_address_ftype integer_to_address)
3755 {
3756 gdbarch->integer_to_address = integer_to_address;
3757 }
3758
3759 int
3760 gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type)
3761 {
3762 gdb_assert (gdbarch != NULL);
3763 if (gdbarch->return_value_on_stack == 0)
3764 internal_error (__FILE__, __LINE__,
3765 "gdbarch: gdbarch_return_value_on_stack invalid");
3766 if (gdbarch_debug >= 2)
3767 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n");
3768 return gdbarch->return_value_on_stack (type);
3769 }
3770
3771 void
3772 set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
3773 gdbarch_return_value_on_stack_ftype return_value_on_stack)
3774 {
3775 gdbarch->return_value_on_stack = return_value_on_stack;
3776 }
3777
3778 void
3779 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, char *valbuf)
3780 {
3781 gdb_assert (gdbarch != NULL);
3782 if (gdbarch->extract_return_value == 0)
3783 internal_error (__FILE__, __LINE__,
3784 "gdbarch: gdbarch_extract_return_value invalid");
3785 if (gdbarch_debug >= 2)
3786 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
3787 gdbarch->extract_return_value (type, regcache, valbuf);
3788 }
3789
3790 void
3791 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
3792 gdbarch_extract_return_value_ftype extract_return_value)
3793 {
3794 gdbarch->extract_return_value = extract_return_value;
3795 }
3796
3797 void
3798 gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
3799 {
3800 gdb_assert (gdbarch != NULL);
3801 if (gdbarch->deprecated_extract_return_value == 0)
3802 internal_error (__FILE__, __LINE__,
3803 "gdbarch: gdbarch_deprecated_extract_return_value invalid");
3804 if (gdbarch_debug >= 2)
3805 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n");
3806 gdbarch->deprecated_extract_return_value (type, regbuf, valbuf);
3807 }
3808
3809 void
3810 set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch,
3811 gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value)
3812 {
3813 gdbarch->deprecated_extract_return_value = deprecated_extract_return_value;
3814 }
3815
3816 CORE_ADDR
3817 gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
3818 {
3819 gdb_assert (gdbarch != NULL);
3820 if (gdbarch->push_arguments == 0)
3821 internal_error (__FILE__, __LINE__,
3822 "gdbarch: gdbarch_push_arguments invalid");
3823 if (gdbarch_debug >= 2)
3824 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n");
3825 return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr);
3826 }
3827
3828 void
3829 set_gdbarch_push_arguments (struct gdbarch *gdbarch,
3830 gdbarch_push_arguments_ftype push_arguments)
3831 {
3832 gdbarch->push_arguments = push_arguments;
3833 }
3834
3835 void
3836 gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
3837 {
3838 gdb_assert (gdbarch != NULL);
3839 if (gdbarch->push_dummy_frame == 0)
3840 internal_error (__FILE__, __LINE__,
3841 "gdbarch: gdbarch_push_dummy_frame invalid");
3842 if (gdbarch_debug >= 2)
3843 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n");
3844 gdbarch->push_dummy_frame ();
3845 }
3846
3847 void
3848 set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch,
3849 gdbarch_push_dummy_frame_ftype push_dummy_frame)
3850 {
3851 gdbarch->push_dummy_frame = push_dummy_frame;
3852 }
3853
3854 int
3855 gdbarch_push_return_address_p (struct gdbarch *gdbarch)
3856 {
3857 gdb_assert (gdbarch != NULL);
3858 return gdbarch->push_return_address != 0;
3859 }
3860
3861 CORE_ADDR
3862 gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
3863 {
3864 gdb_assert (gdbarch != NULL);
3865 if (gdbarch->push_return_address == 0)
3866 internal_error (__FILE__, __LINE__,
3867 "gdbarch: gdbarch_push_return_address invalid");
3868 if (gdbarch_debug >= 2)
3869 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n");
3870 return gdbarch->push_return_address (pc, sp);
3871 }
3872
3873 void
3874 set_gdbarch_push_return_address (struct gdbarch *gdbarch,
3875 gdbarch_push_return_address_ftype push_return_address)
3876 {
3877 gdbarch->push_return_address = push_return_address;
3878 }
3879
3880 void
3881 gdbarch_pop_frame (struct gdbarch *gdbarch)
3882 {
3883 gdb_assert (gdbarch != NULL);
3884 if (gdbarch->pop_frame == 0)
3885 internal_error (__FILE__, __LINE__,
3886 "gdbarch: gdbarch_pop_frame invalid");
3887 if (gdbarch_debug >= 2)
3888 fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
3889 gdbarch->pop_frame ();
3890 }
3891
3892 void
3893 set_gdbarch_pop_frame (struct gdbarch *gdbarch,
3894 gdbarch_pop_frame_ftype pop_frame)
3895 {
3896 gdbarch->pop_frame = pop_frame;
3897 }
3898
3899 void
3900 gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
3901 {
3902 gdb_assert (gdbarch != NULL);
3903 if (gdbarch->store_struct_return == 0)
3904 internal_error (__FILE__, __LINE__,
3905 "gdbarch: gdbarch_store_struct_return invalid");
3906 if (gdbarch_debug >= 2)
3907 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n");
3908 gdbarch->store_struct_return (addr, sp);
3909 }
3910
3911 void
3912 set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
3913 gdbarch_store_struct_return_ftype store_struct_return)
3914 {
3915 gdbarch->store_struct_return = store_struct_return;
3916 }
3917
3918 void
3919 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
3920 {
3921 gdb_assert (gdbarch != NULL);
3922 if (gdbarch->store_return_value == 0)
3923 internal_error (__FILE__, __LINE__,
3924 "gdbarch: gdbarch_store_return_value invalid");
3925 if (gdbarch_debug >= 2)
3926 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
3927 gdbarch->store_return_value (type, valbuf);
3928 }
3929
3930 void
3931 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
3932 gdbarch_store_return_value_ftype store_return_value)
3933 {
3934 gdbarch->store_return_value = store_return_value;
3935 }
3936
3937 int
3938 gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
3939 {
3940 gdb_assert (gdbarch != NULL);
3941 return gdbarch->extract_struct_value_address != 0;
3942 }
3943
3944 CORE_ADDR
3945 gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
3946 {
3947 gdb_assert (gdbarch != NULL);
3948 if (gdbarch->extract_struct_value_address == 0)
3949 internal_error (__FILE__, __LINE__,
3950 "gdbarch: gdbarch_extract_struct_value_address invalid");
3951 if (gdbarch_debug >= 2)
3952 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
3953 return gdbarch->extract_struct_value_address (regcache);
3954 }
3955
3956 void
3957 set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
3958 gdbarch_extract_struct_value_address_ftype extract_struct_value_address)
3959 {
3960 gdbarch->extract_struct_value_address = extract_struct_value_address;
3961 }
3962
3963 int
3964 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
3965 {
3966 gdb_assert (gdbarch != NULL);
3967 return gdbarch->deprecated_extract_struct_value_address != 0;
3968 }
3969
3970 CORE_ADDR
3971 gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
3972 {
3973 gdb_assert (gdbarch != NULL);
3974 if (gdbarch->deprecated_extract_struct_value_address == 0)
3975 internal_error (__FILE__, __LINE__,
3976 "gdbarch: gdbarch_deprecated_extract_struct_value_address invalid");
3977 if (gdbarch_debug >= 2)
3978 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
3979 return gdbarch->deprecated_extract_struct_value_address (regbuf);
3980 }
3981
3982 void
3983 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
3984 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
3985 {
3986 gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
3987 }
3988
3989 int
3990 gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
3991 {
3992 gdb_assert (gdbarch != NULL);
3993 if (gdbarch->use_struct_convention == 0)
3994 internal_error (__FILE__, __LINE__,
3995 "gdbarch: gdbarch_use_struct_convention invalid");
3996 if (gdbarch_debug >= 2)
3997 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
3998 return gdbarch->use_struct_convention (gcc_p, value_type);
3999 }
4000
4001 void
4002 set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
4003 gdbarch_use_struct_convention_ftype use_struct_convention)
4004 {
4005 gdbarch->use_struct_convention = use_struct_convention;
4006 }
4007
4008 void
4009 gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
4010 {
4011 gdb_assert (gdbarch != NULL);
4012 if (gdbarch->frame_init_saved_regs == 0)
4013 internal_error (__FILE__, __LINE__,
4014 "gdbarch: gdbarch_frame_init_saved_regs invalid");
4015 if (gdbarch_debug >= 2)
4016 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n");
4017 gdbarch->frame_init_saved_regs (frame);
4018 }
4019
4020 void
4021 set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch,
4022 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs)
4023 {
4024 gdbarch->frame_init_saved_regs = frame_init_saved_regs;
4025 }
4026
4027 int
4028 gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch)
4029 {
4030 gdb_assert (gdbarch != NULL);
4031 return gdbarch->init_extra_frame_info != 0;
4032 }
4033
4034 void
4035 gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
4036 {
4037 gdb_assert (gdbarch != NULL);
4038 if (gdbarch->init_extra_frame_info == 0)
4039 internal_error (__FILE__, __LINE__,
4040 "gdbarch: gdbarch_init_extra_frame_info invalid");
4041 if (gdbarch_debug >= 2)
4042 fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n");
4043 gdbarch->init_extra_frame_info (fromleaf, frame);
4044 }
4045
4046 void
4047 set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch,
4048 gdbarch_init_extra_frame_info_ftype init_extra_frame_info)
4049 {
4050 gdbarch->init_extra_frame_info = init_extra_frame_info;
4051 }
4052
4053 CORE_ADDR
4054 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
4055 {
4056 gdb_assert (gdbarch != NULL);
4057 if (gdbarch->skip_prologue == 0)
4058 internal_error (__FILE__, __LINE__,
4059 "gdbarch: gdbarch_skip_prologue invalid");
4060 if (gdbarch_debug >= 2)
4061 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
4062 return gdbarch->skip_prologue (ip);
4063 }
4064
4065 void
4066 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
4067 gdbarch_skip_prologue_ftype skip_prologue)
4068 {
4069 gdbarch->skip_prologue = skip_prologue;
4070 }
4071
4072 int
4073 gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip)
4074 {
4075 gdb_assert (gdbarch != NULL);
4076 if (gdbarch->prologue_frameless_p == 0)
4077 internal_error (__FILE__, __LINE__,
4078 "gdbarch: gdbarch_prologue_frameless_p invalid");
4079 if (gdbarch_debug >= 2)
4080 fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n");
4081 return gdbarch->prologue_frameless_p (ip);
4082 }
4083
4084 void
4085 set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch,
4086 gdbarch_prologue_frameless_p_ftype prologue_frameless_p)
4087 {
4088 gdbarch->prologue_frameless_p = prologue_frameless_p;
4089 }
4090
4091 int
4092 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
4093 {
4094 gdb_assert (gdbarch != NULL);
4095 if (gdbarch->inner_than == 0)
4096 internal_error (__FILE__, __LINE__,
4097 "gdbarch: gdbarch_inner_than invalid");
4098 if (gdbarch_debug >= 2)
4099 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
4100 return gdbarch->inner_than (lhs, rhs);
4101 }
4102
4103 void
4104 set_gdbarch_inner_than (struct gdbarch *gdbarch,
4105 gdbarch_inner_than_ftype inner_than)
4106 {
4107 gdbarch->inner_than = inner_than;
4108 }
4109
4110 const unsigned char *
4111 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
4112 {
4113 gdb_assert (gdbarch != NULL);
4114 if (gdbarch->breakpoint_from_pc == 0)
4115 internal_error (__FILE__, __LINE__,
4116 "gdbarch: gdbarch_breakpoint_from_pc invalid");
4117 if (gdbarch_debug >= 2)
4118 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
4119 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
4120 }
4121
4122 void
4123 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
4124 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
4125 {
4126 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
4127 }
4128
4129 int
4130 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
4131 {
4132 gdb_assert (gdbarch != NULL);
4133 if (gdbarch->memory_insert_breakpoint == 0)
4134 internal_error (__FILE__, __LINE__,
4135 "gdbarch: gdbarch_memory_insert_breakpoint invalid");
4136 if (gdbarch_debug >= 2)
4137 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
4138 return gdbarch->memory_insert_breakpoint (addr, contents_cache);
4139 }
4140
4141 void
4142 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
4143 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
4144 {
4145 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
4146 }
4147
4148 int
4149 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
4150 {
4151 gdb_assert (gdbarch != NULL);
4152 if (gdbarch->memory_remove_breakpoint == 0)
4153 internal_error (__FILE__, __LINE__,
4154 "gdbarch: gdbarch_memory_remove_breakpoint invalid");
4155 if (gdbarch_debug >= 2)
4156 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
4157 return gdbarch->memory_remove_breakpoint (addr, contents_cache);
4158 }
4159
4160 void
4161 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
4162 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
4163 {
4164 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
4165 }
4166
4167 CORE_ADDR
4168 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
4169 {
4170 gdb_assert (gdbarch != NULL);
4171 if (gdbarch->decr_pc_after_break == -1)
4172 internal_error (__FILE__, __LINE__,
4173 "gdbarch: gdbarch_decr_pc_after_break invalid");
4174 if (gdbarch_debug >= 2)
4175 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
4176 return gdbarch->decr_pc_after_break;
4177 }
4178
4179 void
4180 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
4181 CORE_ADDR decr_pc_after_break)
4182 {
4183 gdbarch->decr_pc_after_break = decr_pc_after_break;
4184 }
4185
4186 int
4187 gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it)
4188 {
4189 gdb_assert (gdbarch != NULL);
4190 if (gdbarch->prepare_to_proceed == 0)
4191 internal_error (__FILE__, __LINE__,
4192 "gdbarch: gdbarch_prepare_to_proceed invalid");
4193 if (gdbarch_debug >= 2)
4194 fprintf_unfiltered (gdb_stdlog, "gdbarch_prepare_to_proceed called\n");
4195 return gdbarch->prepare_to_proceed (select_it);
4196 }
4197
4198 void
4199 set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch,
4200 gdbarch_prepare_to_proceed_ftype prepare_to_proceed)
4201 {
4202 gdbarch->prepare_to_proceed = prepare_to_proceed;
4203 }
4204
4205 CORE_ADDR
4206 gdbarch_function_start_offset (struct gdbarch *gdbarch)
4207 {
4208 gdb_assert (gdbarch != NULL);
4209 if (gdbarch->function_start_offset == -1)
4210 internal_error (__FILE__, __LINE__,
4211 "gdbarch: gdbarch_function_start_offset invalid");
4212 if (gdbarch_debug >= 2)
4213 fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
4214 return gdbarch->function_start_offset;
4215 }
4216
4217 void
4218 set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
4219 CORE_ADDR function_start_offset)
4220 {
4221 gdbarch->function_start_offset = function_start_offset;
4222 }
4223
4224 void
4225 gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
4226 {
4227 gdb_assert (gdbarch != NULL);
4228 if (gdbarch->remote_translate_xfer_address == 0)
4229 internal_error (__FILE__, __LINE__,
4230 "gdbarch: gdbarch_remote_translate_xfer_address invalid");
4231 if (gdbarch_debug >= 2)
4232 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
4233 gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len);
4234 }
4235
4236 void
4237 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
4238 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
4239 {
4240 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
4241 }
4242
4243 CORE_ADDR
4244 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
4245 {
4246 gdb_assert (gdbarch != NULL);
4247 if (gdbarch->frame_args_skip == -1)
4248 internal_error (__FILE__, __LINE__,
4249 "gdbarch: gdbarch_frame_args_skip invalid");
4250 if (gdbarch_debug >= 2)
4251 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
4252 return gdbarch->frame_args_skip;
4253 }
4254
4255 void
4256 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
4257 CORE_ADDR frame_args_skip)
4258 {
4259 gdbarch->frame_args_skip = frame_args_skip;
4260 }
4261
4262 int
4263 gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
4264 {
4265 gdb_assert (gdbarch != NULL);
4266 if (gdbarch->frameless_function_invocation == 0)
4267 internal_error (__FILE__, __LINE__,
4268 "gdbarch: gdbarch_frameless_function_invocation invalid");
4269 if (gdbarch_debug >= 2)
4270 fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n");
4271 return gdbarch->frameless_function_invocation (fi);
4272 }
4273
4274 void
4275 set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
4276 gdbarch_frameless_function_invocation_ftype frameless_function_invocation)
4277 {
4278 gdbarch->frameless_function_invocation = frameless_function_invocation;
4279 }
4280
4281 CORE_ADDR
4282 gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
4283 {
4284 gdb_assert (gdbarch != NULL);
4285 if (gdbarch->frame_chain == 0)
4286 internal_error (__FILE__, __LINE__,
4287 "gdbarch: gdbarch_frame_chain invalid");
4288 if (gdbarch_debug >= 2)
4289 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n");
4290 return gdbarch->frame_chain (frame);
4291 }
4292
4293 void
4294 set_gdbarch_frame_chain (struct gdbarch *gdbarch,
4295 gdbarch_frame_chain_ftype frame_chain)
4296 {
4297 gdbarch->frame_chain = frame_chain;
4298 }
4299
4300 int
4301 gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
4302 {
4303 gdb_assert (gdbarch != NULL);
4304 if (gdbarch->frame_chain_valid == 0)
4305 internal_error (__FILE__, __LINE__,
4306 "gdbarch: gdbarch_frame_chain_valid invalid");
4307 if (gdbarch_debug >= 2)
4308 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n");
4309 return gdbarch->frame_chain_valid (chain, thisframe);
4310 }
4311
4312 void
4313 set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
4314 gdbarch_frame_chain_valid_ftype frame_chain_valid)
4315 {
4316 gdbarch->frame_chain_valid = frame_chain_valid;
4317 }
4318
4319 CORE_ADDR
4320 gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
4321 {
4322 gdb_assert (gdbarch != NULL);
4323 if (gdbarch->frame_saved_pc == 0)
4324 internal_error (__FILE__, __LINE__,
4325 "gdbarch: gdbarch_frame_saved_pc invalid");
4326 if (gdbarch_debug >= 2)
4327 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n");
4328 return gdbarch->frame_saved_pc (fi);
4329 }
4330
4331 void
4332 set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
4333 gdbarch_frame_saved_pc_ftype frame_saved_pc)
4334 {
4335 gdbarch->frame_saved_pc = frame_saved_pc;
4336 }
4337
4338 CORE_ADDR
4339 gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
4340 {
4341 gdb_assert (gdbarch != NULL);
4342 if (gdbarch->frame_args_address == 0)
4343 internal_error (__FILE__, __LINE__,
4344 "gdbarch: gdbarch_frame_args_address invalid");
4345 if (gdbarch_debug >= 2)
4346 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n");
4347 return gdbarch->frame_args_address (fi);
4348 }
4349
4350 void
4351 set_gdbarch_frame_args_address (struct gdbarch *gdbarch,
4352 gdbarch_frame_args_address_ftype frame_args_address)
4353 {
4354 gdbarch->frame_args_address = frame_args_address;
4355 }
4356
4357 CORE_ADDR
4358 gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
4359 {
4360 gdb_assert (gdbarch != NULL);
4361 if (gdbarch->frame_locals_address == 0)
4362 internal_error (__FILE__, __LINE__,
4363 "gdbarch: gdbarch_frame_locals_address invalid");
4364 if (gdbarch_debug >= 2)
4365 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n");
4366 return gdbarch->frame_locals_address (fi);
4367 }
4368
4369 void
4370 set_gdbarch_frame_locals_address (struct gdbarch *gdbarch,
4371 gdbarch_frame_locals_address_ftype frame_locals_address)
4372 {
4373 gdbarch->frame_locals_address = frame_locals_address;
4374 }
4375
4376 CORE_ADDR
4377 gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
4378 {
4379 gdb_assert (gdbarch != NULL);
4380 if (gdbarch->saved_pc_after_call == 0)
4381 internal_error (__FILE__, __LINE__,
4382 "gdbarch: gdbarch_saved_pc_after_call invalid");
4383 if (gdbarch_debug >= 2)
4384 fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n");
4385 return gdbarch->saved_pc_after_call (frame);
4386 }
4387
4388 void
4389 set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch,
4390 gdbarch_saved_pc_after_call_ftype saved_pc_after_call)
4391 {
4392 gdbarch->saved_pc_after_call = saved_pc_after_call;
4393 }
4394
4395 int
4396 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
4397 {
4398 gdb_assert (gdbarch != NULL);
4399 if (gdbarch->frame_num_args == 0)
4400 internal_error (__FILE__, __LINE__,
4401 "gdbarch: gdbarch_frame_num_args invalid");
4402 if (gdbarch_debug >= 2)
4403 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
4404 return gdbarch->frame_num_args (frame);
4405 }
4406
4407 void
4408 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
4409 gdbarch_frame_num_args_ftype frame_num_args)
4410 {
4411 gdbarch->frame_num_args = frame_num_args;
4412 }
4413
4414 int
4415 gdbarch_stack_align_p (struct gdbarch *gdbarch)
4416 {
4417 gdb_assert (gdbarch != NULL);
4418 return gdbarch->stack_align != 0;
4419 }
4420
4421 CORE_ADDR
4422 gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
4423 {
4424 gdb_assert (gdbarch != NULL);
4425 if (gdbarch->stack_align == 0)
4426 internal_error (__FILE__, __LINE__,
4427 "gdbarch: gdbarch_stack_align invalid");
4428 if (gdbarch_debug >= 2)
4429 fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n");
4430 return gdbarch->stack_align (sp);
4431 }
4432
4433 void
4434 set_gdbarch_stack_align (struct gdbarch *gdbarch,
4435 gdbarch_stack_align_ftype stack_align)
4436 {
4437 gdbarch->stack_align = stack_align;
4438 }
4439
4440 int
4441 gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
4442 {
4443 gdb_assert (gdbarch != NULL);
4444 /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
4445 if (gdbarch_debug >= 2)
4446 fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n");
4447 return gdbarch->extra_stack_alignment_needed;
4448 }
4449
4450 void
4451 set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch,
4452 int extra_stack_alignment_needed)
4453 {
4454 gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed;
4455 }
4456
4457 int
4458 gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
4459 {
4460 gdb_assert (gdbarch != NULL);
4461 return gdbarch->reg_struct_has_addr != 0;
4462 }
4463
4464 int
4465 gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
4466 {
4467 gdb_assert (gdbarch != NULL);
4468 if (gdbarch->reg_struct_has_addr == 0)
4469 internal_error (__FILE__, __LINE__,
4470 "gdbarch: gdbarch_reg_struct_has_addr invalid");
4471 if (gdbarch_debug >= 2)
4472 fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n");
4473 return gdbarch->reg_struct_has_addr (gcc_p, type);
4474 }
4475
4476 void
4477 set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
4478 gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr)
4479 {
4480 gdbarch->reg_struct_has_addr = reg_struct_has_addr;
4481 }
4482
4483 int
4484 gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
4485 {
4486 gdb_assert (gdbarch != NULL);
4487 return gdbarch->save_dummy_frame_tos != 0;
4488 }
4489
4490 void
4491 gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
4492 {
4493 gdb_assert (gdbarch != NULL);
4494 if (gdbarch->save_dummy_frame_tos == 0)
4495 internal_error (__FILE__, __LINE__,
4496 "gdbarch: gdbarch_save_dummy_frame_tos invalid");
4497 if (gdbarch_debug >= 2)
4498 fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n");
4499 gdbarch->save_dummy_frame_tos (sp);
4500 }
4501
4502 void
4503 set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
4504 gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos)
4505 {
4506 gdbarch->save_dummy_frame_tos = save_dummy_frame_tos;
4507 }
4508
4509 int
4510 gdbarch_parm_boundary (struct gdbarch *gdbarch)
4511 {
4512 gdb_assert (gdbarch != NULL);
4513 if (gdbarch_debug >= 2)
4514 fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n");
4515 return gdbarch->parm_boundary;
4516 }
4517
4518 void
4519 set_gdbarch_parm_boundary (struct gdbarch *gdbarch,
4520 int parm_boundary)
4521 {
4522 gdbarch->parm_boundary = parm_boundary;
4523 }
4524
4525 const struct floatformat *
4526 gdbarch_float_format (struct gdbarch *gdbarch)
4527 {
4528 gdb_assert (gdbarch != NULL);
4529 if (gdbarch_debug >= 2)
4530 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
4531 return gdbarch->float_format;
4532 }
4533
4534 void
4535 set_gdbarch_float_format (struct gdbarch *gdbarch,
4536 const struct floatformat * float_format)
4537 {
4538 gdbarch->float_format = float_format;
4539 }
4540
4541 const struct floatformat *
4542 gdbarch_double_format (struct gdbarch *gdbarch)
4543 {
4544 gdb_assert (gdbarch != NULL);
4545 if (gdbarch_debug >= 2)
4546 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
4547 return gdbarch->double_format;
4548 }
4549
4550 void
4551 set_gdbarch_double_format (struct gdbarch *gdbarch,
4552 const struct floatformat * double_format)
4553 {
4554 gdbarch->double_format = double_format;
4555 }
4556
4557 const struct floatformat *
4558 gdbarch_long_double_format (struct gdbarch *gdbarch)
4559 {
4560 gdb_assert (gdbarch != NULL);
4561 if (gdbarch_debug >= 2)
4562 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
4563 return gdbarch->long_double_format;
4564 }
4565
4566 void
4567 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
4568 const struct floatformat * long_double_format)
4569 {
4570 gdbarch->long_double_format = long_double_format;
4571 }
4572
4573 CORE_ADDR
4574 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
4575 {
4576 gdb_assert (gdbarch != NULL);
4577 if (gdbarch->convert_from_func_ptr_addr == 0)
4578 internal_error (__FILE__, __LINE__,
4579 "gdbarch: gdbarch_convert_from_func_ptr_addr invalid");
4580 if (gdbarch_debug >= 2)
4581 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
4582 return gdbarch->convert_from_func_ptr_addr (addr);
4583 }
4584
4585 void
4586 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
4587 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
4588 {
4589 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
4590 }
4591
4592 CORE_ADDR
4593 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
4594 {
4595 gdb_assert (gdbarch != NULL);
4596 if (gdbarch->addr_bits_remove == 0)
4597 internal_error (__FILE__, __LINE__,
4598 "gdbarch: gdbarch_addr_bits_remove invalid");
4599 if (gdbarch_debug >= 2)
4600 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
4601 return gdbarch->addr_bits_remove (addr);
4602 }
4603
4604 void
4605 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
4606 gdbarch_addr_bits_remove_ftype addr_bits_remove)
4607 {
4608 gdbarch->addr_bits_remove = addr_bits_remove;
4609 }
4610
4611 CORE_ADDR
4612 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
4613 {
4614 gdb_assert (gdbarch != NULL);
4615 if (gdbarch->smash_text_address == 0)
4616 internal_error (__FILE__, __LINE__,
4617 "gdbarch: gdbarch_smash_text_address invalid");
4618 if (gdbarch_debug >= 2)
4619 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
4620 return gdbarch->smash_text_address (addr);
4621 }
4622
4623 void
4624 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
4625 gdbarch_smash_text_address_ftype smash_text_address)
4626 {
4627 gdbarch->smash_text_address = smash_text_address;
4628 }
4629
4630 int
4631 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
4632 {
4633 gdb_assert (gdbarch != NULL);
4634 return gdbarch->software_single_step != 0;
4635 }
4636
4637 void
4638 gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
4639 {
4640 gdb_assert (gdbarch != NULL);
4641 if (gdbarch->software_single_step == 0)
4642 internal_error (__FILE__, __LINE__,
4643 "gdbarch: gdbarch_software_single_step invalid");
4644 if (gdbarch_debug >= 2)
4645 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
4646 gdbarch->software_single_step (sig, insert_breakpoints_p);
4647 }
4648
4649 void
4650 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
4651 gdbarch_software_single_step_ftype software_single_step)
4652 {
4653 gdbarch->software_single_step = software_single_step;
4654 }
4655
4656 int
4657 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info)
4658 {
4659 gdb_assert (gdbarch != NULL);
4660 if (gdbarch->print_insn == 0)
4661 internal_error (__FILE__, __LINE__,
4662 "gdbarch: gdbarch_print_insn invalid");
4663 if (gdbarch_debug >= 2)
4664 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
4665 return gdbarch->print_insn (vma, info);
4666 }
4667
4668 void
4669 set_gdbarch_print_insn (struct gdbarch *gdbarch,
4670 gdbarch_print_insn_ftype print_insn)
4671 {
4672 gdbarch->print_insn = print_insn;
4673 }
4674
4675 CORE_ADDR
4676 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
4677 {
4678 gdb_assert (gdbarch != NULL);
4679 if (gdbarch->skip_trampoline_code == 0)
4680 internal_error (__FILE__, __LINE__,
4681 "gdbarch: gdbarch_skip_trampoline_code invalid");
4682 if (gdbarch_debug >= 2)
4683 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
4684 return gdbarch->skip_trampoline_code (pc);
4685 }
4686
4687 void
4688 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
4689 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
4690 {
4691 gdbarch->skip_trampoline_code = skip_trampoline_code;
4692 }
4693
4694 int
4695 gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
4696 {
4697 gdb_assert (gdbarch != NULL);
4698 if (gdbarch->in_solib_call_trampoline == 0)
4699 internal_error (__FILE__, __LINE__,
4700 "gdbarch: gdbarch_in_solib_call_trampoline invalid");
4701 if (gdbarch_debug >= 2)
4702 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_call_trampoline called\n");
4703 return gdbarch->in_solib_call_trampoline (pc, name);
4704 }
4705
4706 void
4707 set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
4708 gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline)
4709 {
4710 gdbarch->in_solib_call_trampoline = in_solib_call_trampoline;
4711 }
4712
4713 int
4714 gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
4715 {
4716 gdb_assert (gdbarch != NULL);
4717 if (gdbarch->pc_in_sigtramp == 0)
4718 internal_error (__FILE__, __LINE__,
4719 "gdbarch: gdbarch_pc_in_sigtramp invalid");
4720 if (gdbarch_debug >= 2)
4721 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_sigtramp called\n");
4722 return gdbarch->pc_in_sigtramp (pc, name);
4723 }
4724
4725 void
4726 set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch,
4727 gdbarch_pc_in_sigtramp_ftype pc_in_sigtramp)
4728 {
4729 gdbarch->pc_in_sigtramp = pc_in_sigtramp;
4730 }
4731
4732 int
4733 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
4734 {
4735 gdb_assert (gdbarch != NULL);
4736 if (gdbarch->in_function_epilogue_p == 0)
4737 internal_error (__FILE__, __LINE__,
4738 "gdbarch: gdbarch_in_function_epilogue_p invalid");
4739 if (gdbarch_debug >= 2)
4740 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
4741 return gdbarch->in_function_epilogue_p (gdbarch, addr);
4742 }
4743
4744 void
4745 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
4746 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
4747 {
4748 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
4749 }
4750
4751 char *
4752 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
4753 {
4754 gdb_assert (gdbarch != NULL);
4755 if (gdbarch->construct_inferior_arguments == 0)
4756 internal_error (__FILE__, __LINE__,
4757 "gdbarch: gdbarch_construct_inferior_arguments invalid");
4758 if (gdbarch_debug >= 2)
4759 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
4760 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
4761 }
4762
4763 void
4764 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
4765 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
4766 {
4767 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
4768 }
4769
4770 int
4771 gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch)
4772 {
4773 gdb_assert (gdbarch != NULL);
4774 return gdbarch->dwarf2_build_frame_info != 0;
4775 }
4776
4777 void
4778 gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile)
4779 {
4780 gdb_assert (gdbarch != NULL);
4781 if (gdbarch->dwarf2_build_frame_info == 0)
4782 internal_error (__FILE__, __LINE__,
4783 "gdbarch: gdbarch_dwarf2_build_frame_info invalid");
4784 if (gdbarch_debug >= 2)
4785 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_build_frame_info called\n");
4786 gdbarch->dwarf2_build_frame_info (objfile);
4787 }
4788
4789 void
4790 set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch,
4791 gdbarch_dwarf2_build_frame_info_ftype dwarf2_build_frame_info)
4792 {
4793 gdbarch->dwarf2_build_frame_info = dwarf2_build_frame_info;
4794 }
4795
4796 void
4797 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
4798 {
4799 gdb_assert (gdbarch != NULL);
4800 if (gdbarch->elf_make_msymbol_special == 0)
4801 internal_error (__FILE__, __LINE__,
4802 "gdbarch: gdbarch_elf_make_msymbol_special invalid");
4803 if (gdbarch_debug >= 2)
4804 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
4805 gdbarch->elf_make_msymbol_special (sym, msym);
4806 }
4807
4808 void
4809 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
4810 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
4811 {
4812 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
4813 }
4814
4815 void
4816 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
4817 {
4818 gdb_assert (gdbarch != NULL);
4819 if (gdbarch->coff_make_msymbol_special == 0)
4820 internal_error (__FILE__, __LINE__,
4821 "gdbarch: gdbarch_coff_make_msymbol_special invalid");
4822 if (gdbarch_debug >= 2)
4823 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
4824 gdbarch->coff_make_msymbol_special (val, msym);
4825 }
4826
4827 void
4828 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
4829 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
4830 {
4831 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
4832 }
4833
4834
4835 /* Keep a registry of per-architecture data-pointers required by GDB
4836 modules. */
4837
4838 struct gdbarch_data
4839 {
4840 unsigned index;
4841 int init_p;
4842 gdbarch_data_init_ftype *init;
4843 gdbarch_data_free_ftype *free;
4844 };
4845
4846 struct gdbarch_data_registration
4847 {
4848 struct gdbarch_data *data;
4849 struct gdbarch_data_registration *next;
4850 };
4851
4852 struct gdbarch_data_registry
4853 {
4854 unsigned nr;
4855 struct gdbarch_data_registration *registrations;
4856 };
4857
4858 struct gdbarch_data_registry gdbarch_data_registry =
4859 {
4860 0, NULL,
4861 };
4862
4863 struct gdbarch_data *
4864 register_gdbarch_data (gdbarch_data_init_ftype *init,
4865 gdbarch_data_free_ftype *free)
4866 {
4867 struct gdbarch_data_registration **curr;
4868 /* Append the new registraration. */
4869 for (curr = &gdbarch_data_registry.registrations;
4870 (*curr) != NULL;
4871 curr = &(*curr)->next);
4872 (*curr) = XMALLOC (struct gdbarch_data_registration);
4873 (*curr)->next = NULL;
4874 (*curr)->data = XMALLOC (struct gdbarch_data);
4875 (*curr)->data->index = gdbarch_data_registry.nr++;
4876 (*curr)->data->init = init;
4877 (*curr)->data->init_p = 1;
4878 (*curr)->data->free = free;
4879 return (*curr)->data;
4880 }
4881
4882
4883 /* Create/delete the gdbarch data vector. */
4884
4885 static void
4886 alloc_gdbarch_data (struct gdbarch *gdbarch)
4887 {
4888 gdb_assert (gdbarch->data == NULL);
4889 gdbarch->nr_data = gdbarch_data_registry.nr;
4890 gdbarch->data = xcalloc (gdbarch->nr_data, sizeof (void*));
4891 }
4892
4893 static void
4894 free_gdbarch_data (struct gdbarch *gdbarch)
4895 {
4896 struct gdbarch_data_registration *rego;
4897 gdb_assert (gdbarch->data != NULL);
4898 for (rego = gdbarch_data_registry.registrations;
4899 rego != NULL;
4900 rego = rego->next)
4901 {
4902 struct gdbarch_data *data = rego->data;
4903 gdb_assert (data->index < gdbarch->nr_data);
4904 if (data->free != NULL && gdbarch->data[data->index] != NULL)
4905 {
4906 data->free (gdbarch, gdbarch->data[data->index]);
4907 gdbarch->data[data->index] = NULL;
4908 }
4909 }
4910 xfree (gdbarch->data);
4911 gdbarch->data = NULL;
4912 }
4913
4914
4915 /* Initialize the current value of the specified per-architecture
4916 data-pointer. */
4917
4918 void
4919 set_gdbarch_data (struct gdbarch *gdbarch,
4920 struct gdbarch_data *data,
4921 void *pointer)
4922 {
4923 gdb_assert (data->index < gdbarch->nr_data);
4924 if (gdbarch->data[data->index] != NULL)
4925 {
4926 gdb_assert (data->free != NULL);
4927 data->free (gdbarch, gdbarch->data[data->index]);
4928 }
4929 gdbarch->data[data->index] = pointer;
4930 }
4931
4932 /* Return the current value of the specified per-architecture
4933 data-pointer. */
4934
4935 void *
4936 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
4937 {
4938 gdb_assert (data->index < gdbarch->nr_data);
4939 /* The data-pointer isn't initialized, call init() to get a value but
4940 only if the architecture initializaiton has completed. Otherwise
4941 punt - hope that the caller knows what they are doing. */
4942 if (gdbarch->data[data->index] == NULL
4943 && gdbarch->initialized_p)
4944 {
4945 /* Be careful to detect an initialization cycle. */
4946 gdb_assert (data->init_p);
4947 data->init_p = 0;
4948 gdb_assert (data->init != NULL);
4949 gdbarch->data[data->index] = data->init (gdbarch);
4950 data->init_p = 1;
4951 gdb_assert (gdbarch->data[data->index] != NULL);
4952 }
4953 return gdbarch->data[data->index];
4954 }
4955
4956
4957
4958 /* Keep a registry of swapped data required by GDB modules. */
4959
4960 struct gdbarch_swap
4961 {
4962 void *swap;
4963 struct gdbarch_swap_registration *source;
4964 struct gdbarch_swap *next;
4965 };
4966
4967 struct gdbarch_swap_registration
4968 {
4969 void *data;
4970 unsigned long sizeof_data;
4971 gdbarch_swap_ftype *init;
4972 struct gdbarch_swap_registration *next;
4973 };
4974
4975 struct gdbarch_swap_registry
4976 {
4977 int nr;
4978 struct gdbarch_swap_registration *registrations;
4979 };
4980
4981 struct gdbarch_swap_registry gdbarch_swap_registry =
4982 {
4983 0, NULL,
4984 };
4985
4986 void
4987 register_gdbarch_swap (void *data,
4988 unsigned long sizeof_data,
4989 gdbarch_swap_ftype *init)
4990 {
4991 struct gdbarch_swap_registration **rego;
4992 for (rego = &gdbarch_swap_registry.registrations;
4993 (*rego) != NULL;
4994 rego = &(*rego)->next);
4995 (*rego) = XMALLOC (struct gdbarch_swap_registration);
4996 (*rego)->next = NULL;
4997 (*rego)->init = init;
4998 (*rego)->data = data;
4999 (*rego)->sizeof_data = sizeof_data;
5000 }
5001
5002 static void
5003 clear_gdbarch_swap (struct gdbarch *gdbarch)
5004 {
5005 struct gdbarch_swap *curr;
5006 for (curr = gdbarch->swap;
5007 curr != NULL;
5008 curr = curr->next)
5009 {
5010 memset (curr->source->data, 0, curr->source->sizeof_data);
5011 }
5012 }
5013
5014 static void
5015 init_gdbarch_swap (struct gdbarch *gdbarch)
5016 {
5017 struct gdbarch_swap_registration *rego;
5018 struct gdbarch_swap **curr = &gdbarch->swap;
5019 for (rego = gdbarch_swap_registry.registrations;
5020 rego != NULL;
5021 rego = rego->next)
5022 {
5023 if (rego->data != NULL)
5024 {
5025 (*curr) = XMALLOC (struct gdbarch_swap);
5026 (*curr)->source = rego;
5027 (*curr)->swap = xmalloc (rego->sizeof_data);
5028 (*curr)->next = NULL;
5029 curr = &(*curr)->next;
5030 }
5031 if (rego->init != NULL)
5032 rego->init ();
5033 }
5034 }
5035
5036 static void
5037 swapout_gdbarch_swap (struct gdbarch *gdbarch)
5038 {
5039 struct gdbarch_swap *curr;
5040 for (curr = gdbarch->swap;
5041 curr != NULL;
5042 curr = curr->next)
5043 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
5044 }
5045
5046 static void
5047 swapin_gdbarch_swap (struct gdbarch *gdbarch)
5048 {
5049 struct gdbarch_swap *curr;
5050 for (curr = gdbarch->swap;
5051 curr != NULL;
5052 curr = curr->next)
5053 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
5054 }
5055
5056
5057 /* Keep a registry of the architectures known by GDB. */
5058
5059 struct gdbarch_registration
5060 {
5061 enum bfd_architecture bfd_architecture;
5062 gdbarch_init_ftype *init;
5063 gdbarch_dump_tdep_ftype *dump_tdep;
5064 struct gdbarch_list *arches;
5065 struct gdbarch_registration *next;
5066 };
5067
5068 static struct gdbarch_registration *gdbarch_registry = NULL;
5069
5070 static void
5071 append_name (const char ***buf, int *nr, const char *name)
5072 {
5073 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
5074 (*buf)[*nr] = name;
5075 *nr += 1;
5076 }
5077
5078 const char **
5079 gdbarch_printable_names (void)
5080 {
5081 if (GDB_MULTI_ARCH)
5082 {
5083 /* Accumulate a list of names based on the registed list of
5084 architectures. */
5085 enum bfd_architecture a;
5086 int nr_arches = 0;
5087 const char **arches = NULL;
5088 struct gdbarch_registration *rego;
5089 for (rego = gdbarch_registry;
5090 rego != NULL;
5091 rego = rego->next)
5092 {
5093 const struct bfd_arch_info *ap;
5094 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
5095 if (ap == NULL)
5096 internal_error (__FILE__, __LINE__,
5097 "gdbarch_architecture_names: multi-arch unknown");
5098 do
5099 {
5100 append_name (&arches, &nr_arches, ap->printable_name);
5101 ap = ap->next;
5102 }
5103 while (ap != NULL);
5104 }
5105 append_name (&arches, &nr_arches, NULL);
5106 return arches;
5107 }
5108 else
5109 /* Just return all the architectures that BFD knows. Assume that
5110 the legacy architecture framework supports them. */
5111 return bfd_arch_list ();
5112 }
5113
5114
5115 void
5116 gdbarch_register (enum bfd_architecture bfd_architecture,
5117 gdbarch_init_ftype *init,
5118 gdbarch_dump_tdep_ftype *dump_tdep)
5119 {
5120 struct gdbarch_registration **curr;
5121 const struct bfd_arch_info *bfd_arch_info;
5122 /* Check that BFD recognizes this architecture */
5123 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
5124 if (bfd_arch_info == NULL)
5125 {
5126 internal_error (__FILE__, __LINE__,
5127 "gdbarch: Attempt to register unknown architecture (%d)",
5128 bfd_architecture);
5129 }
5130 /* Check that we haven't seen this architecture before */
5131 for (curr = &gdbarch_registry;
5132 (*curr) != NULL;
5133 curr = &(*curr)->next)
5134 {
5135 if (bfd_architecture == (*curr)->bfd_architecture)
5136 internal_error (__FILE__, __LINE__,
5137 "gdbarch: Duplicate registraration of architecture (%s)",
5138 bfd_arch_info->printable_name);
5139 }
5140 /* log it */
5141 if (gdbarch_debug)
5142 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
5143 bfd_arch_info->printable_name,
5144 (long) init);
5145 /* Append it */
5146 (*curr) = XMALLOC (struct gdbarch_registration);
5147 (*curr)->bfd_architecture = bfd_architecture;
5148 (*curr)->init = init;
5149 (*curr)->dump_tdep = dump_tdep;
5150 (*curr)->arches = NULL;
5151 (*curr)->next = NULL;
5152 /* When non- multi-arch, install whatever target dump routine we've
5153 been provided - hopefully that routine has been written correctly
5154 and works regardless of multi-arch. */
5155 if (!GDB_MULTI_ARCH && dump_tdep != NULL
5156 && startup_gdbarch.dump_tdep == NULL)
5157 startup_gdbarch.dump_tdep = dump_tdep;
5158 }
5159
5160 void
5161 register_gdbarch_init (enum bfd_architecture bfd_architecture,
5162 gdbarch_init_ftype *init)
5163 {
5164 gdbarch_register (bfd_architecture, init, NULL);
5165 }
5166
5167
5168 /* Look for an architecture using gdbarch_info. Base search on only
5169 BFD_ARCH_INFO and BYTE_ORDER. */
5170
5171 struct gdbarch_list *
5172 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
5173 const struct gdbarch_info *info)
5174 {
5175 for (; arches != NULL; arches = arches->next)
5176 {
5177 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
5178 continue;
5179 if (info->byte_order != arches->gdbarch->byte_order)
5180 continue;
5181 return arches;
5182 }
5183 return NULL;
5184 }
5185
5186
5187 /* Update the current architecture. Return ZERO if the update request
5188 failed. */
5189
5190 int
5191 gdbarch_update_p (struct gdbarch_info info)
5192 {
5193 struct gdbarch *new_gdbarch;
5194 struct gdbarch *old_gdbarch;
5195 struct gdbarch_registration *rego;
5196
5197 /* Fill in missing parts of the INFO struct using a number of
5198 sources: ``set ...''; INFOabfd supplied; existing target. */
5199
5200 /* ``(gdb) set architecture ...'' */
5201 if (info.bfd_arch_info == NULL
5202 && !TARGET_ARCHITECTURE_AUTO)
5203 info.bfd_arch_info = TARGET_ARCHITECTURE;
5204 if (info.bfd_arch_info == NULL
5205 && info.abfd != NULL
5206 && bfd_get_arch (info.abfd) != bfd_arch_unknown
5207 && bfd_get_arch (info.abfd) != bfd_arch_obscure)
5208 info.bfd_arch_info = bfd_get_arch_info (info.abfd);
5209 if (info.bfd_arch_info == NULL)
5210 info.bfd_arch_info = TARGET_ARCHITECTURE;
5211
5212 /* ``(gdb) set byte-order ...'' */
5213 if (info.byte_order == BFD_ENDIAN_UNKNOWN
5214 && !TARGET_BYTE_ORDER_AUTO)
5215 info.byte_order = TARGET_BYTE_ORDER;
5216 /* From the INFO struct. */
5217 if (info.byte_order == BFD_ENDIAN_UNKNOWN
5218 && info.abfd != NULL)
5219 info.byte_order = (bfd_big_endian (info.abfd) ? BFD_ENDIAN_BIG
5220 : bfd_little_endian (info.abfd) ? BFD_ENDIAN_LITTLE
5221 : BFD_ENDIAN_UNKNOWN);
5222 /* From the current target. */
5223 if (info.byte_order == BFD_ENDIAN_UNKNOWN)
5224 info.byte_order = TARGET_BYTE_ORDER;
5225
5226 /* Must have found some sort of architecture. */
5227 gdb_assert (info.bfd_arch_info != NULL);
5228
5229 if (gdbarch_debug)
5230 {
5231 fprintf_unfiltered (gdb_stdlog,
5232 "gdbarch_update: info.bfd_arch_info %s\n",
5233 (info.bfd_arch_info != NULL
5234 ? info.bfd_arch_info->printable_name
5235 : "(null)"));
5236 fprintf_unfiltered (gdb_stdlog,
5237 "gdbarch_update: info.byte_order %d (%s)\n",
5238 info.byte_order,
5239 (info.byte_order == BFD_ENDIAN_BIG ? "big"
5240 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
5241 : "default"));
5242 fprintf_unfiltered (gdb_stdlog,
5243 "gdbarch_update: info.abfd 0x%lx\n",
5244 (long) info.abfd);
5245 fprintf_unfiltered (gdb_stdlog,
5246 "gdbarch_update: info.tdep_info 0x%lx\n",
5247 (long) info.tdep_info);
5248 }
5249
5250 /* Find the target that knows about this architecture. */
5251 for (rego = gdbarch_registry;
5252 rego != NULL;
5253 rego = rego->next)
5254 if (rego->bfd_architecture == info.bfd_arch_info->arch)
5255 break;
5256 if (rego == NULL)
5257 {
5258 if (gdbarch_debug)
5259 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n");
5260 return 0;
5261 }
5262
5263 /* Swap the data belonging to the old target out setting the
5264 installed data to zero. This stops the ->init() function trying
5265 to refer to the previous architecture's global data structures. */
5266 swapout_gdbarch_swap (current_gdbarch);
5267 clear_gdbarch_swap (current_gdbarch);
5268
5269 /* Save the previously selected architecture, setting the global to
5270 NULL. This stops ->init() trying to use the previous
5271 architecture's configuration. The previous architecture may not
5272 even be of the same architecture family. The most recent
5273 architecture of the same family is found at the head of the
5274 rego->arches list. */
5275 old_gdbarch = current_gdbarch;
5276 current_gdbarch = NULL;
5277
5278 /* Ask the target for a replacement architecture. */
5279 new_gdbarch = rego->init (info, rego->arches);
5280
5281 /* Did the target like it? No. Reject the change and revert to the
5282 old architecture. */
5283 if (new_gdbarch == NULL)
5284 {
5285 if (gdbarch_debug)
5286 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n");
5287 swapin_gdbarch_swap (old_gdbarch);
5288 current_gdbarch = old_gdbarch;
5289 return 0;
5290 }
5291
5292 /* Did the architecture change? No. Oops, put the old architecture
5293 back. */
5294 if (old_gdbarch == new_gdbarch)
5295 {
5296 if (gdbarch_debug)
5297 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
5298 (long) new_gdbarch,
5299 new_gdbarch->bfd_arch_info->printable_name);
5300 swapin_gdbarch_swap (old_gdbarch);
5301 current_gdbarch = old_gdbarch;
5302 return 1;
5303 }
5304
5305 /* Is this a pre-existing architecture? Yes. Move it to the front
5306 of the list of architectures (keeping the list sorted Most
5307 Recently Used) and then copy it in. */
5308 {
5309 struct gdbarch_list **list;
5310 for (list = &rego->arches;
5311 (*list) != NULL;
5312 list = &(*list)->next)
5313 {
5314 if ((*list)->gdbarch == new_gdbarch)
5315 {
5316 struct gdbarch_list *this;
5317 if (gdbarch_debug)
5318 fprintf_unfiltered (gdb_stdlog,
5319 "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
5320 (long) new_gdbarch,
5321 new_gdbarch->bfd_arch_info->printable_name);
5322 /* Unlink this. */
5323 this = (*list);
5324 (*list) = this->next;
5325 /* Insert in the front. */
5326 this->next = rego->arches;
5327 rego->arches = this;
5328 /* Copy the new architecture in. */
5329 current_gdbarch = new_gdbarch;
5330 swapin_gdbarch_swap (new_gdbarch);
5331 architecture_changed_event ();
5332 return 1;
5333 }
5334 }
5335 }
5336
5337 /* Prepend this new architecture to the architecture list (keep the
5338 list sorted Most Recently Used). */
5339 {
5340 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
5341 this->next = rego->arches;
5342 this->gdbarch = new_gdbarch;
5343 rego->arches = this;
5344 }
5345
5346 /* Switch to this new architecture marking it initialized. */
5347 current_gdbarch = new_gdbarch;
5348 current_gdbarch->initialized_p = 1;
5349 if (gdbarch_debug)
5350 {
5351 fprintf_unfiltered (gdb_stdlog,
5352 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
5353 (long) new_gdbarch,
5354 new_gdbarch->bfd_arch_info->printable_name);
5355 }
5356
5357 /* Check that the newly installed architecture is valid. Plug in
5358 any post init values. */
5359 new_gdbarch->dump_tdep = rego->dump_tdep;
5360 verify_gdbarch (new_gdbarch);
5361
5362 /* Initialize the per-architecture memory (swap) areas.
5363 CURRENT_GDBARCH must be update before these modules are
5364 called. */
5365 init_gdbarch_swap (new_gdbarch);
5366
5367 /* Initialize the per-architecture data. CURRENT_GDBARCH
5368 must be updated before these modules are called. */
5369 architecture_changed_event ();
5370
5371 if (gdbarch_debug)
5372 gdbarch_dump (current_gdbarch, gdb_stdlog);
5373
5374 return 1;
5375 }
5376
5377
5378 /* Disassembler */
5379
5380 /* Pointer to the target-dependent disassembly function. */
5381 int (*tm_print_insn) (bfd_vma, disassemble_info *);
5382 disassemble_info tm_print_insn_info;
5383
5384
5385 extern void _initialize_gdbarch (void);
5386
5387 void
5388 _initialize_gdbarch (void)
5389 {
5390 struct cmd_list_element *c;
5391
5392 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
5393 tm_print_insn_info.flavour = bfd_target_unknown_flavour;
5394 tm_print_insn_info.read_memory_func = dis_asm_read_memory;
5395 tm_print_insn_info.memory_error_func = dis_asm_memory_error;
5396 tm_print_insn_info.print_address_func = dis_asm_print_address;
5397
5398 add_show_from_set (add_set_cmd ("arch",
5399 class_maintenance,
5400 var_zinteger,
5401 (char *)&gdbarch_debug,
5402 "Set architecture debugging.\n\
5403 When non-zero, architecture debugging is enabled.", &setdebuglist),
5404 &showdebuglist);
5405 c = add_set_cmd ("archdebug",
5406 class_maintenance,
5407 var_zinteger,
5408 (char *)&gdbarch_debug,
5409 "Set architecture debugging.\n\
5410 When non-zero, architecture debugging is enabled.", &setlist);
5411
5412 deprecate_cmd (c, "set debug arch");
5413 deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch");
5414 }
This page took 0.145505 seconds and 4 git commands to generate.