@@ -7,6 +7,7 @@ import org.utbot.common.utBotTempDirectory
7
7
import org.utbot.framework.plugin.services.JdkInfoService
8
8
import org.utbot.framework.UtSettings
9
9
import org.utbot.framework.plugin.services.WorkingDirService
10
+ import org.utbot.framework.process.OpenModulesContainer
10
11
import org.utbot.instrumentation.Settings
11
12
import org.utbot.instrumentation.agent.DynamicClassTransformer
12
13
import org.utbot.rd.rdPortArgument
@@ -19,26 +20,20 @@ class ChildProcessRunner {
19
20
private val id = Random .nextLong()
20
21
private var processSeqN = 0
21
22
private val cmds: List <String > by lazy {
22
- val debugCmd =
23
- listOfNotNull(DEBUG_RUN_CMD .takeIf { Settings .runChildProcessWithDebug} )
24
-
25
- val javaVersionSpecificArguments =
26
- listOf (" --add-opens" , " java.base/jdk.internal.misc=ALL-UNNAMED" , " --illegal-access=warn" )
27
- .takeIf { JdkInfoService .provide().version > 8 }
28
- ? : emptyList()
29
-
23
+ val debugCmd = listOfNotNull(DEBUG_RUN_CMD .takeIf { Settings .runChildProcessWithDebug })
24
+ val javaVersionSpecificArguments = OpenModulesContainer .javaVersionSpecificArguments
30
25
val pathToJava = JdkInfoService .provide().path
31
26
32
- listOf (pathToJava.resolve(" bin${File .separatorChar} java " ).toString()) +
27
+ listOf (pathToJava.resolve(" bin${File .separatorChar}${osSpecificJavaExecutable()} " ).toString()) +
33
28
debugCmd +
34
29
javaVersionSpecificArguments +
35
30
listOf (" -javaagent:$jarFile " , " -ea" , " -jar" , " $jarFile " )
36
31
}
37
32
38
33
var errorLogFile: File = NULL_FILE
39
34
40
- fun start (port : Int ): Process {
41
- val portArgument = rdPortArgument(port )
35
+ fun start (rdPort : Int ): Process {
36
+ val portArgument = rdPortArgument(rdPort )
42
37
43
38
logger.debug { " Starting child process: ${cmds.joinToString(" " )} $portArgument " }
44
39
processSeqN++
@@ -54,6 +49,9 @@ class ChildProcessRunner {
54
49
if (! UtSettings .useSandbox) {
55
50
add(DISABLE_SANDBOX_OPTION )
56
51
}
52
+ if (UtSettings .logConcreteExecutionErrors) {
53
+ add(logLevelArgument(UtSettings .childProcessLogLevel))
54
+ }
57
55
add(portArgument)
58
56
}
59
57
@@ -62,10 +60,10 @@ class ChildProcessRunner {
62
60
.directory(directory)
63
61
64
62
return processBuilder.start().also {
65
- logger.debug { " Process started with PID=${it.getPid} " }
63
+ logger.info { " Process started with PID=${it.getPid} " }
66
64
67
65
if (UtSettings .logConcreteExecutionErrors) {
68
- logger.debug { " Child process error log: ${errorLogFile.absolutePath} " }
66
+ logger.info { " Child process error log: ${errorLogFile.absolutePath} " }
69
67
}
70
68
}
71
69
}
@@ -75,7 +73,7 @@ class ChildProcessRunner {
75
73
private const val ERRORS_FILE_PREFIX = " utbot-childprocess-errors"
76
74
private const val INSTRUMENTATION_LIB = " lib"
77
75
78
- private const val DEBUG_RUN_CMD = " -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005 "
76
+ private const val DEBUG_RUN_CMD = " -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5006 "
79
77
80
78
private val UT_BOT_TEMP_DIR : File = File (utBotTempDirectory.toFile(), ERRORS_FILE_PREFIX )
81
79
0 commit comments