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 5.3 expression windows failed to load global static variables

Other Parts Discussed in Thread: OMAPL138

when stop-mode debug linux kernel, global static variable cannot showed in expressions window, even when PC is at the same source code with the variable.

I'm sure the vmlinux has the varialbe in symbol tables, checked by "objdump -t vmlinux".

In the memory window, the variable can be found  using the address in objdump, but cannot searched by input the variable name.

following snap show the static global variable gpio_bank. It is unknow in expresstion window, but can showed in memory browser.

But it is ok In simple program like this:

#include <stdio.h>
int aaaaaa=1;
static bbbbb=2;
int main(void) {
    printf("Hello World!%d\n",aaaaaa+bbbbb);
    return 0;
}

I hope this problem is fixed in ccs 5.4, but the installation is failed. see http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/276463.aspx

  • The same problem exists in CCS 5.4.

    Try another static variable:

    Tried to upload the vmlinux twice, both failed.

    Best regard,

    Zhang Jianjun

  • workaroud:(take variable clockevent_davinci for example)

    1.find variable address:  objdump -t vmlinux | grep clockevent_davinci

    2.use the address and type convertion in expression window: (struct clock_event_device*)0xc028d970

    Can anyone confirm this bug? Following is my vmlinux for dm6446+nand.

    8182.vmlinux.rar

  • Zhang,

    What you say makes sense and I have been trying to reproduce this issue here without success, although I still need to get a board and a Linux distro.

    Did you see this happening with other static structs as well? This would help see if the problem is being originated from a particular member of the structure or is more general - sometimes optimization can confuse the debugger by optimizing or packing a struct, therefore I wonder if that may be what is happening.

    The workaround is sound, as the memory and expression views accept C-syntax and direct addresses.

    I will get back if I am able to make any progress in trying to reproduce this issue.

    Regards,

    Rafael

  • Rafael:

    I don't think is about struct. I tried simple progrom like this is ok:

    #include <stdio.h>

    struct point{
        int x;
        int y;
    };

    struct point AA={100,100};
    static struct point BB={200,200};
    /*
     * hello.c
     */
    int main(void) {
        printf("square of distance=%d\n",(AA.x-BB.x)*(AA.x-BB.x)+(AA.y-BB.y)*(AA.y-BB.y));

        return 0;
    }

    And tried basic variable type like int or int array, also wrong:

    static int timer_irqs[NUM_TIMERS] = {
    IRQ_TINT0_TINT12,
    IRQ_TINT0_TINT34,
    IRQ_TINT1_TINT12,
    IRQ_TINT1_TINT34,
    };

    static u32 [] = { DAVINCI_TIMER0_BASE, DAVINCI_TIMER1_BASE };

    static int tid_system;
    static int tid_freerun;

    And a funny thing happens to the array timer_irqs :

    timer_irqs is unknown when PC is in the file which  it is defined:

    But it's recognised as a pointer when run into another source file, where it's passed into a funnction as a parameter.

    Maybe something is wrong with Eclipse? I'll stop tring, and wait next release.

    Regards,

    Zhang Jianjun

  • Zhang,

    Unfortunately I don't have a DM6446 board with me to reproduce this using your vmlinux image. I tried to do the same with an OMAPL138 but I can't easily halt the kernel at a point where a similar construct is placed.

    I also confirm that a smaller project does not show this issue, therefore it may be tied to an array of factors.

    I will keep trying to reproduce this and see if this is reproducible in any way. In the meantime, the workaround you mentioned is sound.

    Also, you are correct in saying these views are from Eclipse, not the CCS debugger - although the debugger may be affecting this behaviour.

    I apologize for the inconvenience,

    Rafael

  • Rafael,

    Use H/W breakpoint may help. H/W breakpoints can be set before program loaded, but numbers are limited. S/W breakpoints must be set after program is loaded, and must reset after program reloaded.

    My sequence to debug kernel in ccs:

    1.load symbols from vmlinux

    2.pause the u-boot by hit enter when it count down the delay time.

    3.add an H/W breakpoint for "start_kernel"

    4.resume debuging, use u-boot to boot kernel. Debuger will stop at "start_kernel" after the kernel is loaded.

    5.now free to add S/W breakpoints for the function you want, and resume deuging.

    Regards

    Zhang JIanjun

  • Zhang,

    A development engineer was able to reproduce this issue (he has a DM6446 board) and suggested the following:

    Indeed, you need to use the file name to access file static variable.

    I think it is a bug that you need to qualify the variable with the file name if the current stack frame is at the source file. The syntax is

    ‘<path to file>’::<variable>

    or,

    ‘/home/aw/project/foo.c’::bar

    I will file a CQ for CCS v6.

    I hope the suggestion helps, and please apologize for the inconvenience.

    Regards,

    Rafael

  • Rafael,

    Thanks a lot ! It's much better than my workaround. I'll try it in Monday. Maybe you can add a page in wiki for it.

    Regards,

    Zhang JIanjun

  • Hello,

    I'm coming across same problem and I'm using CCS5.3.

    Attached is my Scnshot and it doesn't work even after I tried ‘<path to file>’::<variable>

    The code is pretty simple one and global var z is shown in correct value.

    Could you offer some suggestions to improve? Thank you.