1 /* Architecture commands for GDB, the GNU debugger.
2 Copyright 1998, Free Software Foundation, Inc.
4 This file is part of GDB.
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.
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.
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. */
24 /* The target-system-dependant byte order is dynamic */
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
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
38 #define TARGET_BYTE_ORDER_SELECTABLE_P 0
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
48 #ifndef TARGET_BYTE_ORDER
49 #define TARGET_BYTE_ORDER (target_byte_order + 0)
52 extern int target_byte_order_auto
;
53 #ifndef TARGET_BYTE_ORDER_AUTO
54 #define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0)
59 /* The target-system-dependant BFD architecture is dynamic */
61 extern int target_architecture_auto
;
62 #ifndef TARGET_ARCHITECTURE_AUTO
63 #define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0)
66 extern const struct bfd_arch_info
*target_architecture
;
67 #ifndef TARGET_ARCHITECTURE
68 #define TARGET_ARCHITECTURE (target_architecture + 0)
71 /* Notify the target dependant backend of a change to the selected
72 architecture. A zero return status indicates that the target did
73 not like the change. */
75 extern int (*target_architecture_hook
) PARAMS ((const struct bfd_arch_info
*));
79 /* The target-system-dependant disassembler is semi-dynamic */
81 #include "dis-asm.h" /* Get defs for disassemble_info */
83 extern int dis_asm_read_memory
PARAMS ((bfd_vma memaddr
, bfd_byte
*myaddr
,
84 int len
, disassemble_info
*info
));
86 extern void dis_asm_memory_error
PARAMS ((int status
, bfd_vma memaddr
,
87 disassemble_info
*info
));
89 extern void dis_asm_print_address
PARAMS ((bfd_vma addr
,
90 disassemble_info
*info
));
92 extern int (*tm_print_insn
) PARAMS ((bfd_vma
, disassemble_info
*));
93 extern disassemble_info tm_print_insn_info
;
94 #ifndef TARGET_PRINT_INSN
95 #define TARGET_PRINT_INSN(vma, info) (*tm_print_insn) (vma, info)
97 #ifndef TARGET_PRINT_INSN_INFO
98 #define TARGET_PRINT_INSN_INFO (&tm_print_insn_info)
103 /* Set the dynamic target-system-dependant parameters (architecture,
104 byte-order, ...) using information found in the BFD */
106 extern void set_gdbarch_from_file
PARAMS ((bfd
*));
109 /* Explicitly set the dynamic target-system-dependant parameters based
110 on bfd_architecture and machine. */
112 extern void set_architecture_from_arch_mach
PARAMS ((enum bfd_architecture
, unsigned long));
115 /* gdbarch trace variable */
116 extern int gdbarch_debug
;