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