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.

How to use CCS Scripting Console?



Hi

I am familiar with using DSS to automate a debug session.  However, I just want to run some small scripts while running a debug session in CCS.  To get started, I just want to dump the contents of a variable to a file.  In DDS I would start with something like:

var address = debugSession.symbol.getAddress("sineTable")

but if I run that I get:

ReferenceError: "debugSession" is not defined.

How can I dump the contents of a variable, during a CCS session, using the scripting console please?

Best regards

David

  • Hi David,

    David Aldrich92784 said:

    In DDS I would start with something like:

    var address = debugSession.symbol.getAddress("sineTable")

    Actually the first thing you would do in your DSS script is something like this:

    var script = ScriptingEnvironment.instance();.

    Then you'd get your debug server by doing something like this

    var debugServer = script.getServer("DebugServer.1")

    then you'd configure the debug server for a specific target:

    debugServer.setConfig("../C64/tisim_c64xple.ccxml");

    Then you'd open a debug session and pass the handle to a custom variable like 'debugSession'

    var debugSession = debugServer.openSession(".*")

    Then you can use debugSession::

    var address = debugSession.symbol.getAddress("sineTable");.

    When you open a scripting console, a scripting environment is automatically created. It is called 'env'. Using env, you can the get the debug server and so forth. If you have already started the debugger manually, then a debug server has been created and you can use it in the console. It is 'ds'. If you did not launch the debugger, then 'ds' will not exist.

    Thanks

    ki

  • Hi Ki

    Thanks for your answer - particularly the information about 'env' and 'ds'.

    Is this documented anywhere?

    Can I see the methods available for an object such as 'env' by hitting tab, or something, in the scripting console?

    How can I get the current working directory from within the console (I need that so I can access files) ?

    BR
    David

  • Based on MATLAB R2013A and the latest version of CCS5.5 model design platform - SXD28335B

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/304404.aspx

  • David Aldrich92784 said:

    Thanks for your answer - particularly the information about 'env' and 'ds'.

    Is this documented anywhere?

    See: http://processors.wiki.ti.com/index.php/Scripting_Console#Services

    David Aldrich92784 said:
    Can I see the methods available for an object such as 'env' by hitting tab, or something, in the scripting console?

    Yup. It's TAB

    David Aldrich92784 said:
    How can I get the current working directory from within the console (I need that so I can access files) ?

    I'm not aware of a way to do this. Maybe using the java file.io. It has been something people have tried with mixed results.

    Thanks

    ki

  • Hi Ki

    Thanks for your help, but I haven't quite got it.

    If I hit TAB in the scripting console, I don't see env and ds.  The wiki:

    http://processors.wiki.ti.com/index.php/Scripting_Console#Custom_Console_Commands

    just calls them 'console commands'.

    Are those commands methods of javascript objects (such as ds) or are they mini-Javascript files?

    If the latter, are they actually viewable in the ccs installation tree?

    BR
    David

  • David Aldrich92784 said:
    If I hit TAB in the scripting console, I don't see env and ds.  The wiki:

    Sorry I misunderstoond. TAB will autocomplete if you have an existing object typed. Just typing in TAB will not show the list of services. To see them, as per the wiki:

    Using the 'services' command will echo the list of services to the console.

    David Aldrich92784 said:

    They are not console commands. You are reading the section above the services. ds and env are NOT console commands.


  • They are not console commands. You are reading the section above the services. ds and env are NOT console commands.

    I understand. But 'execCmdFile' is a console command.  Is that a method or a script?

    David

  • That command is likely a javascript function in a pre-loaded script. It can execute a console command file (this is different that a DSS javascript).