1 /* This file is part of the program psim.
3 Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #include "filter_filename.h"
40 trace_register_device
,
68 extern int ppc_trace
[nr_trace_options
];
71 #define TRACE(OBJECT, ARGS) \
73 if (ppc_trace[OBJECT]) { \
74 printf_filtered("%s:%d:%s: ", filter_filename(__FILE__), __LINE__, #OBJECT); \
75 printf_filtered ARGS; \
79 #define ITRACE(OBJECT, ARGS) \
81 if (ppc_trace[OBJECT]) { \
82 printf_filtered("%s:%d:0x%lx", my_prefix, (int)(cpu_nr(processor) + 1), (unsigned long)cia); \
83 printf_filtered ARGS; \
87 #define DTRACE(OBJECT, ARGS) \
89 if (ppc_trace[trace_devices] || ppc_trace[trace_##OBJECT##_device]) { \
90 printf_filtered("%s:%d:%s: ", filter_filename(__FILE__), __LINE__, #OBJECT); \
91 printf_filtered ARGS; \
95 #define TRACE(OBJECT, ARGS)
96 #define ITRACE(OBJECT, ARGS)
97 #define DTRACE(OBJECT, ARGS)
101 #define ASSERT(EXPRESSION) \
103 if (!(EXPRESSION)) { \
104 error("%s:%d: assertion failed - %s\n", \
105 filter_filename(__FILE__), __LINE__, #EXPRESSION); \
109 #define ASSERT(EXPRESSION)
112 /* Parse OPTION updating the trace array */
114 trace_option(const char *option
);
116 /* Output the list of trace options */
121 #endif /* _DEBUG_H_ */