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.

Missing variables in DWARF with ofd2000



Hi,

I'm using C2000 compiler, version 5.2.12, and when I use the ofd2000 some of my variables are missing in the Dwarf section but are visible in the Coff section. Is this a normal behaviour. I always thought that all the debug information is visible in the Dwarf and the coff is not usefull for me since I'm generating a tree view of variables of the code.

From what I've seen, the missing variables are globals,  assigned to a section using pragma, used in the code and shown in the map file.

In the code:

In h file:

#pragma DATA_SECTION( "applversion" );
BuildInfo buildInfo;

In Cpp file:

SetBuildInfo( &buildInfo,
PRGM_VERSION_MAJOR,
PRGM_VERSION_MINOR,
PRGM_VERSION_LIVR,
PRGM_VERSION_REV );

In the map file:

0030000c _bootCan2Id
000007f0 _buildInfo
0031f882 _c_int00

Thanks

David

  • The ofd2000 utility does not show the Dwarf debug information by default.  You have to use the -g option.

    Thanks and regards,

    -George

  • I'm already using the -g option but the variable is not in the dwarf section of the xml output file it is only listed in the coff section of the xml. Is it normal that some variables are in the coff but not in the dwarf?
  • It is unusual to have these lines ...

    #pragma DATA_SECTION( "applversion" );
    BuildInfo buildInfo;

    in a header file.  In fact, that normally causes an error when you link.  Those lines should appear only once in the entire build.  The header file should only have ...

    extern BuildInfo buildInfo;

    If that doesn't fix the problem, then I need a test case.  I presume the same error occurs if you build only one source file down to object.  A test case that only has one source file is much easier to work with.  Preprocess it and attach the resulting file to your next post.  I also need to know the compiler version and the options used.

    Thanks and regards,

    -George

  • I'm sorry I made a mistake in my original statement. You are right, the pragma and declaration are in the cpp file and there is a simple extern in the header file. So I will try to produce a simple test and post the result.

    Thanks.