From b2dd18fabae9fdb185a7a9ff583d3c3e1464565c Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 28 May 2015 11:02:40 +0200 Subject: [PATCH] configure: added `--enable-fulldebug` to enable extra/expensive debug code. This is mostly to avoid the allocation required by the externalization of the transaction dictionary, which in some cases is huge. This should reduce the massive memory usage required to inspect the externalized dictionary. --- NEWS | 9 +++++++++ bin/xbps-install/transaction.c | 2 ++ configure | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/NEWS b/NEWS index 3273b420..5f86b98b 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,14 @@ xbps-0.45 (???): + * configure: added `--enable-fulldebug` option to enable extra/expensive + debug output. + + * libxbps: fixed a dangling pointer when unpacking configuration files that + are renamed (because they existed), if the unpack callback function is set. + + * proplib: extra checks when internalizing plists to avoid NULL pointer + dereferences with broken files. + * Move manual pages of all utilities to the section 1 (user commands). The xbps utilities can be used by any user so that there's no point in having them in the section 8 (administraction and privileged commands). diff --git a/bin/xbps-install/transaction.c b/bin/xbps-install/transaction.c index ee701636..536538fa 100644 --- a/bin/xbps-install/transaction.c +++ b/bin/xbps-install/transaction.c @@ -339,9 +339,11 @@ exec_transaction(struct xbps_handle *xhp, int maxcols, bool yes, bool drun) } goto out; } +#ifdef FULL_DEBUG xbps_dbg_printf(xhp, "Dictionary before transaction happens:\n"); xbps_dbg_printf_append(xhp, "%s", xbps_dictionary_externalize(xhp->transd)); +#endif trans->xhp = xhp; trans->d = xhp->transd; diff --git a/configure b/configure index cd57ee5e..e664b57f 100755 --- a/configure +++ b/configure @@ -41,6 +41,7 @@ for instance \`--prefix=\$HOME'. --verbose Disable silent build to see compilation details --enable-api-docs Install XBPS API Library documentation (default disabled) --enable-debug Build with debugging code and symbols (default disabled) +--enable-fulldebug Enables extra debugging code (default disabled) --enable-static Build XBPS static utils (default disabled) --enable-tests Build and install Kyua tests (default disabled) Needs atf >= 0.15 (http://code.google.com/p/kyua) @@ -53,6 +54,7 @@ for x; do var=${x#*=} case "$opt" in --enable-debug) DEBUG=yes;; + --enable-fulldebug) FULL_DEBUG=yes;; --prefix) PREFIX=$var;; --exec-prefix) EPREFIX=$var;; --bindir) BINDIR=$var;; @@ -204,6 +206,10 @@ if [ -n "$DEBUG" -a "$DEBUG" != no -a "$DEBUG" != false ]; then else echo "CPPFLAGS+= -DNDEBUG" >>$CONFIG_MK fi +if [ -n "$FULL_DEBUG" ]; then + echo "Enabling extra debugging code." + echo "CPPFLAGS+= -DFULL_DEBUG" >>$CONFIG_MK +fi case "$OS" in linux)