Skip to content

Commit

Permalink
Remove -d for debugging to be consistent and align with Scala 2 behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed May 9, 2021
1 parent 67f1285 commit d4f05ef
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 12 deletions.
3 changes: 0 additions & 3 deletions dist/bin/common
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ JLINE_TERMINAL=$(find_lib "*jline-terminal-3*")
JLINE_TERMINAL_JNA=$(find_lib "*jline-terminal-jna-3*")
[[ ${conemu-} ]] || JNA=$(find_lib "*jna-5*")

# debug

DEBUG_STR=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005

compilerJavaClasspathArgs () {
# echo "dotty-compiler: $DOTTY_COMP"
Expand Down
6 changes: 1 addition & 5 deletions dist/bin/scala
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ while [[ $# -gt 0 ]]; do
addScala "$1"
shift
;;
-d|-debug)
DEBUG="${DEBUG_STR-}"
shift ;;
-version)
# defer to scalac, then exit
shift
Expand Down Expand Up @@ -187,7 +184,6 @@ script)
# $scripting_string must be last
eval "\"$JAVACMD\"" \
${JAVA_OPTS:-$default_java_opts} \
"${DEBUG-}" \
"${java_args[@]}" \
"-classpath \"$jvm_cp_args\"" \
-Dscala.usejavacp=true \
Expand Down Expand Up @@ -223,7 +219,7 @@ run)
run_cparg+="$PSEP$DOTTY_COMP$PSEP$TASTY_CORE$PSEP$DOTTY_INTF$PSEP$SCALA_ASM$PSEP$DOTTY_STAGING$PSEP$DOTTY_TASTY_INSPECTOR"
fi
# exec here would prevent onExit from being called, leaving terminal in unusable state
eval "\"$JAVACMD\"" "${DEBUG-}" "-classpath \"$run_cparg\"" "${java_args[@]}" "${residual_args[@]}"
eval "\"$JAVACMD\"" "-classpath \"$run_cparg\"" "${java_args[@]}" "${residual_args[@]}"
scala_exit_status=$?
;;

Expand Down
2 changes: 0 additions & 2 deletions dist/bin/scalac
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ while [[ $# -gt 0 ]]; do
case "$1" in
--) shift; for arg; do addResidual "$arg"; done; set -- ;;
-v|-verbose) verbose=true && addScala "-verbose" && shift ;;
-debug) DEBUG="$DEBUG_STR" && shift ;;
-q|-quiet) quiet=true && shift ;;

# Optimize for short-running applications, see https://github.com/lampepfl/dotty/issues/222
Expand Down Expand Up @@ -72,7 +71,6 @@ fi
[ -n "$script_trace" ] && set -x
eval "\"$JAVACMD\"" \
${JAVA_OPTS:-$default_java_opts} \
"${DEBUG-}" \
"${java_args[@]}" \
"-classpath \"$jvm_cp_args\"" \
-Dscala.usejavacp=true \
Expand Down
2 changes: 0 additions & 2 deletions dist/bin/scaladoc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ while [[ $# -gt 0 ]]; do
case "$1" in
--) shift; for arg; do addResidual "$arg"; done; set -- ;;
-v|-verbose) verbose=true && addScala "-verbose" && shift ;;
-debug) DEBUG="$DEBUG_STR" && shift ;;
-q|-quiet) quiet=true && shift ;;

-colors) colors=true && shift ;;
Expand All @@ -126,7 +125,6 @@ classpathArgs

eval "\"$JAVACMD\"" \
${JAVA_OPTS:-$default_java_opts} \
"${DEBUG-}" \
"${java_args[@]}" \
"${jvm_cp_args-}" \
"dotty.tools.scaladoc.Main" \
Expand Down
3 changes: 3 additions & 0 deletions project/scripts/bootstrapCmdTests
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,6 @@ grep -qe "Usage: scalac <options> <source files>" "$tmp"

./bin/scala -help > "$tmp" 2>&1
grep -qe "Usage: scala <options> <source files>" "$tmp"

.bin/scala -d hello.jar tests/run/hello.scala
ls hello.jar

0 comments on commit d4f05ef

Please sign in to comment.