[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 17/21] Monitor: Debugging support
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 17/21] Monitor: Debugging support |
Date: |
Wed, 10 Feb 2010 23:50:03 -0200 |
Add configure options (--enable-debug-mon and --disable-debug-mon)
plus the MON_DEBUG() macro.
Signed-off-by: Luiz Capitulino <address@hidden>
---
configure | 10 ++++++++++
monitor.c | 8 ++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/configure b/configure
index 0a84b0e..2c2e7ae 100755
--- a/configure
+++ b/configure
@@ -266,6 +266,7 @@ linux_aio=""
gprof="no"
debug_tcg="no"
+debug_mon="no"
debug="no"
strip_opt="yes"
bigendian="no"
@@ -514,9 +515,14 @@ for opt do
;;
--disable-debug-tcg) debug_tcg="no"
;;
+ --enable-debug-mon) debug_mon="yes"
+ ;;
+ --disable-debug-mon) debug_mon="no"
+ ;;
--enable-debug)
# Enable debugging options that aren't excessively noisy
debug_tcg="yes"
+ debug_mon="yes"
debug="yes"
strip_opt="no"
;;
@@ -1918,6 +1924,7 @@ echo "host CPU $cpu"
echo "host big endian $bigendian"
echo "target list $target_list"
echo "tcg debug enabled $debug_tcg"
+echo "Mon debug enabled $debug_mon"
echo "gprof enabled $gprof"
echo "sparse enabled $sparse"
echo "strip binaries $strip_opt"
@@ -1995,6 +2002,9 @@ echo "ARCH=$ARCH" >> $config_host_mak
if test "$debug_tcg" = "yes" ; then
echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
fi
+if test "$debug_mon" = "yes" ; then
+ echo "CONFIG_DEBUG_MONITOR=y" >> $config_host_mak
+fi
if test "$debug" = "yes" ; then
echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak
fi
diff --git a/monitor.c b/monitor.c
index 6eb0e2c..2a14e81 100644
--- a/monitor.c
+++ b/monitor.c
@@ -143,6 +143,14 @@ struct Monitor {
QLIST_ENTRY(Monitor) entry;
};
+#ifdef CONFIG_DEBUG_MONITOR
+#define MON_DEBUG(fmt, ...) do { \
+ fprintf(stderr, "Monitor: "); \
+ fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
+#else /* !CONFIG_DEBUG_MONITOR */
+#define MON_DEBUG(fmt, ...) do { } while (0)
+#endif /* CONFIG_DEBUG_MONITOR */
+
static QLIST_HEAD(mon_list, Monitor) mon_list;
static const mon_cmd_t mon_cmds[];
--
1.6.6
- [Qemu-devel] [PATCH 07/21] Monitor: Convert do_getfd() to cmd_new_ret(), (continued)
- [Qemu-devel] [PATCH 07/21] Monitor: Convert do_getfd() to cmd_new_ret(), Luiz Capitulino, 2010/02/10
- [Qemu-devel] [PATCH 08/21] Monitor: Convert do_closefd() to cmd_new_ret(), Luiz Capitulino, 2010/02/10
- [Qemu-devel] [PATCH 09/21] Monitor: Convert pci_device_hot_add() to cmd_new_ret(), Luiz Capitulino, 2010/02/10
- [Qemu-devel] [PATCH 10/21] Monitor: Convert pci_device_hot_remove() to cmd_new_ret(), Luiz Capitulino, 2010/02/10
- [Qemu-devel] [PATCH 11/21] Monitor: Convert do_migrate() to cmd_new_ret(), Luiz Capitulino, 2010/02/10
- [Qemu-devel] [PATCH 12/21] Monitor: Convert do_memory_save() to cmd_new_ret(), Luiz Capitulino, 2010/02/10
- [Qemu-devel] [PATCH 13/21] Monitor: Convert do_physical_memory_save() to cmd_new_ret(), Luiz Capitulino, 2010/02/10
- [Qemu-devel] [PATCH 14/21] Monitor: Convert do_info() to cmd_new_ret(), Luiz Capitulino, 2010/02/10
- [Qemu-devel] [PATCH 15/21] Monitor: Convert do_change() to cmd_new_ret(), Luiz Capitulino, 2010/02/10
- [Qemu-devel] [PATCH 16/21] Monitor: Rename cmd_new_ret(), Luiz Capitulino, 2010/02/10
- [Qemu-devel] [PATCH 17/21] Monitor: Debugging support,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 18/21] Monitor: Drop the print disabling mechanism, Luiz Capitulino, 2010/02/10
- [Qemu-devel] [PATCH 19/21] Monitor: Audit handler return, Luiz Capitulino, 2010/02/10
- [Qemu-devel] [PATCH 20/21] Monitor: Debug stray prints the right way, Luiz Capitulino, 2010/02/10
- [Qemu-devel] [PATCH 21/21] Monitor: Report more than one error in handlers, Luiz Capitulino, 2010/02/10
- Re: [Qemu-devel] [PATCH v0 00/21]: Monitor: improve handlers error handling, Markus Armbruster, 2010/02/11
- Re: [Qemu-devel] [PATCH v0 00/21]: Monitor: improve handlers error handling, Anthony Liguori, 2010/02/11