add NYX_DEBUG option in debug mode
This commit is contained in:
parent
d407bab254
commit
ab668227f9
@ -28,11 +28,11 @@ error()
|
||||
echo "$0: <option>"
|
||||
echo ""
|
||||
echo "Available compile options: "
|
||||
echo " - dynamic dynamically link libxdc and capstone4"
|
||||
echo " - static statically link libxdc and capstone4"
|
||||
echo " - lto statically link libxdc and capstone4 and enable LTO (up to 10% better performance)"
|
||||
echo " - debug enable several debug options"
|
||||
echo " - debug_static enable several debug options and statically link libxdc and capstone4"
|
||||
echo " - dynamic dynamically link libxdc and capstone4"
|
||||
echo " - static statically link libxdc and capstone4"
|
||||
echo " - lto enable static linking and LTO (up to 10% better performance)"
|
||||
echo " - debug enable debug and ASAN options"
|
||||
echo " - debug_static enable debug, ASAN and static linking"
|
||||
echo ""
|
||||
exit 1
|
||||
}
|
||||
@ -52,7 +52,7 @@ compile_libraries()
|
||||
|
||||
configure_qemu()
|
||||
{
|
||||
QEMU_CONFIGURE="./configure --target-list=x86_64-softmmu --disable-gtk --disable-docs --enable-gtk --disable-werror --disable-capstone --disable-libssh --disable-tools"
|
||||
QEMU_CONFIGURE="./configure --target-list=x86_64-softmmu --disable-docs --disable-gtk --disable-werror --disable-capstone --disable-libssh --disable-tools"
|
||||
|
||||
case $1 in
|
||||
"debug_static"|"static"|"lto")
|
||||
@ -68,10 +68,10 @@ configure_qemu()
|
||||
$QEMU_CONFIGURE --enable-nyx
|
||||
;;
|
||||
"debug")
|
||||
$QEMU_CONFIGURE --enable-nyx --enable-sanitizers --enable-debug
|
||||
$QEMU_CONFIGURE --enable-nyx --enable-sanitizers --enable-debug --enable-nyx-debug
|
||||
;;
|
||||
"debug_static")
|
||||
$QEMU_CONFIGURE --enable-nyx --enable-sanitizers --enable-debug --enable-nyx-static
|
||||
$QEMU_CONFIGURE --enable-nyx --enable-sanitizers --enable-debug --enable-nyx-debug --enable-nyx-static
|
||||
;;
|
||||
"static")
|
||||
$QEMU_CONFIGURE --enable-nyx --enable-nyx-static
|
||||
|
6
configure
vendored
6
configure
vendored
@ -955,6 +955,8 @@ for opt do
|
||||
;;
|
||||
--enable-nyx-flto) nyx_flto="yes"
|
||||
;;
|
||||
--enable-nyx-debug) nyx_debug="yes"
|
||||
;;
|
||||
--version|-V) exec cat $source_path/VERSION
|
||||
;;
|
||||
--prefix=*) prefix="$optarg"
|
||||
@ -6104,6 +6106,10 @@ write_c_skeleton
|
||||
if test "$nyx" = "yes" ; then
|
||||
CFLAGS="-DNESTED_PATCH -Wno-error=maybe-uninitialized -DQEMU_NYX -g -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
|
||||
|
||||
if test "$nyx_debug" = "yes"; then
|
||||
CFLAGS="-DNYX_DEBUG $CFLAGS"
|
||||
fi
|
||||
|
||||
if test "$nyx_static" = "yes" ; then
|
||||
LIBS="-l:libcapstone.a -l:libxdc.a $LIBS"
|
||||
else
|
||||
|
15
nyx/debug.h
15
nyx/debug.h
@ -26,18 +26,19 @@
|
||||
#define ENDC "\033[0m"
|
||||
|
||||
|
||||
//#define debug_printf(format, ...) printf (format, ##__VA_ARGS__)
|
||||
//#define debug_fprintf(fd, format, ...) fprintf (fd, format, ##__VA_ARGS__)
|
||||
//#define QEMU_PT_PRINTF(PREFIX, format, ...) printf (QEMU_PT_PRINT_PREFIX COLOR PREFIX format ENDC "\n", ##__VA_ARGS__)
|
||||
//#define QEMU_PT_PRINTF_DBG(PREFIX, format, ...) printf (QEMU_PT_PRINT_PREFIX PREFIX "(%s#:%d)\t"format, __BASE_FILE__, __LINE__, ##__VA_ARGS__)
|
||||
//#define QEMU_PT_PRINTF_DEBUG(format, ...) fprintf (stderr, QEMU_PT_PRINT_PREFIX DEBUG_VM_PREFIX "(%s#:%d)\t"format "\n", __BASE_FILE__, __LINE__, ##__VA_ARGS__)
|
||||
|
||||
#ifdef NYX_DEBUG
|
||||
#define debug_printf(format, ...) printf (format, ##__VA_ARGS__)
|
||||
#define debug_fprintf(fd, format, ...) fprintf (fd, format, ##__VA_ARGS__)
|
||||
#define QEMU_PT_PRINTF(PREFIX, format, ...) printf (QEMU_PT_PRINT_PREFIX COLOR PREFIX format ENDC "\n", ##__VA_ARGS__)
|
||||
#define QEMU_PT_PRINTF_DBG(PREFIX, format, ...) printf (QEMU_PT_PRINT_PREFIX PREFIX "(%s#:%d)\t"format, __BASE_FILE__, __LINE__, ##__VA_ARGS__)
|
||||
#define QEMU_PT_PRINTF_DEBUG(format, ...) fprintf (stderr, QEMU_PT_PRINT_PREFIX DEBUG_VM_PREFIX "(%s#:%d)\t"format "\n", __BASE_FILE__, __LINE__, ##__VA_ARGS__)
|
||||
#else
|
||||
#define debug_printf(format, ...)
|
||||
#define debug_fprintf(fd, format, ...)
|
||||
#define QEMU_PT_PRINTF(PREFIX, format, ...)
|
||||
#define QEMU_PT_PRINTF_DBG(PREFIX, format, ...)
|
||||
#define QEMU_PT_PRINTF_DEBUG(format, ...)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ENABLE_BACKTRACES
|
||||
|
Loading…
x
Reference in New Issue
Block a user