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/AM4377: Debug Server Scripting: How to fail a code in the catch block instead of quit

Part Number: AM4377

Tool/software: Code Composer Studio

Hi ,

I have the below code : 

// Load the program
try{
debugSession.memory.loadProgram( programToLoad );
}
catch(ex){
script.traceWrite("Unable to load the program");
quit();
}

Here instead of quit() I need to exit with some error so that the program which called it will fail in its try block.

Kindly let me know if there is any way ot tag do it in Debug Server Scripting.

Regards,

Dhanya

  • Dhanya,

    You could typically employ the Java system call with a given errorlevel as shown below:
    java.lang.System.exit(errorlevel);

    For a more comprehensive method of use, please check the JTAG benchmarks script at the reference below. The main script inside the .zip file is named <Benchmarks.js> and you can study it to get ideas on how to implement different errorlevels depending on the status of the program.

    processors.wiki.ti.com/.../XDS_Performance_comparison

    Hope this helps,
    Rafael