]> granicus.if.org Git - mutt/commitdiff
Add debugger support to muttbug.
authorThomas Roessler <roessler@does-not-exist.org>
Thu, 3 Feb 2000 13:41:38 +0000 (13:41 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Thu, 3 Feb 2000 13:41:38 +0000 (13:41 +0000)
acconfig.h
configure.in
muttbug.sh.in

index ed84a2bef1c024141c6fb08d0dcc7da4fd7368bc..0b19d122d0e198aa16af3b0455ebb551f25f4c3d 100644 (file)
 
 /* define when your system has the setrlimit function */
 #undef HAVE_SETRLIMIT
+
+/* where can we find a debugger */
+#undef DEBUGGER
index c5915b4e9f77cdcbb6bb2e0340600f47f67f24ae..97a62b75334fe9b8cdb6c0c8e1d0c11a91f14d9c 100644 (file)
@@ -38,6 +38,22 @@ esac
 AC_C_INLINE
 AC_C_CONST
 
+AC_PATH_PROG(DBX, dbx, no)
+AC_PATH_PROG(GDB, gdb, no)
+AC_PATH_PROG(SDB, sdb, no)
+
+if test $GDB != no ; then
+       DEBUGGER=$GDB
+elif test $DBX != no ; then
+       DEBUGGER=$DBX 
+elif test $SDB != no ; then
+       DEBUGGER=$SDB
+else
+       DEBUGGER=no
+fi
+
+AC_SUBST(DEBUGGER)
+
 ac_aux_path_sendmail=/usr/sbin:/usr/lib   
 AC_PATH_PROG(SENDMAIL, sendmail, no, $PATH:$ac_aux_path_sendmail)
 
index 99e12bdae2169e7fce5cf854dee6e968cdd1efe6..4897b56a7c3d2eb83e902c7153857d0792eae18b 100644 (file)
@@ -40,6 +40,36 @@ include_file ()
        echo
 }
 
+debug_gdb ()
+{
+       cat << EOF > $SCRATCH/gdb.rc
+bt
+list
+quit
+EOF
+       @DEBUGGER@ -n -x $SCRATCH/gdb.rc -c $CORE mutt
+}
+
+debug_dbx ()
+{
+       cat << EOF > $SCRATCH/dbx.rc
+where
+list
+quit
+EOF
+       @DEBUGGER@ -s $SCRATCH/dbx.rc mutt $CORE
+}
+
+debug_sdb ()
+{
+       cat << EOF > $SCRATCH/sdb.rc
+t
+w
+q
+EOF
+       @DEBUGGER@ mutt $CORE < $SCRATCH/sdb.rc
+}
+
 case `echo -n` in
 "") n=-n; c=   ;;
  *) n=; c='\c' ;;
@@ -98,16 +128,22 @@ case "$severity" in
        *)   severity=normal    ;;
 esac
 
+if test -x @DEBUGGER@ ; then
+       test -f core && CORE=core
+       echo "Do you want to include information gathered from a core file?"
+       echo -n "If yes, please enter the path - otherwise just say no: [$CORE] $c"
+       read _CORE
+       test "$_CORE" && CORE="$_CORE"
+fi
 
-
-echo $n "Do you want to include your personal mutt configuration files? [Y|n]$c"
+echo $n "Do you want to include your personal mutt configuration files? [Y|n] $c"
 read personal
 case "$personal" in
 [nN]*)  personal=no  ;;
     *)  personal=yes ;;
 esac
 
-echo $n "Do you want to include your system's global mutt configuration file? [Y|n]$c"
+echo $n "Do you want to include your system's global mutt configuration file? [Y|n] $c"
 read global
 case "$global" in
 [nN]*)  global=no  ;;
@@ -125,7 +161,7 @@ if test -f /etc/debian_version ; then
        fi
        echo "$DPKG"
        if test "$DPKG" = "no" ; then
-               echo $n "File this bug with Debian? [Y|n]$c"
+               echo $n "File this bug with Debian? [Y|n] $c"
                read $DPKG
                case "$DPKG" in
                [nN])   DPKG=no ;;
@@ -172,6 +208,20 @@ echo "-- Mutt Version Information"
 echo
 mutt -v
 
+if test "$CORE" && test -f "$CORE" ; then
+       echo 
+       echo "-- Core Dump Analysis Output"
+       echo
+
+       case "@DEBUGGER@" in
+               *sdb) debug_sdb $CORE ;;
+               *dbx) debug_dbx $CORE ;;
+               *gdb) debug_gdb $CORE ;;
+       esac
+       
+       echo
+fi
+
 if test "$personal" = "yes" ; then
        CANDIDATES=".muttrc-${MUTTVERSION} .muttrc .mutt/muttrc-${MUTTVERSION} .mutt/muttrc"
        MATCHED="none"
@@ -189,6 +239,7 @@ if test "$personal" = "yes" ; then
        fi
 fi
 
+
 if test "$global" = "yes" ; then
        CANDIDATES="Muttrc-${MUTTVERSION} Muttrc"
        DIRECTORIES="@sysconfdir@ @sharedir@"
@@ -225,7 +276,7 @@ while : ; do
                fi
        fi
        
-       echo $n "Submit, Edit, View, Quit? [S|e|v|q]$c"
+       echo $n "Submit, Edit, View, Quit? [S|e|v|q] $c"
        read _input
        input="`echo $_input | tr EVSQ evsq`"
        case $input in