Commit | Line | Data |
---|---|---|
c906108c SS |
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 | ||
c906108c SS |
23 | /* The target-system-dependant byte order is dynamic */ |
24 | ||
25 | /* TARGET_BYTE_ORDER_SELECTABLE_P determines if the target endianness | |
26 | is selectable at runtime. The user can use the `set endian' | |
27 | command to change it. TARGET_BYTE_ORDER_AUTO is nonzero when | |
28 | target_byte_order should be auto-detected (from the program image | |
29 | say). */ | |
30 | ||
31 | #ifndef TARGET_BYTE_ORDER_SELECTABLE_P | |
32 | /* compat - Catch old targets that define TARGET_BYTE_ORDER_SLECTABLE | |
33 | when they should have defined TARGET_BYTE_ORDER_SELECTABLE_P 1 */ | |
34 | #ifdef TARGET_BYTE_ORDER_SELECTABLE | |
35 | #define TARGET_BYTE_ORDER_SELECTABLE_P 1 | |
36 | #else | |
37 | #define TARGET_BYTE_ORDER_SELECTABLE_P 0 | |
38 | #endif | |
39 | #endif | |
40 | ||
41 | extern int target_byte_order; | |
42 | #ifdef TARGET_BYTE_ORDER_SELECTABLE | |
43 | /* compat - Catch old targets that define TARGET_BYTE_ORDER_SELECTABLE | |
44 | and expect defs.h to re-define TARGET_BYTE_ORDER. */ | |
45 | #undef TARGET_BYTE_ORDER | |
46 | #endif | |
47 | #ifndef TARGET_BYTE_ORDER | |
48 | #define TARGET_BYTE_ORDER (target_byte_order + 0) | |
49 | #endif | |
50 | ||
51 | extern int target_byte_order_auto; | |
52 | #ifndef TARGET_BYTE_ORDER_AUTO | |
53 | #define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0) | |
54 | #endif | |
55 | ||
56 | ||
57 | ||
58 | /* The target-system-dependant BFD architecture is dynamic */ | |
59 | ||
60 | extern int target_architecture_auto; | |
61 | #ifndef TARGET_ARCHITECTURE_AUTO | |
62 | #define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0) | |
63 | #endif | |
64 | ||
65 | extern const struct bfd_arch_info *target_architecture; | |
66 | #ifndef TARGET_ARCHITECTURE | |
67 | #define TARGET_ARCHITECTURE (target_architecture + 0) | |
68 | #endif | |
69 | ||
70 | /* Notify the target dependant backend of a change to the selected | |
71 | architecture. A zero return status indicates that the target did | |
72 | not like the change. */ | |
73 | ||
74 | extern int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *)); | |
75 | ||
76 | ||
77 | ||
78 | /* The target-system-dependant disassembler is semi-dynamic */ | |
79 | ||
80 | #include "dis-asm.h" /* Get defs for disassemble_info */ | |
81 | ||
82 | extern int dis_asm_read_memory PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, | |
83 | int len, disassemble_info *info)); | |
84 | ||
85 | extern void dis_asm_memory_error PARAMS ((int status, bfd_vma memaddr, | |
86 | disassemble_info *info)); | |
87 | ||
88 | extern void dis_asm_print_address PARAMS ((bfd_vma addr, | |
89 | disassemble_info *info)); | |
90 | ||
91 | extern int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info*)); | |
92 | extern disassemble_info tm_print_insn_info; | |
93 | #ifndef TARGET_PRINT_INSN | |
94 | #define TARGET_PRINT_INSN(vma, info) (*tm_print_insn) (vma, info) | |
95 | #endif | |
96 | #ifndef TARGET_PRINT_INSN_INFO | |
97 | #define TARGET_PRINT_INSN_INFO (&tm_print_insn_info) | |
98 | #endif | |
99 | ||
100 | ||
101 | ||
7a292a7a SS |
102 | /* Explicit test for D10V architecture. |
103 | USE of these macro's is *STRONGLY* discouraged. */ | |
104 | ||
105 | #define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v) | |
106 | #ifndef D10V_MAKE_DADDR | |
107 | #define D10V_MAKE_DADDR(X) (abort (), 0) | |
108 | #endif | |
109 | #ifndef D10V_MAKE_IADDR | |
110 | #define D10V_MAKE_IADDR(X) (abort (), 0) | |
111 | #endif | |
112 | ||
113 | ||
114 | ||
115 | ||
116 | ||
c906108c SS |
117 | /* Set the dynamic target-system-dependant parameters (architecture, |
118 | byte-order, ...) using information found in the BFD */ | |
119 | ||
120 | extern void set_gdbarch_from_file PARAMS ((bfd *)); | |
121 | ||
122 | ||
123 | /* Explicitly set the dynamic target-system-dependant parameters based | |
124 | on bfd_architecture and machine. */ | |
125 | ||
126 | extern void set_architecture_from_arch_mach PARAMS ((enum bfd_architecture, unsigned long)); | |
127 | ||
128 | ||
129 | /* gdbarch trace variable */ | |
130 | extern int gdbarch_debug; | |
131 | ||
132 | #endif |