This patch adds two common shortcuts to the failure reproducer

script.

Committed to trunk.

2012-02-10   Diego Novillo  <dnovillo@google.com>

	* repro_fail: Add --debug and --debug-tui flags.

From-SVN: r184097
This commit is contained in:
Diego Novillo 2012-02-10 10:52:03 -05:00 committed by Diego Novillo
parent 58d38fd2d6
commit a8fc985552
2 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2012-02-10 Diego Novillo <dnovillo@google.com>
* repro_fail: Add --debug and --debug-tui flags.
2012-02-02 Sumanth G <sumanth.gundapaneni@kpitcummins.com> 2012-02-02 Sumanth G <sumanth.gundapaneni@kpitcummins.com>
Jayant R Sonar <jayant.sonar@kpitcummins.com> Jayant R Sonar <jayant.sonar@kpitcummins.com>

View File

@ -31,14 +31,26 @@
# command, it asks which one you want. # command, it asks which one you want.
if [ $# -lt 2 ] ; then if [ $# -lt 2 ] ; then
echo "usage: $0 pattern file.log [additional-args]" echo "usage: $0 [--debug|--debug-tui] pattern file.log [additional-args]"
echo echo
echo "Finds the 'spawn' line matching PATTERN in FILE.LOG and executes" echo "Finds the 'spawn' line matching PATTERN in FILE.LOG and executes"
echo "the command with any arguments in ADDITIONAL-ARGS." echo "the command with any arguments in ADDITIONAL-ARGS."
echo echo
echo "If --debug is used, the compiler is invoked with -wrapper gdb,--args"
echo "If --debug-tui is used, the compiler is invoked with -wrapper "\
"gdb,--tui,--args"
exit 1 exit 1
fi fi
if [ "$1" == "--debug" ] ; then
debug_args="-wrapper gdb,--args"
shift
elif [ "$1" == "--debug-tui" ] ; then
debug_args="-wrapper gdb,--tui,--args"
shift
else
debug_args=""
fi
pattern="$1" pattern="$1"
logf="$2" logf="$2"
shift 2 shift 2
@ -77,6 +89,6 @@ IFS="$old_IFS"
for cmd_num in $cmds_to_run ; do for cmd_num in $cmds_to_run ; do
cmd=${commands[$cmd_num]} cmd=${commands[$cmd_num]}
set -x +e set -x +e
$cmd "$@" $cmd $debug_args "$@"
set +x -e set +x -e
done done