1 /* This file is part of the program psim.
3 Copyright (C) 1994-1997, 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"
57 trace_register_device
,
60 trace_disklabel_package
,
77 trace_print_device_tree
,
78 trace_dump_device_tree
,
84 extern int ppc_trace
[nr_trace_options
];
87 #define TRACE(OBJECT, ARGS) \
90 if (ppc_trace[OBJECT]) { \
91 printf_filtered("%s:%d: ", filter_filename(__FILE__), __LINE__); \
92 printf_filtered ARGS; \
98 #define ITRACE(OBJECT, ARGS) \
101 if (ppc_trace[OBJECT]) { \
102 printf_filtered("%s:%d:0x%08lx:%s ", itable[MY_INDEX].file, itable[MY_INDEX].line_nr, (long)cia, itable[MY_INDEX].name); \
103 printf_filtered ARGS; \
109 #define DTRACE(OBJECT, ARGS) \
112 int trace_device = device_trace(me); \
113 if (ppc_trace[trace_devices] \
114 || ppc_trace[trace_##OBJECT##_device] \
116 printf_filtered("%s:%d:%s:%s%s ", \
117 filter_filename(__FILE__), __LINE__, #OBJECT, \
118 trace_device ? device_path(me) : "", \
119 trace_device ? ":" : ""); \
120 printf_filtered ARGS; \
125 /* device instance */
126 #define DITRACE(OBJECT, ARGS) \
129 device *me = device_instance_device(instance); \
130 int trace_device = device_trace(me); \
131 if (ppc_trace[trace_devices] \
132 || ppc_trace[trace_##OBJECT##_device] \
134 printf_filtered("%s:%d:%s:%s%s ", \
135 filter_filename(__FILE__), __LINE__, #OBJECT, \
136 trace_device ? device_path(me) : "", \
137 trace_device ? ":" : ""); \
138 printf_filtered ARGS; \
144 #define PTRACE(OBJECT, ARGS) \
147 if (ppc_trace[trace_##OBJECT##_package]) { \
148 printf_filtered("%s:%d:%s: ", filter_filename(__FILE__), __LINE__, #OBJECT); \
149 printf_filtered ARGS; \
155 #define ASSERT(EXPRESSION) \
158 if (!(EXPRESSION)) { \
159 error("%s:%d: assertion failed - %s\n", \
160 filter_filename(__FILE__), __LINE__, #EXPRESSION); \
165 /* Parse OPTION updating the trace array */
167 trace_option(const char *option
, int setting
);
169 /* Output the list of trace options */
170 extern void trace_usage
174 #endif /* _DEBUG_H_ */
This page took 0.045229 seconds and 4 git commands to generate.