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.

Symbol Type Information

Is there an easy way to extract symbol information (name, address and TYPE) from any of the files/formats that can possibly be generated from a build?  I get  close using the map but am stumped regarding how to get type information.  Has anyone written an XML parser that would do this?  It's weird that there is a script that deciphers structure data ( ofd2000 -x -g a.out |  global_types_gen.exe ) but nothing I've seen will generate a list of scalar variables with addresses and types.  Does anyone have any hints?  I'd really not have to build a custom XML parse routine from scratch...

Thanks!

  • The names utility (nm2000 in your case) will show you names and addresses, but not types.  I'm not aware of any utility which shows all of that info.

    Dan K87420 said:
    I'd really not have to build a custom XML parse routine from scratch

    You don't have to start from scratch.  I suspect you are not aware the global_types_gen.exe is part of the cg_xml package.  That package includes the Perl source code implementation.  You can find the source for global_types_gen.pl in the \ofd directory in the package.  You could start with one of those Perl source files.

    The types are encoded in Dwarf.  So, you will probably need to understand the Dwarf standard a bit.

    When you get something working, I'd appreciate if you would post it here for others to use.

    Thanks and regards,

    -George

  • George, thanks for your response.

    I am aware of the cg_xml_package, but I've not worked with Perl so didn't want to open another can of worms - this is something that needs to be done quickly...

    I was just hoping I missed some obvious utility/linker option/tool/script that would give me a nice var adrs type list.

    I'm sort of surprised there is not.

    Some years back I wrote a Visual C app that contained such an animal for ELF and remember it being a pain.  I guess there is no easy way out unless someone else has any ideas...

    Thanks,

    Dan

  • Hello,

    I need the same information for a C2000 MCU.  I am looking for the symbol name, the type, and the address.  Did anybody ever create a perl script that inputs the .out file and generates this information?  If not, can you give me a little bit of advise on where to start.  I have beginner Python experience but am new to Perl.  I reviewed global_types_gen.pl and would like to have at least some good pseudo-code advise on where to start.  

    Thanks,

    Rick 

  • Rick Crispo said:
    Did anybody ever create a perl script that inputs the .out file and generates this information?

    I am not aware of such a script.

    Rick Crispo said:
    If not, can you give me a little bit of advise on where to start.

    The closest thing I know of is global_type_gen.pl, which you already have.

    Thanks and regards,

    -George

  • The debugger can display type information. So could TI not make that functionality available in a convenient form?

  • I filed SDSCM00050620 in the SDOWP system to request a command line utility which displays the type information for every variable.  The core of this utility would come from the part of CCS which displays the type of a variable.  Feel free to follow this request with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • Hi George,

    That is great!  You mentioned that it will report type information for every variable.  If the utility outputs type information for both local and global variables it will be very helpful to me/my company.

    Thanks,

    Rick 

  • Please do not interpret a request as a promise.

    Rick Crispo said:
    If the utility outputs type information for both local and global variables

    Global variables I'm sure about.  Local variables I'm less sure about.

    Thanks and regards,

    -George

  • Hi George,

    Thanks for the feedback.

    I strive not to use globals unless absolutely necessary.  Most of my code is locals.  So if the tool can't output the types of local variables it doesn't really help me.   But I reviewed your tracking number description and the way you wrote it was solid, e.g. "every variable."  

    Thanks much,

    Rick 

  • Could someone at TI please report the status of Incident Report SDSCM00050620.  According to SDOWP, it has been accepted .  Does that mean someone is working on it?

    Thanks,

    Stephen

  • I would like to add here that even if the tool only outputs symbol information about globals it would still help our company out alot. 

    Thanks,

    Rick 

  • stevenh said:
    Does that mean someone is working on it?

    No.  This feature request (along with many others) remains under consideration for implementation.  We have no firm plans to announce at this time.

    Thanks and regards,

    -George

  • Ok.

    It looks like it might be possible to generate the type info from the ofd2000.exe output, i.e. ofd2000.exe -x.  What do you think?

    Where is the documentation for ofd2000.exe.  I am specifically interested in the definition of the xml tags, e.g. stoarge_type, storage_class and etc.

  • Rather than starting from scratch, consider starting with one of the Perl scripts in the cg_xml package.

    stevenh said:
    Where is the documentation for ofd2000.exe

    Unfortunately, the XML tags from ofd2000 are not documented.

    Thanks and regards,

    -George