1 /* Simulator tracing/debugging support.
2 Copyright (C) 1997 Free Software Foundation, Inc.
3 Contributed by Cygnus Support.
5 This file is part of GDB, the GNU debugger.
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)
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.
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. */
21 /* This file is meant to be included by sim-basics.h. */
26 /* Tracing support. */
30 /* Return non-zero if tracing of IDX is enabled for CPU. */
31 #define TRACE_P(cpu,idx) \
32 ((WITH_TRACE & (1 << (idx))) != 0 \
33 && CPU_TRACE_FLAGS (cpu)[idx] != 0)
35 /* Non-zero if "--trace-insn" specified for CPU. */
36 #define TRACE_INSN_P(cpu) TRACE_P (cpu, TRACE_INSN_IDX)
38 #define TRACE_PRINTF(cpu, idx, args) \
40 if ((WITH_TRACE & (1 << (idx))) != 0 \
41 && CPU_TRACE_FLAGS (cpu)[idx] != 0) \
47 /* Fetch current tracing flags. */
48 #define CURRENT_TRACE_FLAGS CPU_TRACE_FLAGS (& CURRENT_STATE->cpu)
50 /* Return non-zero if tracing of IDX is enabled. */
51 #define TRACE_P(idx) \
52 ((WITH_TRACE & (1 << (idx))) != 0 \
53 && CURRENT_TRACE_FLAGS[idx] != 0)
55 /* Non-zero if "--trace-insn" specified. */
56 #define TRACE_INSN_P TRACE_P (TRACE_INSN_IDX)
58 #define TRACE_PRINTF(idx, args) \
60 if ((WITH_TRACE & (1 << (idx))) != 0 \
61 && CURRENT_TRACE_FLAGS[idx] != 0) \
67 extern void trace_printf
PARAMS ((char *, ...));
73 /* Return non-zero if debugging of IDX for CPU is enabled. */
74 #define DEBUG_P(cpu, idx) \
75 ((WITH_DEBUG & (1 << (idx))) != 0 \
76 && CPU_DEBUG_FLAGS (cpu)[idx] != 0)
78 /* Non-zero if "--debug-insn" specified. */
79 #define DEBUG_INSN_P(cpu) DEBUG_P (cpu, DEBUG_INSN_IDX)
81 #define DEBUG_PRINTF(cpu, idx, args) \
83 if ((WITH_DEBUG & (1 << (idx))) != 0 \
84 && CPU_DEBUG_FLAGS (cpu)[idx] != 0) \
90 /* Fetch current debugging flags. */
91 #define CURRENT_DEBUG_FLAGS CPU_DEBUG_FLAGS (& CURRENT_STATE->cpu)
93 /* Return non-zero if debugging of IDX is enabled. */
94 #define DEBUG_P(idx) \
95 ((WITH_DEBUG & (1 << (idx))) != 0 \
96 && CURRENT_DEBUG_FLAGS[idx] != 0)
98 /* Non-zero if "--debug-insn" specified. */
99 #define DEBUG_INSN_P DEBUG_P (DEBUG_INSN_IDX)
101 #define DEBUG_PRINTF(idx, args) \
103 if ((WITH_DEBUG & (1 << (idx))) != 0 \
104 && CURRENT_DEBUG_FLAGS[idx] != 0) \
108 #endif /* MAX_CPUS */
110 extern void debug_printf
PARAMS ((char *, ...));
112 #endif /* SIM_TRACE_H */