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.

GEL File Question

Other Parts Discussed in Thread: TMS320F28335

Hello,

Can someone help please; I am trying to write a GEL file to track the state of a local "x" variable in the main program (code shown below)

I am using CCS V5 on TMS320F28335 MCU

int main()

{

int x=0;

x++;

x=19;

return x;

}

 I am trying to use GEL file to step through the code to show the changes of the local variable “x” state. This is part of an automated approach for code test.

I tried this gel file below with no luck.

 

hotmenu SUTP_MON_APP_TEST()

{

 

 // Restart the program

    GEL_Restart();

                   

                    // Reset the break points

                    GEL_BreakPtReset();

                    GEL_HWBreakPtReset();

                    GEL_TextOut("\nBEGIN TEST\n");

                    GEL_Run();                  

                    GEL_Go(main);

                   

 

                   

                    GEL_StepOver();

                    GEL_TextOut(" x = %d\n",,,,, x);

 

                    GEL_StepOver();

                    GEL_TextOut(" x = %d\n",,,,, x);

                     // Output the text in GEL output window

                     GEL_TextOut("\nEnd TEST\n");

 

}

                   

 

  • Nazeeh,

    I don't think GEL is your best option here.  I would suggest looking at Debug Server Scripting: http://processors.wiki.ti.com/index.php/Debug_Server_Scripting

    As for the above script you would want to remove the GEL_Run() since you have a GEL_Go() call as the next statement.  Basically you are saying run and then run to here.  Just have the GEL_Go(main).  However the rest of the script is going to have issues as GEL is not synchronous, it is not meant for this type of automation.  Many GEL functions are synchronous but GEL_StepOver is not.  Thus the GEL_TextOut statement will start to be executed before the StepOver is complete...

    If you want to track a variable changing I would instead setup a watchpoint that triggers whenever the variable is written.  You could then have your DSS script read the value and print it or you could change the breakpoint to execute a GEL expression that prints the value.

    Regards,

    John

  • John

    <<If you want to track a variable changing I would instead setup a watchpoint that triggers whenever the variable is written.  You could then have your DSS script read the <<value and print it or you could change the breakpoint to execute a GEL expression that prints the value.

    We need to automate as much as possible and

    GEL_WatchAdd() is depracated much to our chagrin in CCS5. I am experimenting with changing the breakpoint to execute a GEL expression that prints the value.

     

    Can you give an specific example of this command that that prints the value of a local and global value???

     

    Thx

     

  • Mark,

    Yes GEL functions that related to the GUI are not present in CCSv4 and later as the debugger and IDE are now separated and GEL is in the debugger.  GEL_WatchAdd() added a variable to the watch window and hence is not present in current CCS versions.

    For the expression to attach to a breakpoint I would suggest defining a small function and then have the breakpoint expression just being a call to that GEL function.  It is easier to edit that way.  Just add the GEL function to one of the GEL files you are loading.

    BP_Expression() {

    GEL_TextOut("Variable 1 value: %d, Variable 2 value %d ",,,,,variable1, variable2);

    }

    It will work with local or global variables, the only trick is that with local variables they have to be in scope when the expression is evaluated which shouldn't be a problem.

    Note that if you are doing a lot of automation then GEL is a real pain.  That example script in the first post is just not going to work as GEL_StepOver() is asynchronous.  DSS on the other hand is synchronous and you can run everything outside of the GUI.

    Regards,

    John

  • Hi John

    I fully understood the syncronous issues. The previous poster works with me and is new to GEL and his focus is unit test/code coverage my focus is integration testing and we are under schedule pressure. Management is open to our tests being repeatable and non manual but we cant afford to train groups of testers on GEL or DSS so I HAVE BEEN TASKED  TO SEE IF dss buys us anything or if we need the features it provides. does GEL or DSS provide ability to write local variables ? How? with DSS how is the sync accomplished so that the local is in scope? breakpoints in DSS? Todd Anderson spoke highly of you and said Hi

  • Mark,

    For coverage on F28x I would suggest looking at VectorCast, LDRA, ParaSoft or Klocwork.  They have some good commercial offerings that work well with our tools.

    Both GEL and DSS can write to local variables.  GEL is the expression evaluator in the debugger.  I.e. when you enter in a value into the expressions/watch view or the little box at the top of a memory view it is using GEL to evaluate that.  GEL has access to all the symbols in the debugger.  So in GEL if you want to set the value of local variable john to 1 you just have a line that says john = 1;  The processor needs to be halted where john is in scope or it will not be able to resolve john.  DSS has APIs that you can use to do the same, it is a bit more elaborate as it is a scripting solution.  It would be something like this:

    var addressJohn = mySession.symbol.getAddress("john");

    mySession.memory.writeWord(0, addressJohn, 1);


    You can set breakpoints in DSS as well.  The API reference is available in the CCS install here: /ccsv5/ccs_base/scripting/docs/DS_API/index.html

    There is a wiki topic on DSS here: http://processors.wiki.ti.com/index.php/Debug_Server_Scripting

    There are a couple breakpoint example scripts included and there is some info on the breakpoint wiki topic as well: http://processors.wiki.ti.com/index.php/Breakpoint

    The nice thing about breakpoints is that you can set any type of breakpoint in DSS that you can from the GUI including watchpoints..  With GEL you were pretty limited on what you could do.

    I generally recommend DSS for a number of reasons:

    • Can run outside of CCS and is suitable for operations that may last hours or days, including looping through many test sequences.
    • You can debug your script.  Debugging a GEL script is a pain and you basically use printf (GEL_TextOut) to debug your script
    • GEL scripts can be working and then just stop due to changes in timing.  i.e. if you are using some of the asynchronous API calls it may work fine by pure luck and then stop working later when your program changes or your machine runs a bit slower...
    • API set is much richer than GEL.
    • Access to a full scripting language.  GEL is a subset of C where as with DSS you typically use JavaScript and have access to everything in the language, arrays, file access...

    I hope Todd is doing well.


    Regards,

    John