diff --git a/.github/workflows/tests-with-pydebug.yml b/.github/workflows/tests-with-pydebug.yml index b3b0a004..391eb0b6 100644 --- a/.github/workflows/tests-with-pydebug.yml +++ b/.github/workflows/tests-with-pydebug.yml @@ -281,17 +281,28 @@ jobs: shell: bash run: | if [[ -n "$(find . -iname "core.*.[1-9]*")" ]]; then + echo "Found core dumps:" + ls -alh $(find . -iname "core.*.[1-9]*") + BACKTRACE_COMMAND="" if [[ "${{ runner.os }}" == 'Linux' ]]; then + echo "::group::Install GDB" ( export DEBIAN_FRONTEND=noninteractive sudo apt-get update -qq && sudo apt-get install -yqq gdb ) - echo "Found core dumps:" - ls -alh $(find . -iname "core.*.[1-9]*") + echo "::endgroup::" + BACKTRACE_COMMAND="gdb --exec ${{ env.PYTHON }} --core '{}' -ex 'bt' -ex 'q'" + elif [[ "${{ runner.os }}" == 'macOS' ]]; then + echo "::group::Install LLDB" + brew install llvm --quiet + echo "::endgroup::" + BACKTRACE_COMMAND="lldb --file ${{ env.PYTHON }} --core '{}' -o 'bt' -o 'q'" + fi + if [[ -n "${BACKTRACE_COMMAND}" ]]; then echo "Collecting backtraces:" find . -iname "core.*.[1-9]*" -exec bash -xc " echo '::group::backtrace from: {}'; - gdb ${{ env.PYTHON }} '{}' -ex 'backtrace' -ex 'quit'; + ${BACKTRACE_COMMAND}; echo '::endgroup::'; " ';' fi