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.

Compiler/TMS570LS3137: Symbol Table decoding help

Part Number: TMS570LS3137


Tool/software: TI C/C++ Compiler

Hello, 

First:

Windows 10
CCS 8.1
TMS570LS3137
DWARF 3 (I have tried 4)

Background:

I am trying to get info out of the Symbol Table regarding variable size/type. I have found some threads about using the armofd.exe with -v to parse my .out file and that gets me part of what I am looking for.

My issue involve having things like arrays of structs. I can find the size of the array (0x500), but then the Type is object. Or if i go through the .asm files i can kind of put together what I want, but its all $C$DW$82. 

My end goal is to find a way I can get the global variable addresses and create a Data Dictionary. The problem is when it comes to arrays I cant always figure out easily and there for the offset. I might know that an array has a size of 0x500, but i dont know how many entries it has or the size the of the each entry.

I did find the cgxml scripts but they seem dated and the readme files are pretty rough and not very clear.

Question:
What would be the best/easiest way to get the addresses, size, element size, and number of elements  of these variables? 

Thanks,

Ryan

  • Unfortunately, TI has no one solution which does what you describe.  The names utility armnm shows you the address of all the symbols.  It is documented in the ARM assembly language tools manual.  The utility global_types_gen from the cg_xml package shows you the layout of the structures.  To see the documentation for cg_xml, load the file cg_xml_install_location\index.htm into your web browser.  Those two solutions give you part of what you request, but not everything.

    Thanks and regards,

    -George

  • Hi George,

    Well, that global_types_gen, is actually really helpful.

    Is there a comprehensive list as to what each script does? There is no top level explanation to what all these do for what I can find. The readme.txt seems to only have changes and known issues.

    I mean, I can go through the perl files themselves but really, it seems like that index.htm should have a brief explanation next to the Script link. (I'm a lazy programmer, I know.)

    I have been reading spnu118u and have found a few of those programs helpful, but again there doesnt seem to be a quick reference of what they all do... just time consuming since I don't really know what I am looking for. (I am also using spnu151r for ARM Compiler references).

    One last question, should I be using DWARF 3 or DWARF 4? DWARF3 is default and since i am using C, not C++, not sure if it would be useful to use DWARF4.

    Thanks,

    Ryan

  • Ryan Hertzog said:
    Is there a comprehensive list as to what each script does?

    Look at the file readme.txt in the cg_xml_install_location\ofd directory.  This is mentioned in the Getting Started information.  But I can see how you would overlook it.

    Ryan Hertzog said:
    I have been reading spnu118u and have found a few of those programs helpful, but again there doesnt seem to be a quick reference of what they all do

    Every command supports the option --help.  It dumps out a quick summary, and line or two on what each option does.

    Ryan Hertzog said:
    should I be using DWARF 3 or DWARF 4?

    For what you are doing, it doesn't matter.  If you want to know more about Dwarf 4, please see this article.

    Thanks and regards,

    -George

  • I completely missed that readme.txt in the ofd folder. I was looking in the bin folder since I am running Windows, which does not have a readme.txt file in it. With that said, it does look like the readme.txt in the ofd folder is close enough for what I was looking for.

    One last question: Is there a script that will tell me "Variable Name", is of "Some Type", and is of "Some Size"? 

    If so, my idea is to parse the .map file to find my global variable names and address. Then I can parse this other file to find the type and size of the variable... and finally, if required, I can parse the global_types_gen output to get the struct data.

    As of now, I am just missing the variable type and size.

    Thanks for all the help.

    -Ryan

  • Ryan Hertzog said:
    Is there a script that will tell me "Variable Name", is of "Some Type", and is of "Some Size"? 

    Unfortunately, no.

    Thanks and regards,

    -George

  • George Mock said:

    Unfortunately, no.

    So close!

    Thanks for all the help. I think that got me about 70% of what I needed.

    -Ryan