ff28a6b57644fa82e8a31a6626b9199d7df0cbbe
[binutils-gdb.git] / sim / common / sim-trace.h
1 /* Simulator tracing/debugging support.
2 Copyright (C) 1997 Free Software Foundation, Inc.
3 Contributed by Cygnus Support.
4
5 This file is part of GDB, the GNU debugger.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20
21 /* This file is meant to be included by sim-basics.h. */
22
23 #ifndef SIM_TRACE_H
24 #define SIM_TRACE_H
25
26 /* forward reference */
27 struct _sim_cpu;
28
29 /* Tracing support. */
30
31 /* Return non-zero if tracing of IDX is enabled for CPU. */
32 #define TRACE_P(cpu,idx) \
33 ((WITH_TRACE & (1 << (idx))) != 0 \
34 && CPU_TRACE_FLAGS (cpu)[idx] != 0)
35
36 /* Non-zero if "--trace-insn" specified for CPU. */
37 #define TRACE_INSN_P(cpu) TRACE_P (cpu, TRACE_INSN_IDX)
38 /* Non-zero if "--trace-decode" specified for CPU. */
39 #define TRACE_DECODE_P(cpu) TRACE_P (cpu, TRACE_DECODE_IDX)
40
41 extern void trace_printf PARAMS ((struct _sim_cpu *, const char *, ...));
42
43 /* Debug support. */
44
45 /* Return non-zero if debugging of IDX for CPU is enabled. */
46 #define DEBUG_P(cpu, idx) \
47 ((WITH_DEBUG & (1 << (idx))) != 0 \
48 && CPU_DEBUG_FLAGS (cpu)[idx] != 0)
49
50 /* Non-zero if "--debug-insn" specified. */
51 #define DEBUG_INSN_P(cpu) DEBUG_P (cpu, DEBUG_INSN_IDX)
52
53 extern void debug_printf PARAMS ((struct _sim_cpu *, const char *, ...));
54
55 #endif /* SIM_TRACE_H */