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.

Debug Sessions using Scripting Console of CCSv5.3

Hi

I have 2 queries related to Debugging Sessions from CCSv5.3 scripting console.

1. When I am debugging some .out file from the scripting console,my objective is to take several test cases and pass them to the C code. So after one debugging session, suppose the values stored in the C variables change - is it necessary to build the project again before debugging it for the next time to get the correct result?

2. I need to read the test case data from text files in the scripting console itself. Now these data have to be processed by the .c file that I am launching and Debugging. How can I do that?

Thanks in advance.

  • Hello,

    Sohini Chatterjee said:
    1. When I am debugging some .out file from the scripting console,my objective is to take several test cases and pass them to the C code. So after one debugging session, suppose the values stored in the C variables change - is it necessary to build the project again before debugging it for the next time to get the correct result?

    No, depending on how you are passing in these test vectors to the target application. If via C I/O or File I/O, you would not need to rebuild.

    Sohini Chatterjee said:
    2. I need to read the test case data from text files in the scripting console itself. Now these data have to be processed by the .c file that I am launching and Debugging. How can I do that?

    You have a few options. You can simply have your application read in the test vector file via C I/O (fread, etc). Or you can have the debugger automatically read the file and write to target memory via File I/O (called "Read data from file" in the Breakpoints view). Or you can your DSS javascript do it by using Java file.io functions to read a file and use DSS memory APIs to write values to target memory. The first would add some overhead to your code in terms of additional code size. The latter two would not, but would rely on the target being halted and require the target connected to the debugger. Which you prefer is up to you.

    Thanks

    ki

  • Is there any document available for DSS memory APIs writing to target memory? I did not find any on the web.

  • The DSS API documentations comes with CCS. See:

    http://processors.wiki.ti.com/index.php/Debug_Server_Scripting#DSS_API

    Also see the Memory.js example in:

    <INSTALL DIR>\ccsv5\ccs_base\scripting\examples\DebugServerExamples

  • Thank you so much. I have got one more doubt - the DSS API can access the memory, but to know which exact location  is to be written into- how can I do that? I mean how can I know the exact memory location being used by the C variable? I read somewhere that using a pointer and taking it's value will not do the trick - because the OS shows a virtual memory location? 

  • Use the following API to get the address of the variable:

    symbol.getAddress(symbol);