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.

TestServer javascript doesn't work when launched from Scripting Console

Other Parts Discussed in Thread: CCSTUDIO

Hello,

 

I need to control the CCS Debug Server from a remote process, for automatic testing.

So, I am doing some experiments with TestServer javascript example, that seems to be a good base for our purposes.

In particular I have written a simple client that after establishing a TCP/IP connection with the server, sends some simple commands.

 

When I launch TestServer from a shell, using dss.bat, it works fine.

The server starts and accept the connection, and when I send the command {"name":"connect"}, the server responds {"status":"OK"}.

 

When, instead, I launch TestServer form CCS Scripting Console, I have the following problem.

The server starts and accept the connection, but when I send the command  {"name":"connect"}, the server responds {"status":"FAIL","message":"failed while parsing JSON command: undefined"}.

 

I am using CCS v.5.5.

 

Thank you,

Carlo

 

 

  • Hi Carlo,
    The DSS Test Server example was not designed to run from the Scripting Console. You must have modified test_server.js and TestServer.js. Can you attach your modified versions of the script?

    Thanks
    ki
  • Hi Ki,

    thank you for your answer.

    I have made a copy of the original example in a folder local to my CCS project and, to begin quickly my experiments, I have done the following mofications respect the original example:

    1. I have replaced the paths to .js files, that in the original example were based on the enviroment variable SCRPITING_ROOT, with absolute paths.

    2. I have specified my target configuration file.

    3. I have changed the debug session name (I have only one core).

    4. I have commented the custom command handlers.

    Thank you,

    Carlo

     

    TestServer.zip

     

     

  • Thanks. The issue is the eval call on line 155 of TestServer.js. The Scripting Console has its own eval command that overrides the default javascript eval command. That's why it fails in the Scripting Console and not from the command-line. I am providing a modified jar file that will rename the Scripting Console eval command to evalGel. This will prevent the override and have the default javascript eval function available, and have the script run correctly.

    To implement the workaround:
    1. extract the jar file from the attached zip file

    com.ti.ccstudio.scripting.dss_5.3.0.201308270800.jar.zip
    2. browse to <CCSv5 INSTALL DIR>\ccsv5\eclipse\plugins
    3. copy jar file in there (you can first rename the existing one first as a backup)
    4. open a command window and browse to <CCSv5 INSTALL DIR>\ccsv5\eclipse
    5. run the command: ccstudio.exe -clean (this will clean any cache first then launch CCS)

    That should be it

  • Hi Ki,

    thanks a lot for the support and the quick solution.
    It works perfectly!

    Carlo
  • Glad to see all is working now!

    Note that I filed a request to address this issue (tracking ID: SDSCM00051279). This fix will come in version 6.1.1. We do not have plans to release another patch for CCSv5 so the above workaround will still have to be used for v5.