]>
Commit | Line | Data |
---|---|---|
4659e3b3 | 1 | |
27e81a4e DP |
2 | /* Debug macros for development. |
3 | Copyright 1997 | |
4 | Free Software Foundation, Inc. | |
5 | ||
6 | This file is part of GDB. | |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 2 of the License, or | |
11 | (at your option) any later version. | |
12 | ||
13 | This program is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with this program; if not, write to the Free Software | |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
21 | ||
4659e3b3 DP |
22 | #ifndef _DEBUGIFY_H_ |
23 | #define _DEBUGIFY_H_ | |
24 | ||
8662603f DP |
25 | #include "ansidecl.h" |
26 | ||
27 | #ifdef ANSI_PROTOTYPES | |
28 | #include <stdarg.h> | |
29 | #else | |
30 | #include <varargs.h> | |
31 | #endif | |
32 | ||
4659e3b3 DP |
33 | #ifdef DEBUGIFY |
34 | #include <assert.h> | |
35 | #ifdef TO_SCREEN | |
8662603f | 36 | #ifdef _Win32 |
4659e3b3 | 37 | #define DBG(x) OutputDebugString x |
8662603f DP |
38 | #else |
39 | #define DBG(x) printf x | |
40 | #endif | |
4659e3b3 DP |
41 | #elif TO_GDB |
42 | #define DBG(x) printf_unfiltered x | |
43 | #elif TO_POPUP | |
8662603f | 44 | #ifdef _Win32 |
4659e3b3 | 45 | #define DBG(x) MessageBox x |
8662603f DP |
46 | #else |
47 | #define DBG(x) printf x | |
48 | #endif | |
4659e3b3 DP |
49 | #else /* default: TO_FILE "gdb.log" */ |
50 | #define DBG(x) printf_dbg x | |
27e81a4e | 51 | #endif |
4659e3b3 DP |
52 | |
53 | #define ASSERT(x) assert(x) | |
54 | ||
55 | #else /* DEBUGIFY */ | |
56 | #define DBG(x) | |
57 | #define ASSERT(x) | |
58 | #endif | |
59 | ||
60 | #ifdef __cplusplus | |
27e81a4e DP |
61 | extern "C" |
62 | { | |
4659e3b3 DP |
63 | #endif |
64 | ||
65 | #ifdef REDIRECT | |
66 | #define printf_unfiltered printf_dbg | |
67 | #define fputs_unfiltered fputs_dbg | |
27e81a4e | 68 | extern void fputs_dbg PARAMS ((const char *fmt, FILE * fakestream)); |
4659e3b3 DP |
69 | #endif /* REDIRECT */ |
70 | ||
27e81a4e | 71 | extern void puts_dbg PARAMS ((const char *fmt)); |
8662603f | 72 | #ifdef ANSI_PROTOTYPES |
27e81a4e | 73 | extern void printf_dbg PARAMS ((const char *fmt,...)); |
8662603f DP |
74 | #else |
75 | extern void printf_dbg PARAMS ((va_alist va_dcl)); | |
76 | #endif | |
77 | ||
4659e3b3 DP |
78 | |
79 | #ifdef __cplusplus | |
80 | } | |
81 | #endif | |
82 | ||
83 | #endif /* _DEBUGIFY_H_ */ |