File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -112,3 +112,6 @@ SCALA_ASM=$(find_lib "*scala-asm*")
112112SCALA_LIB=$( find_lib " *scala-library*" )
113113SCALA_XML=$( find_lib " *scala-xml*" )
114114SBT_INTF=$( find_lib " *sbt-interface*" )
115+
116+ # debug
117+ DEBUG_STR=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ case "$1" in
7676 --) shift ; for arg; do addResidual " $arg " ; done ; set -- ;;
7777 -h|-help) help=true && shift ;;
7878 -v|-verbose) verbose=true && shift ;;
79- -debug) debug=true && shift ;;
79+ -debug) DEBUG= " $DEBUG_STR " && shift ;;
8080 -q|-quiet) quiet=true && shift ;;
8181
8282 # Optimize for short-running applications, see https://github.com/lampepfl/dotty/issues/222
@@ -103,6 +103,7 @@ classpathArgs
103103
104104eval exec " \" $JAVACMD \" " \
105105 ${JAVA_OPTS:- $default_java_opts } \
106+ " $DEBUG " \
106107 " ${java_args[@]} " \
107108 " $jvm_cp_args " \
108109 -Dscala.usejavacp=true \
Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ source "$PROG_HOME/bin/common"
3131
3232CLASS_PATH=" .$PSEP$DOTTY_LIB$PSEP$SCALA_LIB "
3333
34+ # -d must be the first option
35+ case " $1 " in
36+ -d) DEBUG=" $DEBUG_STR " && shift ;;
37+ esac
38+
3439first_arg=" $1 "
3540
3641if [ -z " $1 " ]; then
@@ -39,5 +44,5 @@ if [ -z "$1" ]; then
3944elif [[ ${first_arg: 0: 1} == " -" ]]; then
4045 eval " $PROG_HOME /bin/dotc -repl $@ "
4146else
42- eval exec " \" $JAVACMD \" " " -classpath \" $CLASS_PATH \" " $@
47+ eval exec " \" $JAVACMD \" " " $DEBUG " " -classpath \" $CLASS_PATH \" " $@
4348fi
You can’t perform that action at this time.
0 commit comments