4 # This file is part of the LibreOffice project.
6 # This Source Code Form is subject to the terms of the Mozilla Public
7 # License, v. 2.0. If a copy of the MPL was not distributed with this
8 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
16 if test -n "$(which gdb)"
18 if test "$(ls "$COREDIR"/core* 2>/dev/null | wc -l)" -eq 1
20 COREFILE
=$
(ls "$COREDIR"/core
*)
22 echo "It looks like ${EXECUTABLE} generated a core file at ${COREFILE}"
24 GDBCOMMANDFILE
=`mktemp`
25 echo "thread apply all backtrace full" > "$GDBCOMMANDFILE"
26 gdb
-x "$GDBCOMMANDFILE" --batch "$EXECUTABLE" "$COREFILE"
30 elif [ "$EXITCODE" -ge 128 ]; then
32 echo "No core file identified in directory ${COREDIR}"
33 echo "To show backtraces for crashes during test execution,"
34 echo "enable core files with:"
36 echo " ulimit -c unlimited"
41 echo "You need gdb in your path to show backtraces"