Debugging Your DSS Script Using CCS

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Contents

Background

Debug Server Scripting and Code Composer Studio v4 are both built upon the same Debug Server foundation. Recent changes to DSS/CCS enable us, within the same instance of a Java Runtime to invoke both DSS and CCS and have both tools share the same Debug Server instance. The result is that target state is reflected in both tools.

We're going to leverage this fact and demonstrate an easy way to debug your DSS JavaScript by using the Rhino Javascript debugger to step through the script code while using CCS to inspect what is happening with the target.

Note: Some of the screenshots show an older version of CCSv4, hence the screenshots may be slightly outdated (but are still relevant)

Setup

First we're going to need to make a small change to '<INSTALL DIR>\CCSv4\scripting\bin\dss.bat' and the script we'll be debugging. If you have your own batch file / shell script you need to make a similar change.

See this section of the DSS topic for more information.

script.getServer("CCSServer.1").openSession(".*");

This can be added anywhere after the ScriptingEnvironment is created:

// Create our scripting environment object - which is the 
// main entry point into any script and the factory for   
// creating other Scriptable Servers and Sessions
 
var script = ScriptingEnvironment.instance();
 
// Open a CCS Session to bring up the CCSv4 GUI which will share the same debug context
script.getServer("CCSServer.1").openSession(".*");

Debugging

Fig. 1: Setting a Rhino Breakpoint
Fig. 2: Running to the Rhino Breakpoint
Fig. 3: Target Configuration Mismatch Error
Fig. 4: Rhino Debugger and CCSv4

Running from a Java Application

If you are using DSS from a Java application and you wish to launch CCS, you will need to add the following JAR file to your CLASSPATH before running the Java application:

<INSTALL DIR>\ccsv4\eclipse\startup.jar
Leave a Comment

Comments

Comments on Debugging Your DSS Script Using CCS


Tritan said ...

What about CCSv5.0.2? There is no 'startup.jar' and chanching to 'plugins\org.eclipse.equinox.launcher_1.1.0.v20100507.jar' doesn't help.



--Tritan 10:27, 12 April 2011 (CDT)

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox