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)"
19 for COREFILE
in "$COREDIR"/core
*
23 printf '\nIt looks like %s generated %s\nBacktraces:\n' \
24 "$EXECUTABLE" "$COREFILE"
25 GDBCOMMANDFILE
=$
(mktemp
)
26 printf "info registers\nthread apply all backtrace full\n" \
28 guess
=$
(file "$COREFILE")
29 guess
=${guess#* execfn: \'}
31 if [ ! -x "$guess" ]; then guess
=$EXECUTABLE; fi
32 gdb
-iex "add-auto-load-safe-path ${INSTDIR?}" -x "$GDBCOMMANDFILE" --batch "$guess" \
33 "$COREFILE" && found
=x
38 if [ -z "$found" -a "$EXITCODE" -ge 128 ]; then
40 echo "No core file identified in directory ${COREDIR}"
41 echo "To show backtraces for crashes during test execution,"
42 echo "enable core files with:"
44 echo " ulimit -c unlimited"
49 echo "You need gdb in your path to show backtraces"