Skip to content

Commit df9c278

Browse files
committed
Make core and diff debugging more portable
1 parent 61d4ffb commit df9c278

File tree

4 files changed

+24
-23
lines changed

4 files changed

+24
-23
lines changed

.travis.scripts/debug-core.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/sh
22

3-
PHP=/home/travis/.phpenv/versions/`php -r 'echo PHP_VERSION;'`/bin/php
4-
echo "backtrace full" | gdb $PHP $1
3+
if [ "${TRAVIS_OS_NAME}" != "osx" ]; then
4+
# https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/mac-gdb-install.html
5+
echo "Cannot debug core files on macOS: ${1}"
6+
exit 1
7+
fi
58

9+
PHP_BINARY=`which php`
10+
gdb -batch -ex "bt full" -ex "quit" "${PHP_BINARY}" "${1}"

.travis.scripts/debug-diff.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
EXP=`echo $1 | sed 's/.diff$/.exp/'`
4+
OUT=`echo $1 | sed 's/.diff$/.out/'`
5+
SEP="--------------------------------------------------------------------------------"
6+
7+
echo $EXP
8+
echo $SEP
9+
cat $EXP; echo
10+
echo $SEP; echo
11+
12+
echo $OUT
13+
echo $SEP
14+
cat $OUT; echo
15+
echo $SEP; echo

.travis.scripts/debug-script.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ after_success:
3333
- make coveralls
3434

3535
after_failure:
36-
- find . -name \*core\* -exec ./.travis.scripts/debug-core.sh {} \;
37-
- find . -name \*diff -exec ./.travis.scripts/debug-script.sh {} \;
36+
- find . -name 'core*' -exec .travis.scripts/debug-core.sh {} \;
37+
- find . -name '*.diff' -exec .travis.scripts/debug-diff.sh {} \;

0 commit comments

Comments
 (0)