TMS320F28035: Trouble generating symbol table and .map file

Part Number: TMS320F28035
Other Parts Discussed in Thread: TMS320F2812

Tool/software:

Team,

Forwarding a customer query - 

Family : C2000

Processor: TMS320F28035

Compiler - v18.12.3.LTS

Output format- COFF Legacy

 

Compiler Options: 

-v28 -ml -mt -O4 --opt_for_speed=5 --fp_mode=relaxed --fp_reassoc=off --advice:performance=all --define=BUILDCONFIG_DISABLE_WATCHDOG=0 --define=BUILDCONF_ENABLE_DEBUG_OUTPUTS=0

 

Linker Options: 

-g --c99 --diag_wrap=off --display_error_number --abi=coffabi --asm_define=GLOBAL_Q=16 -z -m"AmcFirmware.map" --stack_size=0x400 --warn_sections --reread_libs --disable_auto_rts --diag_wrap=off --display_error_number --xml_link_info="AmcFirmware_linkInfo.xml" --rom_model -o "AmcFirmware.out

 

Debug Options:

Debugging Model: Full symbolic debug (--symdebug:dwarf,-g)

Dwarf Version:3

 

Language Option:

C Dialect : --c99

 

Symbol Table Generation Tool:

COFF2STB

 

I am working on one of the projects which is utilizing the above specification for generating build output as (.out) format.  

 

We are not able to produce the full symbol table and also .map file shows me limited variables. Many variables are left out like 

  1. Global variable declared with "static".
  2. Structure members are not coming in the symbol table section. Only structure base address we are able to see.
  3. Data Type of all the variable produced in the symbol table section is "6" means INT32 - 32-bit integer.
  4. The tool (COFF2STB)which I am using to generate symbol table(.stb) file from (.out) output format is not able to fetch the correct symbol data type from it. The memory section for symbol table which is generated in the (.out) file is not producing correct debug information.

 

