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