virtual table on g++

Discussion in 'C++' started by DanielJohnson, Feb 10, 2008.

  1. Hi,

    I want to study vtable (virtual functions and its behavior) and what
    it contains. I am a newbie learning C++ and using g++ compiler.

    Can you throw some pointers as to how to use g++ or gdb to look the
    contents of vtable ?

    Every help is greatly appreciated.
     
    DanielJohnson, Feb 10, 2008
    #1
    1. Advertising

  2. DanielJohnson

    Rolf Magnus Guest

    DanielJohnson wrote:

    > Hi,
    >
    > I want to study vtable (virtual functions and its behavior) and what
    > it contains. I am a newbie learning C++ and using g++ compiler.


    Then you shouldn't care. The details are compiler-specific, and you don't
    need to know them for using virtual functions. Actually, the C++ standard
    doesn't even mention vtables.

    > Can you throw some pointers as to how to use g++ or gdb to look the
    > contents of vtable ?


    Someone in gnu.g++.help might.
     
    Rolf Magnus, Feb 10, 2008
    #2
    1. Advertising

  3. DanielJohnson

    Pavel Shved Guest

    On 10 ÆÅ×, 19:17, DanielJohnson <> wrote:
    > I want to study vtable (virtual functions and its behavior)


    You are wrong here, thinking that implementatinon and purpose are the
    same things.

    But if you really don't want to study how you should use them, but
    want to study how they're implemented instead, then refer to `Itanium C
    ++ ABI' (first link @ google) and play with g++ -fdump-class-hierarchy
    option (also read gcc's man page about dumps).
     
    Pavel Shved, Feb 11, 2008
    #3
  4. On Feb 10, 11:17 am, DanielJohnson <> wrote:
    > Hi,
    >
    > I want to study vtable (virtual functions and its behavior) and what
    > it contains. I am a newbie learning C++ and using g++ compiler.
    >
    > Can you throw some pointers as to how to use g++ or gdb to look the
    > contents of vtable ?
    >
    > Every help is greatly appreciated.


    The following articles describe C++ under the hood. The second article
    describes virtual tables.

    http://www.eventhelix.com/RealtimeMantra/basics/ComparingCPPAndCPerformance.htm

    http://www.eventhelix.com/RealtimeMantra/basics/ComparingCPPAndCPerformance2..htm

    --
    EventStudio 4.0 - http://www.Eventhelix.com/Eventstudio/
    Sequence diagram based systems engineering tool
     
    EventHelix.com, Feb 11, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Derek Simmons
    Replies:
    0
    Views:
    811
    Derek Simmons
    Aug 1, 2004
  2. David Williams
    Replies:
    2
    Views:
    1,145
    Jacob Yang [MSFT]
    Aug 12, 2003
  3. Jéjé
    Replies:
    2
    Views:
    407
    Jéjé
    Nov 30, 2005
  4. while_1
    Replies:
    2
    Views:
    638
    Roedy Green
    Jun 25, 2004
  5. Rio
    Replies:
    4
    Views:
    1,217
Loading...

Share This Page