blob: 52b6687c6b5c58876e6c1d80bef3e014b86b486f [file] [log] [blame]
Daniel Stenbergf9b44902003-02-07 09:41:57 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#ifndef DEBUG_H
20#define DEBUG_H
21
22extern void debug_init(void);
Jens Arnold2f20b3e2004-08-18 19:59:06 +000023extern void debugf(const char* fmt,...);
24extern void ldebugf(const char* file, int line, const char *fmt, ...);
Daniel Stenbergf9b44902003-02-07 09:41:57 +000025
26#ifdef __GNUC__
27
28/* */
29#if defined(SIMULATOR)
30#define DEBUGF debugf
31#define LDEBUGF(...) ldebugf(__FILE__, __LINE__, __VA_ARGS__)
32#else
33#if defined(DEBUG)
Tomasz Malesinskiec7e9762006-02-04 00:04:02 +000034
35#ifdef HAVE_GDB_API
36void breakpoint(void);
37#endif
38
Daniel Stenbergf9b44902003-02-07 09:41:57 +000039#define DEBUGF debugf
40#define LDEBUGF debugf
41#else
42#define DEBUGF(...)
43#define LDEBUGF(...)
44#endif
45#endif
46
47
48#else
49
50#define DEBUGF debugf
51#define LDEBUGF debugf
52
53#endif /* GCC */
54
55
56#endif