import gdb-19990422 snapshot
[deliverable/binutils-gdb.git] / gdb / gdbarch.h
CommitLineData
c906108c
SS
1/* Architecture commands for GDB, the GNU debugger.
2 Copyright 1998, Free Software Foundation, Inc.
3
4This file is part of GDB.
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
18Foundation, 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 dynamic */
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
42extern 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
52extern 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
61extern int target_architecture_auto;
62#ifndef TARGET_ARCHITECTURE_AUTO
63#define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0)
64#endif
65
66extern const struct bfd_arch_info *target_architecture;
67#ifndef TARGET_ARCHITECTURE
68#define TARGET_ARCHITECTURE (target_architecture + 0)
69#endif
70
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. */
74
75extern int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *));
76
77
78
79/* The target-system-dependant disassembler is semi-dynamic */
80
81#include "dis-asm.h" /* Get defs for disassemble_info */
82
83extern int dis_asm_read_memory PARAMS ((bfd_vma memaddr, bfd_byte *myaddr,
84 int len, disassemble_info *info));
85
86extern void dis_asm_memory_error PARAMS ((int status, bfd_vma memaddr,
87 disassemble_info *info));
88
89extern void dis_asm_print_address PARAMS ((bfd_vma addr,
90 disassemble_info *info));
91
92extern int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info*));
93extern disassemble_info tm_print_insn_info;
94#ifndef TARGET_PRINT_INSN
95#define TARGET_PRINT_INSN(vma, info) (*tm_print_insn) (vma, info)
96#endif
97#ifndef TARGET_PRINT_INSN_INFO
98#define TARGET_PRINT_INSN_INFO (&tm_print_insn_info)
99#endif
100
101
102
103/* Set the dynamic target-system-dependant parameters (architecture,
104 byte-order, ...) using information found in the BFD */
105
106extern void set_gdbarch_from_file PARAMS ((bfd *));
107
108
109/* Explicitly set the dynamic target-system-dependant parameters based
110 on bfd_architecture and machine. */
111
112extern void set_architecture_from_arch_mach PARAMS ((enum bfd_architecture, unsigned long));
113
114
115/* gdbarch trace variable */
116extern int gdbarch_debug;
117
118#endif
This page took 0.042475 seconds and 4 git commands to generate.