Skip to content

Commit 23055c8

Browse files
committed
[Truffle] JT: allow --jdebug for specs.
1 parent 039ee10 commit 23055c8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tool/jt.rb

+9-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
JRUBY_DIR = File.expand_path('../..', __FILE__)
1818

19+
JDEBUG_PORT = 51819
20+
JDEBUG = "-J-agentlib:jdwp=transport=dt_socket,server=y,address=#{JDEBUG_PORT},suspend=y"
21+
1922
# wait for sub-processes to handle the interrupt
2023
trap(:INT) {}
2124

@@ -226,7 +229,7 @@ def run(*args)
226229
end
227230

228231
if args.delete('--jdebug')
229-
jruby_args += %w[-J-agentlib:jdwp=transport=dt_socket,server=y,address=51819,suspend=y]
232+
jruby_args << JDEBUG
230233
end
231234

232235
if args.delete('--server')
@@ -301,12 +304,15 @@ def test_specs(*args)
301304
options += %w[--excl-tag slow]
302305
end
303306

304-
if args.first == '--graal'
305-
args.shift
307+
if args.delete('--graal')
306308
env_vars["JAVACMD"] = Utilities.find_graal
307309
options << '-T-J-server'
308310
end
309311

312+
if args.delete('--jdebug')
313+
options << "-T#{JDEBUG}"
314+
end
315+
310316
mspec_env env_vars, 'run', *options, *args
311317
end
312318
private :test_specs

0 commit comments

Comments
 (0)