This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS: DSS ScriptingEnvironment.instance() causes stdout/stderr closure



Tool/software: Code Composer Studio

I'll start by admitting that I am not using DSS directly from Java but rather from Python via javabridge.  Though, if I did it directly from Java the issue would likely just not be noticed.  Anyways, if i call ScriptingEnvironment.instance() then when I kill the Java VM from Python, using javabridge.kill_vm(), stdout and stderr also get closed.  If I just create the VM, create a Java String, then kill the Java VM, then Python is left with functional stdout and stderr.  These two cases can be chosen by setting fail to True or False resulting in either the last two prints showing or not.  I usually use ccstudiodss to interact with javabridge but for simplicity here I collapsed the code down as flat as I could.

import sys

import javabridge

jar_paths = [
    'c:/ti/ccs1010/ccs/ccs_base/DebugServer/packages/ti/dss/java/dss.jar',
    'c:/ti/ccs1010/ccs/ccs_base/DebugServer/packages/ti/dss/java/com.ti.ccstudio.scripting.environment_3.1.0.jar',
    'c:/ti/ccs1010/ccs/ccs_base/DebugServer/packages/ti/dss/java/com.ti.debug.engine_1.0.0.jar',
    'c:/ti/ccs1010/ccs/ccs_base/dvt/scripting/dvt_scripting.jar',
]
for jar_path in jar_paths:
    if jar_path not in javabridge.JARS:
        javabridge.JARS.append(jar_path)

javabridge.start_vm()

fail = True

if fail:
    ScriptingEnvironment = javabridge.JClassWrapper(
        'com.ti.ccstudio.scripting.environment.ScriptingEnvironment',
    )
    script = ScriptingEnvironment.instance()
else:
    String = javabridge.JClassWrapper(
        'java.lang.String',
    )
    s = String()

print('stdout: before killing')
print('stderr: before killing', file=sys.stderr)
javabridge.kill_vm()
print('stdout: after killing')
print('stderr: after killing', file=sys.stderr)