virtual table on g++

D

DanielJohnson

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.
 
R

Rolf Magnus

DanielJohnson said:
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.
 
P

Pavel Shved

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).
 
E

EventHelix.com

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top