CARP:
[binutils-gdb.git] / gdb / gdbarch.h
1 /* Architecture commands for GDB, the GNU debugger.
2 Copyright 1998, Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
19
20 #ifndef GDBARCH_H
21 #define GDBARCH_H
22
23
24 /* The target-system-dependant byte order is dynmaic */
25
26 /* TARGET_BYTE_ORDER_SELECTABLE_P determines if the target endianness
27 is selectable at runtime. The user can use the `set endian'
28 command to change it. TARGET_BYTE_ORDER_AUTO is nonzero when
29 target_byte_order should be auto-detected (from the program image
30 say). */
31
32 #ifndef TARGET_BYTE_ORDER_SELECTABLE_P
33 /* compat - Catch old targets that define TARGET_BYTE_ORDER_SLECTABLE
34 when they should have defined TARGET_BYTE_ORDER_SELECTABLE_P 1 */
35 #ifdef TARGET_BYTE_ORDER_SELECTABLE
36 #define TARGET_BYTE_ORDER_SELECTABLE_P 1
37 #else
38 #define TARGET_BYTE_ORDER_SELECTABLE_P 0
39 #endif
40 #endif
41
42 extern int target_byte_order;
43 #ifdef TARGET_BYTE_ORDER_SELECTABLE
44 /* compat - Catch old targets that define TARGET_BYTE_ORDER_SELECTABLE
45 and expect defs.h to re-define TARGET_BYTE_ORDER. */
46 #undef TARGET_BYTE_ORDER
47 #endif
48 #ifndef TARGET_BYTE_ORDER
49 #define TARGET_BYTE_ORDER (target_byte_order + 0)
50 #endif
51
52 extern int target_byte_order_auto;
53 #ifndef TARGET_BYTE_ORDER_AUTO
54 #define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0)
55 #endif
56
57
58
59 /* The target-system-dependant BFD architecture is dynamic */
60
61 extern int target_architecture_auto;
62 #define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0)
63
64 extern const bfd_arch_info_type *target_architecture;
65 #define TARGET_ARCHITECTURE (target_architecture + 0)
66
67 /* Notify the target dependant backend of a change to the selected
68 architecture. A zero return status indicates that the target did
69 not like the change. */
70
71 extern int (*target_architecture_hook) PARAMS ((const bfd_arch_info_type *));
72
73
74
75 /* The target-system-dependant disassembler is semi-dynamic */
76
77 #include "dis-asm.h" /* Get defs for disassemble_info */
78
79 extern int dis_asm_read_memory PARAMS ((bfd_vma memaddr, bfd_byte *myaddr,
80 int len, disassemble_info *info));
81
82 extern void dis_asm_memory_error PARAMS ((int status, bfd_vma memaddr,
83 disassemble_info *info));
84
85 extern void dis_asm_print_address PARAMS ((bfd_vma addr,
86 disassemble_info *info));
87
88 extern int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info*));
89 extern disassemble_info tm_print_insn_info;
90 #ifndef TARGET_PRINT_INSN
91 #define TARGET_PRINT_INSN(vma, info) (*tm_print_insn) (vma, info)
92 #endif
93 #ifndef TARGET_PRINT_INSN_INFO
94 #define TARGET_PRINT_INSN_INFO (&tm_print_insn_info)
95 #endif
96
97
98
99 /* Set the dynamic target-system-dependant parameters (architecture,
100 byte-order, ...) using information found in the BFD */
101
102 extern void set_gdbarch_from_file PARAMS ((bfd *));
103
104 /* Explicitly set the dynamic target-system-dependant parameters based
105 on bfd_architecture and machine. */
106
107 extern void set_architecture_from_arch_mach PARAMS ((enum bfd_architecture, unsigned long));
108
109 #endif