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.

Local, Watch Strings in CCS Debugger



I have looked around but, for the life of me, cannot find out how to display the entire string in the local and watch windows of the CCS debugger. All i ever get is the first character of the string and nothing more. I cannot find any option, context menu entry to show the entire string (not in a memory window but in the local/watch window). Anyone have any "hints" for me?

Thanks, Jon

CCS 4.1.3.00038

  • Hi Jon, 

    What is the defined type of the string that you are trying to watch? 

    Martin

     

  • Hi Martin,

    char name[16] displays 16 characters one per line as (*)=[0]...

    char *name displays the 1st character  as "(*)=*(name) /" but none of the other characters.

    this behavior makes if very hard to watch the value of char * string as

    1 - you can't see the value of the string without going to the memory window.

    2 - if you are trying to watch a local variable, then it moves in memory each time you stop,
    so you have to re-access the memory window rather than just clicking on the run button.

    Jon

     

  • Hi Jon, 

    I think original CCSv4 did not have this support, but I checked 4.1.1, 4.1.2 and 4.1.3 (specifically build 38) and they all seem to be working correctly. Keep in mind that watch window is hard coded to only read 10 characters of a char *. 

     

    below is an example that I used

     

    char testName[16];

    testName[0] = 'a';

    testName[1] = 'b';

    testName[2] = 'c';

    testName[3] = 'd';

    testName[4] = 'e';

     

    if I add testName to ww and expand the array then I see above characters. Also, if I enter "(char *) testName" into watch window then I see "abcde" displayed in value column, right after the address. If I click on the +  then I only see one character being displayed. 

     

    Martin

     

     

  • Martin,

    I am thinking that a more concrete example would help:
    CCS: 4.1.3.00038; Stellarisware: 6288; App: enet_io.c; Module: lmi_fs.c;
    I have included a snapshot of the variable window with a breakpoint set at the last line of the code below. You can see that only the leading "/" of the string is shown where the entire string is "/index.shtml".

    Thanks, Jon

    struct

     

    fs_file *
    fs_open(
    char *name) {
    char *data;
    int i;
    const struct fsdata_file *ptTree;
    struct fs_file *ptFile = NULL;
    //
    // Allocate memory for the file system structure.
    //
    ptFile = mem_malloc(sizeof(struct fs_file));
    if(NULL == ptFile) {
    return(NULL);
    }
    //
    // Process request to toggle STATUS LED
    //
    if(strncmp(name, "/cgi-bin/toggle_led", 19) == 0)

     

     

  • Hi Jon, 

    I see it now. The compiler re-adjusts name's type to unsigned char *, which triggers the issue. As workaround you should be able to cast it to char * ; enter "(char *)name" in watch window. I have filed SDSCM00037891 to track this issue. 

    Martin

     

  • Martin,

    Good. I am glad that it is going to get fixed and thanks for the work around.
    However, now the 10 character limit is, well a limit on debugging.
    Can we get more than 10, or a user option for more than ten, or the vertical display that's used for arrays, or ...
    There must be something that can be done that would make this more useful to the community???

    Thanks for your efforts in helping out, Jon

  • I just ran into this problem in CCS7.1.0.00016 trying to view the uart Printf buffer.

    One (crappy) workaround is to put

    (uartPrintf_outArray + ((uartPrintf_tail + (0 * 10)) & 2047))
    (uartPrintf_outArray + ((uartPrintf_tail + (1 * 10)) & 2047))
    (uartPrintf_outArray + ((uartPrintf_tail + (2 * 10)) & 2047))
    (uartPrintf_outArray + ((uartPrintf_tail + (3 * 10)) & 2047))
    (uartPrintf_outArray + ((uartPrintf_tail + (4 * 10)) & 2047))
    ...

    In the Expressions viewer but that gets really tedious really fast with a 2k buffer.

    GDB has a print elements setting for this exact purpose, is there any way to make CCS show more than 10 characters?