• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Development Tools » TI C/C++ Compiler » TI C/C++ Compiler - Forum » retrieving dwarf symbol information of global variables
Share
TI C/C++ Compiler
  • Forum
Options
  • Subscribe via RSS

retrieving dwarf symbol information of global variables

retrieving dwarf symbol information of global variables

This question is answered
Raoul Herzog
Posted by Raoul Herzog
on Jul 23 2012 13:24 PM
Prodigy20 points

Hello,

 

I would like to retrieve the basic type, array size, and physical address of global C variables.

I'm using ccs4 for the C2000 family.

As an example take the following C program:

unsigned int testvar[2];

void main(void) {  
   testvar[0]++;
}

I compile with "Full symbolic debug (--symdebug:dwarf, -g)"
When I parse the .out file with

ofd2000.exe -gv -o project.xml -x project.out

I can't find the symbol infos related to the variable testvar?!

Thanks in advance for any hints.

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • AartiG
    Posted by AartiG
    on Jul 24 2012 10:01 AM
    Guru70675 points

    The output of ofd2000 should have something that shows the address of testvar. I don't believe it directly shows the size of array though and that may be something you'd need to compute from the symbol table using a script or something similar.


    If a post answers your question please mark it with the "Verify Answer" button

    Search the wikis for common questions: CGT, BIOS,  CCSv3, CCSv4
    Track a known bug with SDOWP. Enter the bug id in the "Find Record ID" box

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Raoul Herzog
    Posted by Raoul Herzog
    on Jul 25 2012 03:43 AM
    Prodigy20 points

    I almost solved my problem. The last issue concerns two-dimensional arrays e.g.

    int table[3][4]

    The dwarf information shows only DW_AT_byte_size (which in fact is Word size) and equals 12 for the example before.

    But I don't know how to retrieve row and column dimensions from the dwarf info??

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • George Mock
    Posted by George Mock
    on Aug 09 2012 11:11 AM
    Verified Answer
    Verified by George Mock
    Guru52645 points

    The Dwarf array information, that includes the DW_AT_byte_size information you found, should appear similar to this ...

        000000f3   1    DW_TAG_array_type
        000000f4           DW_AT_byte_size 48
        000000f5           DW_AT_language  DW_LANG_C
        000000f6           DW_AT_type      .debug_info(5) + 0xe2
        000000fa   3       DW_TAG_subrange_type
        000000fb              DW_AT_upper_bound 2
        000000fc   3       DW_TAG_subrange_type
        000000fd              DW_AT_upper_bound 3
    The DW_TAG_subrange_type tags have the attibutes you need.
    Thanks and regards,
    -George

    TI C/C++ Compiler Forum Moderator
    Please click Verify Answer on the best reply to your question.
    The Compiler Wiki answers most common questions.
    Track an issue with SDOWP. Enter your bug id in the "Find Record ID" box.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use