derived method of abstract base class not getting invoked
From: Charlie (cs_hart_at_yahoo.com)
Date: 08/31/04
- Previous message: Gary Nastrasio: "Re: Virtual Address Space"
- Next in thread: David Lowndes: "Re: derived method of abstract base class not getting invoked"
- Reply: David Lowndes: "Re: derived method of abstract base class not getting invoked"
- Reply: Charlie Hart: "Re: derived method of abstract base class not getting invoked"
- Messages sorted by: [ date ] [ thread ]
Date: 31 Aug 2004 12:02:19 -0700
I have the following
Class Base {
Base();
virtual bool func(ListClass* tlist) =0;
};
Class Derived:public Base {
Derived();
~ Derived();
bool func(ListClass* tlist);
}
Code to invoke:
..
Derived* ptr = new Derived();
ptr->func(tlist);
When I try to step into this function with the debugger I get a popup
saying there is no source code available. If I look at the following
code with disassembly window I see code like this:
ptr->func(tlist);
000002b4 mov eax,dword ptr [ebp-2Ch]
000002b7 mov eax,dword ptr [eax]
000002b9 mov esi,dword ptr [eax]
000002bb mov edx,dword ptr [ebp-30h]
000002be mov ecx,dword ptr [ebp-2Ch]
000002c1 mov eax,esi
000002c3 push 15B088h
000002c8 call F9AF9FC0 <<<---- should be calling func but
does not
000002cd nop
But for other methods, the source always has a load of a doubleword
pointer as I would expect it would be looking up the method in a
vector table.
rList->otherFunc(tlist);
000002f6 mov edx,dword ptr [ebp-30h]
000002f9 mov ecx,dword ptr [ebp-34h]
000002fc call dword ptr ds:[00836BB4h] <<< ----- calling
otherFunc
00000302 nop works fine
Since this is debug compiled code I assume the compiler is responsible
somehow. What I don't know is if there any options I'm using that
might be causing this.
I'm using .NET 2003 with the project defined as a console app.
I should add that I had the same problem with the base destructor,
even when I had it defined virtual. The derived class destructor was
not getting invoked.
I eliminated the destructor in the base .h file and the derived
destructor started getting invoked at delete.
- Previous message: Gary Nastrasio: "Re: Virtual Address Space"
- Next in thread: David Lowndes: "Re: derived method of abstract base class not getting invoked"
- Reply: David Lowndes: "Re: derived method of abstract base class not getting invoked"
- Reply: Charlie Hart: "Re: derived method of abstract base class not getting invoked"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|