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/CCSTUDIO-SITARA: C++ code, Cannot see variables class in debugger

Part Number: CCSTUDIO-SITARA

Tool/software: Code Composer Studio

Hello,

J am using CCS Version: 6.1.2.00015 with the Sitara processor.

I re-write my code to improve it in C++ language, If I debug it, impossible to watch the content of a class.

My code:

1: childClass.cpp

class ChildClass
{
    public:
        ChildClass();
        virtual ~ChildClass();

        unsigned short  value0;
        unsigned short  value1;
};

2: MasterClass.cpp (contains a childClass):

class MasterClass
{
    public:
        MasterClass();
        virtual ~MasterClass();

        unsigned short masterValue;

        ChildClass m_child;
};

 

3: CppCall.cpp (main class, contain  global masterClass):

MasterClass* m_pMaster;                        // global MasterClass* generate by a new (heap)
MasterClass m_pMasterPlat;                    // global Masterclass generate in the .bss segment (pInit zone)

void MainCall(unsigned short nAlStatus)
{    
    if (m_pMaster == NULL)
        m_pMaster = new MasterClass();    // allocate it in the heap zone

    m_pMaster->masterValue = 5;    
    m_pMasterPlat.masterValue = 10;

return 0;      // breakpoint HERE
}

 

4:The watch résult after the breakPoint:

It's ok for the MasterClass generate in the .bss zone:


 

It's bad for the MasterClass generate by the new:

 

The Expressions Window:

 

Is there any options to enable the acces to this variables ?

In another post I find this reply: "If the full symbolic debug is turned on and the optimizer is off", so, in what sections these parameters are precisely located ?

