[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 54/64] slirp: always build with debug statements
From: |
Samuel Thibault |
Subject: |
[Qemu-devel] [PULL 54/64] slirp: always build with debug statements |
Date: |
Wed, 19 Dec 2018 00:04:32 +0100 |
From: Marc-André Lureau <address@hidden>
Make debug statements condiitonal only on slirp_debug flags, instead
of the pre-processor DEBUG blocks, as it may introduce breakage
easily, since the debug code isn't always compiled.
Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Samuel Thibault <address@hidden>
---
slirp/debug.h | 15 +++------------
slirp/misc.c | 6 +++++-
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/slirp/debug.h b/slirp/debug.h
index ca3a4b04da..ff920f0b87 100644
--- a/slirp/debug.h
+++ b/slirp/debug.h
@@ -5,9 +5,8 @@
* terms and conditions of the copyright.
*/
-//#define DEBUG 1
-
-#ifdef DEBUG
+#ifndef DEBUG_H_
+#define DEBUG_H_
#define DBG_CALL 0x1
#define DBG_MISC 0x2
@@ -50,12 +49,4 @@ extern int slirp_debug;
} \
} while (0)
-#else
-
-#define DEBUG_CALL(fmt, ...)
-#define DEBUG_ARG(fmt, ...)
-#define DEBUG_ARGS(fmt, ...)
-#define DEBUG_MISC(fmt, ...)
-#define DEBUG_ERROR(fmt, ...)
-
-#endif
+#endif /* DEBUG_H_ */
diff --git a/slirp/misc.c b/slirp/misc.c
index 526cefa0f1..e30d2ceb2a 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -12,9 +12,13 @@
#include "qemu/main-loop.h"
#ifdef DEBUG
-int slirp_debug = DBG_CALL|DBG_MISC|DBG_ERROR;
+#define SLIRP_DEBUG (DBG_CALL | DBG_MISC | DBG_ERROR)
+#else
+#define SLIRP_DEBUG 0
#endif
+int slirp_debug = SLIRP_DEBUG;
+
inline void
insque(void *a, void *b)
{
--
2.19.2
- [Qemu-devel] [PULL 35/64] slirp: improve a bit the debug macros, (continued)
- [Qemu-devel] [PULL 35/64] slirp: improve a bit the debug macros, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 15/64] slirp: use a callback structure to interface with qemu, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 44/64] slirp: simplify fork_exec(), Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 46/64] slirp: Enable fork_exec support on Windows, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 40/64] slirp: remove dead TCP_ACK_HACK code, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 39/64] slirp: NULL is defined by stddef.h, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 48/64] slirp: rename exec_list, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 37/64] slirp: remove #if notdef dead code, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 32/64] slirp: replace compile time DO_KEEPALIVE, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 51/64] slirp: replace some fprintf() with DEBUG_MISC, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 54/64] slirp: always build with debug statements,
Samuel Thibault <=
- [Qemu-devel] [PULL 49/64] slirp: use virtual time for packet expiration, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 59/64] slirp: factor out guestfwd addition checks, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 47/64] slirp: drop <Vista compatibility, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 53/64] slirp: no need to make DPRINTF conditional on DEBUG, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 58/64] slirp: replace DEBUG_ARGS with DEBUG_ARG, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 52/64] slirp: replace a DEBUG block with WITH_ICMP_ERROR_MSG, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 62/64] slirp: set G_LOG_DOMAIN, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 56/64] slirp: use %p for pointers format, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 57/64] slirp: remove remaining DEBUG blocks, Samuel Thibault, 2018/12/18
- [Qemu-devel] [PULL 61/64] build-sys: use a seperate slirp-obj-y && slirp.mo, Samuel Thibault, 2018/12/18