summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2020-07-04 02:42:52 -0600
committerEduardo Chappa <chappa@washington.edu>2020-07-04 02:42:52 -0600
commitc566cd0e4a7d9424a95c7d7c16f861e458bee8f1 (patch)
treeb2c604c2e35621be166e0e8a902cc0dd291e4948
parentf720e89f631da58c355ead60b35225e43d0d9d33 (diff)
downloadalpine-c566cd0e4a7d9424a95c7d7c16f861e458bee8f1.tar.xz
* When building Alpine, the option --disable-debug will only affect if
its binary is compiled with debug, and not the ability of alpine to generate internal debug. Alpine will not write debug files unless started with the option -d, so for example "alpine -d 2" will generate a debug file at level 2, but just issuing the alpine command will not write any debug to a file.
-rw-r--r--alpine/arg.c1
-rw-r--r--alpine/osdep/debuging.c2
-rwxr-xr-xconfigure15
-rw-r--r--configure.ac10
-rw-r--r--pith/pine.hlp6
-rw-r--r--pith/state.h1
6 files changed, 22 insertions, 13 deletions
diff --git a/alpine/arg.c b/alpine/arg.c
index 25419b3..57c39fc 100644
--- a/alpine/arg.c
+++ b/alpine/arg.c
@@ -1165,6 +1165,7 @@ process_debug_str(char *debug_str)
}
}
+ if(usage >= 0) ps_global->write_debug_file++;
if(!new_style_debug_arg){
#ifdef CSRIMALLOC
ps_global->debug_malloc =
diff --git a/alpine/osdep/debuging.c b/alpine/osdep/debuging.c
index 47a056b..f7a2971 100644
--- a/alpine/osdep/debuging.c
+++ b/alpine/osdep/debuging.c
@@ -74,7 +74,7 @@ init_debug(void)
char newfname[MAXPATH+1], filename[MAXPATH+1], *dfile = NULL;
int i, fd;
- if(!(debug || ps_global->debug_imap || ps_global->debug_tcp))
+ if(!((debug || ps_global->debug_imap || ps_global->debug_tcp) && ps_global->write_debug_file))
return;
for(i = ps_global->debug_nfiles - 1; i > 0; i--){
diff --git a/configure b/configure
index f902aa2..9d11f5e 100755
--- a/configure
+++ b/configure
@@ -1578,7 +1578,7 @@ Optional Features:
--enable-dmalloc Enable dmalloc debugging
--enable-osx-universal-binaries
Produce universal binaries under OS X [[default=no]]
- --disable-debug Exclude debug messages from source
+ --disable-debug Exclude debug from the binary
--disable-optimization Exclude optimizing compiler flags
--disable-mouse Disable mouse support
--enable-quotas Enable disk quota checking on startup
@@ -15157,12 +15157,6 @@ fi
if test x$enable_debug != "xno" ; then
AM_CFLAGS="$AM_CFLAGS -g"
-
-$as_echo "#define DEBUG 1" >>confdefs.h
-
-
-$as_echo "#define DEBUGJOURNAL 1" >>confdefs.h
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
@@ -15170,6 +15164,13 @@ else
$as_echo "no" >&6; }
fi
+$as_echo "#define DEBUG 1" >>confdefs.h
+
+
+$as_echo "#define DEBUGJOURNAL 1" >>confdefs.h
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking option: optimization is enabled" >&5
$as_echo_n "checking option: optimization is enabled... " >&6; }
# Check whether --enable-optimization was given.
diff --git a/configure.ac b/configure.ac
index c93f769..118f0ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -224,16 +224,18 @@ AC_ARG_WITH(web-bin,
dnl disable debug, turned on by default
AC_MSG_CHECKING([option: debugging is enabled])
-AC_ARG_ENABLE(debug, AS_HELP_STRING([--disable-debug],[Exclude debug messages from source]))
+AC_ARG_ENABLE(debug, AS_HELP_STRING([--disable-debug],[Exclude debug from the binary]))
if test x$enable_debug != "xno" ; then
AM_CFLAGS="$AM_CFLAGS -g"
- AC_DEFINE([DEBUG], [1], [Compile in debugging])
- AC_DEFINE([DEBUGJOURNAL], [1], [Display debug messages in journal])
AC_MSG_RESULT([yes])
else
-dnl ??? set AM_CFLAGS to optimize ???
AC_MSG_RESULT([no])
fi
+dnl we want debug messages to be compiled into the binary, but only write to a file
+dnl upon user request.
+AC_DEFINE([DEBUG], [1], [Compile in debugging])
+AC_DEFINE([DEBUGJOURNAL], [1], [Display debug messages in journal])
+
dnl disable optimization, on by default
AC_MSG_CHECKING([option: optimization is enabled])
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 08f02ce..777b53f 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 480 2020-07-03 11:34:14
+Alpine Commit 481 2020-07-04 02:42:49
============= h_news =================
<HTML>
<HEAD>
@@ -227,6 +227,10 @@ problems you find with this release.
is almost equivalent to being a shortcut to &quot;unselect all messages, and select
again&quot;. The difference is that cancelling this command will not unselect
all currently selected messages. Suggested by Holger Trapp.
+
+<LI> Alpine will not write debug files unless started with the option -d,
+ so for example &quot;alpine -d 2&quot; will generate a debug file at level 2,
+ but just issuing the alpine command will not write any debug to a file.
</UL>
<P>
diff --git a/pith/state.h b/pith/state.h
index 3fec369..24bc890 100644
--- a/pith/state.h
+++ b/pith/state.h
@@ -130,6 +130,7 @@ struct pine {
char *html_dir;
HTML_LOG_S *html_dir_list;
+ unsigned write_debug_file:1; /* should we write debug to a file */
unsigned signal_in_progress:1; /* we are handling a signal */
unsigned mangled_footer:1; /* footer needs repainting */
unsigned mangled_header:1; /* header needs repainting */