Thank you for this information.
I have only seen this problem with one particular class.
The situation in which this is happening is that in fileA.mm, I have a function written as:
void MyFunc( void) { MyCPPClass anInstance; AnOBJCClass* anObject = [[AnOBJCClass alloc] init];
[anObject aMethodWithParameter:anInstance];
}
aMethodWithParameter: might be defined as:
- (void) aMethodWithParameter:(const MyCPPClass&)inData { NSLog( @"I'm here" ); }
When I set the breakpoint on the first line of aMethodWithParameter:, I get those warnings. Of course, if I try to do what I have written above in a sample application, I cannot reproduce the problem...I only see the problem in my very large, real application.
Now, in the real application, if I change the definition of aMethodWithParameter: to:
- (void) aMethodWithParameter:(const MyCPPClass*)inData
I don't see the problem, as one might expect. But, I would prefer to pass the data as a const reference rather then a pointer.
If there is anything you can suggest about how I might be able to resolve or further research this problem (perhaps there is some GDB magic that I can do to have it tell me why it might have a problem with this particular class...?), I would be interested. It's increasingly tempting to use a DTS incident to try to figure this out...
On Nov 29, 2010, at 2:39 PM, Jim Ingham wrote:
This is gdb looking for the dynamic type of some C++ object. It does that by finding the vtable pointer in the object, since the demangled name of the vtable symbol that this points to is of the form "vtable for FULL_CLASS_NAME". In your case, we think we've found the vtable pointer in the object, but the symbol that it points to is not right, it is pointing to the Init function instead.
One possibility is that we are looking at an object pointer that hasn't been initialized yet. If you're unlucky that will point to something that looks enough like a real object for us to get this far, but of course isn't right yet... For instance if you do:
MyClass *my_class_ptr;
// Some other code here.
my_class_ptr = new MyClass();
and stop before my_class_ptr is newed up.
Otherwise maybe there's something extra about class XXX that is confusing us? Does it happen for all classes or only some classes?
Jim
On Nov 29, 2010, at 11:10 AM, Eric Gorr wrote:
I am running my application with the debugger and stop at a breakpoint. At that point, I see this warning in the console repeated several times:
warning: can't find linker symbol for virtual table for `xxx' value
warning: found `xxx::Init(unsigned long)' instead
As near as I can tell, it is a warning generated by GDB and probably not something I need to worry about.
However, it is greatly impeding my ability to debug as I do output important stuff at times and these warnings are filling up my console. So, I would like to learn more about what they mean and what I can do about them.
I have tried to reproduce this problem in a simple application, but have not been able to yet.
If you have seen this warning or know anything about it, I would be interested.
Thank you.
|