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.

What symbol should I use in rhino for C++ member functions?

When I compile C++ code with the TI compiler, and then need to reference template class member function names in an instantiation of the class, what symbol to I feed rhino to get the address of such a function, so that I can set a breakpoint on it, etc.?

Example:  I have an instance of a template class, SerialRX, that inherits from the class Queue.  I want to get the address of the getbyte member function of that instance. 

Here is the way it appears in the source code:

template < typename IndexType, IndexType Size, typename EntryType >
class Queue {    // the class we inherit from

    /* blah blah */

}

template <uint16_t Size>
class SerialRX : public Queue <uint16_t, Size, uint8_t> {   // the class we instantiate

    bool getbyte(uint8_t &return_byte) { /* blah blah */ }    // the member function we are interested in

}  

SerialRX <128> ModemRX;   // here is where we actually instantiate it.

Here is the way it appears in an objdump:

SerialRX<128u>::getbyte(unsigned char&)

There is no "ModemRX::getbyte" in the object files.

When I use:

debugSession.symbol.getAddress("SerialRX<128u>::getbyte(unsigned char&)");

it barfs out error messages.  What is the right way to get the address of a member function of a n instance of a template class?

  • With some additional experimentation, I have discovered that I can get the address of "ModemRX", and I am now thinking that since a class is essentially a struct with potentially private and/or privileged scoping for some of the member names, I am therefore thinking that I should be addressing member functions the same way I would address member variables of a struct. 

    I have already solved the problem of addressing member variables of a struct, so I will keep experimenting and see if I can use the same technique to address member functions of a class.

    I am able to determine the offset of a member variable of a struct by using the global_types_gen.pl script and some additional post-processing on my part to make a look-up table to give me the offset of a member variable in a struct when I provide the member name.  Perhaps this, or something similar, will work to give me the address of a member function as well.  We shall see. 

    I will post here with my findings...

  • I exploring the XML file output by odf6, I see that the names of the member functions I am looking for are there in the xml file, but without more documentation, I do not know how to turn those names into addresses.  Is ther any documentation for the ofd6 xml output file?

  • The OFD utility should be documented in the Assembly Language Tool's User's Guide.

    http://www.ti.com/lit/ug/spru186w/spru186w.pdf (section 10)

    For more details on the OFD output, try the compiler forum (I know you are having to go back and forth depending on your question. Sorry for the PITA on this).

  • Thanks for the link!  I am going to have to put this effort on hold for a while, as I have been given a new priority that does not require this knowledge of the ofd6 xml output, but I will post back here when I have a chance to get back into it.

  • I just looked at the ofd6 utility documentation from the link you provided.  It jus says the same thing as the manpage does.  There is no information on the XML format at all.  Is this XML format documented anywhere?

  • Sorry, but looking at George's response on the Compiler forum (he would know best), it looks like it is not documented anywhere.

    http://e2e.ti.com/support/development_tools/compiler/f/343/t/316813.aspx