Re: VS 2005 Code in debugger going to incorrect routine

Tech-Archive recommends: Fix windows errors by optimizing your registry




Is there a good way to see why the address being called is wrong ? I can
see the address in the disassembly of the call when it is being made.
How can I relate this at run-time to the actual address of my member
function within its object which should be called. I am merely trying to
understand why the code is going to a completely different area of
program memory wheh the call is being made.


First of all, try Rebuild All.

Then, if the problematic function is not virtual, it shouldn't be difficult
to check the related data structures. You can start with ildasm and
check the IL of the caller function, to ensure that the correct function
is called in IL. Then you can step through the caller function in disassembly
and try to analyze the data structures involved in the call.
This article can be useful (especially MethodDesc-related part):
http://msdn.microsoft.com/msdnmag/issues/05/05/JITCompiler/default.aspx
and SOS extension can help to get additional information about
the data layout.

Regards,
Oleg
[VC++ MVP http://www.debuginfo.com/]





.