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