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 "$(find "$COREDIR" -name "core
*" | 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 printf "info registers\nthread apply all backtrace full\n" > "$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"