Please advice us below things:

 

  1. What options compiler we have to enable to produce correct symbol table information with all the variables.
  2. What is the correct Dwarf debug options we need to use.
  3. What is the way to generate different output format(.EABI) if we are migrating from COFF.
  4. What is the correct compatible compiler or CCS IDE version if want to remain in same COFF legacy output format.
  • I am not familiar with the utility COFF2STB.  The C2000 compiler is not documented or tested to work with it.  

    Global variable declared with "static".

    To see static variables in the linker map file, use the option --mapfile_contents=sym_defs.  

    Structure members are not coming in the symbol table section.

    Unfortunately, that is not supported.

    Data Type of all the variable produced in the symbol table section is "6" means INT32 - 32-bit integer.

    The data type in the COFF symbol record is not used.  Instead, the data type information encoded in the Dwarf is used.

    What is the correct Dwarf debug options we need to use.

    The option --symdebug:dwarf (short equivalent -g) is on by default.

    What is the way to generate different output format(.EABI) if we are migrating from COFF.

    The key change is to add the compiler option --abi=eabi.  For more details, please see the article C2000 Migration from COFF to EABI.

    What is the correct compatible compiler or CCS IDE version if want to remain in same COFF legacy output format.

    As of this post, the default ABI for the C2000 compiler is the older COFF ABI you currently use.  That will change in the future.

    Thanks and regards,

    -George

  • Background:

    In our previous program with TMS320F2812 we were using TI Code Composer Studio Version 3.3.38 and Compiler CCStusio V3.2.  With the following complier and linker options.

    Compiler Options=-gp -q -pdw -pds9 -pds232 -al -as -fr"$(Proj_dir)\Release"

    ["Linker" Settings: "Release"]
    Options=-c -f0x0 -heap0x1C00 -m".\Release\OCU_MON.map" -o".\Release\OCU_MON.out" -stack0x4C0 -w -x

    It provided the COFF format .out file which had the symbol table in the STABS format. Our internal tool could parse this out file (STABS format) and extract the symbol details along with the data type.

     

    At present we are using TMS320F28035 processor with Compiler vesion - v18.12.3.LTS.

    Questions/Ask:

    1. What are the complier and linker options that we need to use so that we can get the same STABS format symbol table and the .out file as we used to get it for TMS320F2812 processor with compiler CCStusio V3.2.
    2. If Compiler Version - v18.12.3.LTS does not support the SATBS format symbol table. Can you suggest a compiler version that is active and support the STABS format.
    3. If choose to stay with Compiler vesion - v18.12.3.LTS for TMS320F28035, what is the closest format that we can generate? Please provide the complete definition of the format including symbol table and other dwarf sections that are needed ) to extract the symbols and datatype.

               Please provide the complier and linker options as well.

  • What are the complier and linker options that we need to use so that we can get the same STABS format symbol table and the .out file as we used to get it for TMS320F2812 processor with compiler CCStusio V3.2.

    For the compilers that support it, the option is --symdebug:coff.  Even though this option says coff, it means STABS debug format is used.

    If Compiler Version - v18.12.3.LTS does not support the SATBS format symbol table. Can you suggest a compiler version that is active and support the STABS format.

    Compiler version 15.12.7.LTS is the last one to support --symdebug:coff.  It is not active.

    If choose to stay with Compiler vesion - v18.12.3.LTS for TMS320F28035, what is the closest format that we can generate?

    That version only supports Dwarf debug format, which is very different from the older STABS format.

    Please provide the complete definition of the format including symbol table and other dwarf sections that are needed ) to extract the symbols and datatype.

    Please see the articles A Brief History of TI Object File Formats and Dwarf 4 in TI Compilers.

    Thanks and regards,

    -George

  • Hi George,

    1. The customer needs debug information format for Dwarf 3,4 and EABI. Looks like this link is broken https://processors.wiki.ti.com/index.php/DWARF_4 
    2. Also, can you share a comparison of the coff(STABB format) vs dwarf3 vs dwarf4 changes? (with regard to symbol definitions, type definition)
    3. Would the global static variables come into the symbol table section in Dwarf?
    4. For the variables of type structure, can we get info of address and type at each primitive structure element
  • The customer needs debug information format for Dwarf 3,4 and EABI.

    That's available in the DWARF standard.

    Looks like this link is broken https://processors.wiki.ti.com/index.php/DWARF_4 

    Use Dwarf 4 in TI Compilers instead.

    share a comparison of the coff(STABB format) vs dwarf3 vs dwarf4 changes?

    They are both formats for debug information.  Other than that, they are so different, it does not make sense to compare them.

    Would the global static variables come into the symbol table section in Dwarf?

    Information about symbols is in multiple places.  ELF object file format includes a symbol table.  And, lots of information about symbols is in the Dwarf debug information.  A static variable is represented in both the ELF symbol table and in the Dwarf debug information.

    For the variables of type structure, can we get info of address and type at each primitive structure element

    I think you mean to ask for a utility that reads in Dwarf and dumps the layout of the structures encoded in it.  Unfortunately, we don't have any utility which performs that task. 

    Thanks and regards,

    -George

  • Hello George, I heard that the utility which comes with CCS package has "ofd" and "nm" utility in it and that can be used to display the dwarf dump from (.out) output file.

    ofd6x.exe --xml_indent=0 --obj_display=none --dwarf_display=none,symbols -g AmcFirmware.out > Dwarf.xml

    ofd2000.exe --xml_indent=0 --obj_display=none --dwarf_display=none,symbols -g AmcFirmware.out > Dwarf.xml

    Can you please suggest if any TI Tool/Utility I can use to dump the Dwarf debug sections. This can help me to write some scripts which can extract symbol information out of it. 

  • please suggest if any TI Tool/Utility I can use to dump the Dwarf debug sections

    You have already found the one utility we supply.  To learn more about it, please search for ofd2000 in the C28x assembly tools manual.

    Thanks and regards,

    -George