Jm

  • Try to use *m_pMaster in the expression window.
    Stephen
  • I am able to open m_child; however, I am using C2000 compiler v15.12.4.LTS.
    Stephen
  • Please test whether or not adding the volatile keyword to the m_child member variable corrects the issue, i.e.

    class MasterClass
    {
        public:
            MasterClass();
            virtual ~MasterClass();
    
            unsigned short masterValue;
    
            volatile ChildClass m_child;
    };

  • Hello and thank for your answers,

    In first I rename : "MasterClass m_pMasterPlat" in "MasterClass m_masterPlat"
    It's better for the understanding because it's not a pointer class...

    In the expressions window I add *m_pMaster : bad résult.
    I add the term "volatile" before the déclaration: bad résult.
    For the compiler, I am using the GNU v4.8.4 (Linaro).

    JM
  • I forgot to mention, I am using CCSv6.2.  There may be an issue with  CCSv6.1.2.  I don't have 6.1.2,but I do have 6.1.1 and 6.1.3.  I'll try those and get back with you.

    Stephen

  • I get the same results with CCSv6.1.1.
  • See Known issue when using CCS 6.1/Linaro GCC 4.8.4 section in processors.wiki.ti.com/.../Using_GCC_with_Tiva_in_CCSv6.

    Does that help?
  • Sorry, that might not be related to your problem. Is 0x800591D8 a RAM location? Where is your stack located?
  • A ccs version porblem, Humm, this seems unlikely.
    Tomorow, I install the CCSv6.2 version and I try again.

    Sorry, the link is bad ?

     processors.wiki.ti.com/.../Using_GCC_with_Tiva_in_CCSv6.

  • In the map file:
    Name Origin Length Attributes
    SRAM_LO 0x402f0000 0x00000400 xrw
    SRAM_HI 0x402f0400 0x0000fc00 xrw
    OCMC_SRAM 0x40300000 0x00010000 xrw
    DDR3 0x80000000 0x04000000
    *default* 0x00000000 0xffffffff

    the stack was located in the DDR3:

    .stack 0x8005de90 0x4000
    0x8005de90 __TI_STACK_BASE = .
    0x8005de90 __stack = .
    0x80061e90 . = (. + __TI_STACK_SIZE)
  • I'm not sure why the link doesn't work when I post it, but it works if I copy it directly into the web browser.

    processors.wiki.ti.com/.../Using_GCC_with_Tiva_in_CCSv6
  • Ok, it's located in DDR3, but not the stack.
  • Ok, your link work.
    I don't understand in the map file, i have two STACK and HEAP informations:

    First:
    ------
    ...
    DDR3 0x80000000 0x04000000
    *default* 0x00000000 0xffffffff

    Linker script and memory map

    0x00000400 HEAPSIZE = 0x400
    0x0001c000 STACKSIZE = 0x1c000
    LOAD ./EcatStack/SampleApplicationInterface.o
    ...


    Secund:
    -----------
    ...
    LOAD ./Axis/masterClass.o
    0x00004000 __TI_STACK_SIZE = 0x4000
    0x00004000 __STACK_SIZE = __TI_STACK_SIZE
    0x00000000 __HEAP_SIZE = 0x0
    LOAD D:\Projects\Pilotage\6_Products\CNumDsp2015\src\AxisDriver\am335x_debug\configPkg\package\cfg\am335x_app_pa8fg.oa8fg
    ...

    Tomorow, I try to find if he heap size was 0x400 or 0...

    JM
  • Hello,

    We are again focus on this suject: impossible to see class variables in the "Watch Expresssions" window while debugging with ccsv6.

    The configuration we are using is the following:

      • Code Composer Studio version CCS 6.1.2 (but we tried CCS 6.1.1 and it is the same problem)
      • SYS/BIOS 6.42.2.29 Real Time Operating System
      • XDC Tool 3.31.2.38_core
      • Compiler GNU v4.8.4 (Linaro)

    It is important to precise that we are coding in C++ (that's obvious because we are using classes).

    We have made the follwing tests:

    1/ We tried to use C++ classes in another project witch is compiled with Texas Compiler TI v5.2.5 and here it is PERFECT: we can see all classes variables an we can even go into Child Class.

    2/ We have updated all our tools: CCS v7.1.0 with compiler GNU Linaro v4.9.3. And there is always the old same problem: impossible to see classes variables. It is even worst: we can't see neither the dynamic class nor the static one. And we have the error message you can see in attached.

    We have searched an explanation to solve this error (increase the heap size, the stack size, changing the debug option....) but nothing work !

    We tried to find something on the CCS Forum but nothing correspond to our problem.

    In my mind, I think the problem comes from the  GNU debugger because debugging seems to work well, while using TI Compiler.

    Is there anyone who can help us on this subject and give us any advice to debug easily because we are stuck for the moment.

    Thanks a lot for your help !

    Jean-Michel

  • jean-Michel Vignolles said:
    J am using CCS Version: 6.1.2.00015 with the Sitara processor.

    I re-write my code to improve it in C++ language, If I debug it, impossible to watch the content of a class.

    I created the attached example project for an AM335x based upon your code. AM335_GCC_class_variables.zip

    The project uses the GNU v4.9.3 compiler.

    When run under CCS 6.1.3.00033 I can repeat your results in that the debugger can display the value of m_pMasterPlat.masterValue, but can't display the contents of m_pMaster :

    I tried the same example with the "latest" CCS 7.1.0.00014 and the results are worse in that unable to display the contents of neither m_pMaster nor m_pMasterPlat :

    Given the change in behavior from CCS 6.1.3 to 7.1.0 I suspect a bug in how CCS is extracting the definition of the class types from the GNU debug information. Hopefully someone from TI will investigate. 

    I also tried the example program compiled with the TI ARM compiler, and CCS 7.1.0 was correctly able to display the values of m_pMaster and m_pMasterPlat.

  • Hello Chester,

    Thanks for your help,

    Yes, I am agree with your opinion: an incompatibilty between CCS and Gnu Debugger, I hope that someone from TI will be able to solve it fastly.

    Because we are actually in a dead end...

    Regards.

    JM

  • I noticed that someone from TI hasn't helped you yet.

    Does the following help?
    e2e.ti.com/.../415869
  • stevenh said:
    Does the following help?
    e2e.ti.com/.../415869

    In that thread found by stevenh the work-around was to build for DWARF2 .

    I don't have a Sitara device at the moment, but modified my previous test case to run in an EK-TM4C129EXL. TM4C_GCC_class_variables.zip Using CCS 7.0.0.00042 and the GNU compiler v4.9.3 I get the same problem if build for either DWARF4, DWARF3 or DWARF2. Example debug output when built for DWARF2:

    Therefore, building for DWARF2 doesn't work-around the problem in this thread on not being able to see class variables in the debugger.

  • Hello,

    We have also made the test with DWARF2 and we have exactly the same issue as Chester !

    So, nothing is resolved....

    We can notice that the problem seems to be worse with CCS v7 than with CCS v6 because before we managed to see more things in the watch window !

    Is there anyone who can give us a little help please ?

    Thanks a lot,

    Jean-Michel & Laurence