* readelf.c (process_relocs): Determine type of reloc from
[deliverable/binutils-gdb.git] / gdb / gdbarch.h
CommitLineData
c906108c 1/* Architecture commands for GDB, the GNU debugger.
b83266a0 2 Copyright 1998-1999, Free Software Foundation, Inc.
c906108c
SS
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
c906108c
SS
23/* The target-system-dependant byte order is dynamic */
24
25/* TARGET_BYTE_ORDER_SELECTABLE_P determines if the target endianness
b83266a0 26 is selectable at runtime. The user can use the ``set endian''
c906108c
SS
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
41extern 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
51extern 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
60extern int target_architecture_auto;
61#ifndef TARGET_ARCHITECTURE_AUTO
62#define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0)
63#endif
64
65extern 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
74extern 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
82extern int dis_asm_read_memory PARAMS ((bfd_vma memaddr, bfd_byte *myaddr,
83 int len, disassemble_info *info));
84
85extern void dis_asm_memory_error PARAMS ((int status, bfd_vma memaddr,
86 disassemble_info *info));
87
88extern void dis_asm_print_address PARAMS ((bfd_vma addr,
89 disassemble_info *info));
90
91extern int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info*));
92extern 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
392a587b
JM
114/* Fallback definition of FRAMELESS_FUNCTION_INVOCATION */
115#ifndef FRAMELESS_FUNCTION_INVOCATION
116#define FRAMELESS_FUNCTION_INVOCATION(FI) (0)
117#endif
118
7a292a7a 119
392a587b
JM
120/* Fallback definition of REGISTER_CONVERTIBLE etc */
121#ifndef REGISTER_CONVERTIBLE
122#define REGISTER_CONVERTIBLE(x) (0)
123#endif
124#ifndef REGISTER_CONVERT_TO_VIRTUAL
125#define REGISTER_CONVERT_TO_VIRTUAL(x, y, z, a)
126#endif
127#ifndef REGISTER_CONVERT_TO_RAW
128#define REGISTER_CONVERT_TO_RAW(x, y, z, a)
129#endif
7a292a7a
SS
130
131
c906108c
SS
132/* Set the dynamic target-system-dependant parameters (architecture,
133 byte-order, ...) using information found in the BFD */
134
135extern void set_gdbarch_from_file PARAMS ((bfd *));
136
137
138/* Explicitly set the dynamic target-system-dependant parameters based
139 on bfd_architecture and machine. */
140
141extern void set_architecture_from_arch_mach PARAMS ((enum bfd_architecture, unsigned long));
142
143
144/* gdbarch trace variable */
145extern int gdbarch_debug;
146
147#endif
This page took 0.031778 seconds and 4 git commands to generate.