]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest/gdb_backtrace: add an off switch
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 11 Feb 2021 04:39:18 +0000 (17:39 +1300)
committerDavid Mulder <dmulder@samba.org>
Mon, 22 Feb 2021 14:45:38 +0000 (14:45 +0000)
Sometime you know a test is going to crash and produce a LOT of
backtrace, and you already know what it will look like. For those
times you can set

PLEASE_NO_GDB_BACKTRACE=1

and there will be no backtrace, which can save quite a bit of time and
thousands of lines of log file. (In particular, backtraces of Python
programs can take over a minute to complete).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@suse.com>
selftest/gdb_backtrace

index 4fe5f57353a5e58ea8a509d7c6660d694f90a84d..307a4d1e122f172cdba315b700c30f0fcb224e59 100755 (executable)
@@ -9,6 +9,12 @@ if [ -n "$VALGRIND" -o -n "$SMBD_VALGRIND" ]; then
        exit 1
 fi
 
+if [ "x$PLEASE_NO_GDB_BACKTRACE" != "x" ]; then
+       echo "${BASENAME}: Not running debugger because PLEASE_NO_GDB_BACKTRACE is set"
+        exit 0
+fi
+
+
 # we want everything on stderr, so the program is not disturbed
 exec 1>&2