File tree Expand file tree Collapse file tree 2 files changed +33
-10
lines changed Expand file tree Collapse file tree 2 files changed +33
-10
lines changed Original file line number Diff line number Diff line change @@ -145,12 +145,28 @@ test_pause () {
145
145
" $SHELL_PATH " < & 6 >&5 2>&7
146
146
}
147
147
148
- # Wrap git in gdb . Adding this to a command can make it easier to
149
- # understand what is going on in a failing test.
148
+ # Wrap git with a debugger . Adding this to a command can make it easier
149
+ # to understand what is going on in a failing test.
150
150
#
151
- # Example: "debug git checkout master".
151
+ # Examples:
152
+ # debug git checkout master
153
+ # debug --debugger=nemiver git $ARGS
154
+ # debug -d "valgrind --tool=memcheck --track-origins=yes" git $ARGS
152
155
debug () {
153
- GIT_TEST_GDB=1 " $@ " < & 6 >&5 2>&7
156
+ case " $1 " in
157
+ -d)
158
+ GIT_DEBUGGER=" $2 " &&
159
+ shift 2
160
+ ;;
161
+ --debugger=* )
162
+ GIT_DEBUGGER=" ${1#* =} " &&
163
+ shift 1
164
+ ;;
165
+ * )
166
+ GIT_DEBUGGER=1
167
+ ;;
168
+ esac &&
169
+ GIT_DEBUGGER=" ${GIT_DEBUGGER} " " $@ " < & 6 >&5 2>&7
154
170
}
155
171
156
172
# Call test_commit with the arguments
Original file line number Diff line number Diff line change @@ -20,10 +20,17 @@ PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH"
20
20
21
21
export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR
22
22
23
- if test -n " $GIT_TEST_GDB "
24
- then
25
- unset GIT_TEST_GDB
26
- exec gdb --args " ${GIT_EXEC_PATH} /@@PROG@@" " $@ "
27
- else
23
+ case " $GIT_DEBUGGER " in
24
+ ' ' )
28
25
exec " ${GIT_EXEC_PATH} /@@PROG@@" " $@ "
29
- fi
26
+ ;;
27
+ 1)
28
+ unset GIT_DEBUGGER
29
+ exec gdb --args " ${GIT_EXEC_PATH} /@@PROG@@" " $@ "
30
+ ;;
31
+ * )
32
+ GIT_DEBUGGER_ARGS=" $GIT_DEBUGGER "
33
+ unset GIT_DEBUGGER
34
+ exec ${GIT_DEBUGGER_ARGS} " ${GIT_EXEC_PATH} /@@PROG@@" " $@ "
35
+ ;;
36
+ esac
You can’t perform that action at this time.
0 commit comments