Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4285)

Issue 5650057: [contrib] Add a commonly used flag to repro_fail (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 2 months ago by Diego Novillo
Modified:
12 years, 1 month ago
Reviewers:
CC:
gcc-patches_gcc.gnu.org
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -2 lines) Patch
M contrib/repro_fail View 2 chunks +14 lines, -2 lines 0 comments Download

Messages

Total messages: 1
Diego Novillo
12 years, 2 months ago (2012-02-10 15:54:35 UTC) #1
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.

diff --git a/contrib/repro_fail b/contrib/repro_fail
index 8100456..c55d080 100755
--- a/contrib/repro_fail
+++ b/contrib/repro_fail
@@ -31,14 +31,26 @@
 # command, it asks which one you want.
 
 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 "Finds the 'spawn' line matching PATTERN in FILE.LOG and executes"
     echo "the command with any arguments in ADDITIONAL-ARGS."
     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
 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"
 logf="$2"
 shift 2
@@ -77,6 +89,6 @@ IFS="$old_IFS"
 for cmd_num in $cmds_to_run ; do
     cmd=${commands[$cmd_num]}
     set -x +e
-    $cmd "$@"
+    $cmd $debug_args "$@"
     set +x -e
 done

--
This patch is available for review at http://codereview.appspot.com/5650057
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b