why i can`t debug virtual cpp functions?

S

Serg

Every time i am trying to step into virtual funtion debugger tells me "there
is no source code available" and disassemble window appears. If function is
non virtual debugger succefully steps into it and shows source code.
Is there any compiler key that can fix it?
Please help.
Thanks in adv.
 
S

Steve McLellan

Is your program mixed mode (native and .NET C++)? There are known (and
frustrating) problems in the debugger with mixed C++ programs. In
particular, in the stack trace you may see that the current execution point
is in a DLL called msworks.dll (or similar, I forget what it is exactly).
Hopping up the stack trace will put you inside your function. Unfortunately,
stepping through will keep bringing up the box you're seeing.

Steve
 
S

Serg

Thank you for fast answer.
Yes my program is in mixed mode. And all is as you said.
I think i have found the solution.
I had written a simple wrapper without virtual functions that simply recalls
my object

#pragma unmanaged
class IMidLevelObj
{
private:
CMidLevelObj* mObj;
public:
IMidLevelObj ( CMidLevelObj* pObj ) { mObj = pObj; }
virtual ~IMidLevelObj(void) { }

int f_init (int ID) { return mObj->f_init (ID); }
};

and now all is ok
I can debug my virtual function f_init() in CMidLevelObj.
 
S

Steve McLellan

Yeah, that'll do it. The debugger seems much more stable running unmanaged
code - on occasion, I compile bits of code up as unmanaged temporarily if
this problem strikes.

Cheers,

Steve
 
T

Tarek Madkour [MSFT]

Is your program mixed mode (native and .NET C++)? There are known (and
frustrating) problems in the debugger with mixed C++ programs.

I just wanted to add that we're fixing a lot of the frustrating problems
with the stability and performance of mixed-mode debugging in VS2005. I
know it does not help you much as a VS2003 user but I just wanted to let
you know that we're working on it :)

Thanks,
 
S

Steve McLellan

Should hope so, too! :)

I guess there are always problems with new tech, and we should be thankful
we don't have to write off all the C++ code we've got lying around - that's
saved us months as it is (and meant that my OS X devotee boss has been kept
happy). Top of my list (apart from the one already mentioned) would be being
able to look at gcroot pointers in the debugger and getting the 'Local' tab
to show the right stuff - it often seems to be a line behind in mixed mode.
Looking forward to seeing VS2005.

Cheers,

Steve
 
T

Tarek Madkour [MSFT]

Top of my list (apart from the one already mentioned) would be being
able to look at gcroot pointers in the debugger

We're working on that right now actually :) It is not part of Beta1
though.
and getting the 'Local' tab to show the right stuff - it
often seems to be a line behind in mixed mode.

I don't know the status on this one but I'll make sure we try to get
this fixed as well (if not already).

Thanks,
 
S

Steve McLellan

We're working on that right now actually :) It is not part of Beta1
though.

Yeah, I'd heard rumours. Unfortunately I can't use the betas anyway as I
don't get paid if I spend my time messing around with new shiny toys :)
I don't know the status on this one but I'll make sure we try to get
this fixed as well (if not already).
Great. It might just be my code, but it's definitely not as hot as when
debugging pure native code. If I think of anything else I'll let you know
:)

Thanks again,

Steve
 
S

Serg

Right now have started to wait VS2005.
joke :)


Tarek Madkour said:
I just wanted to add that we're fixing a lot of the frustrating problems
with the stability and performance of mixed-mode debugging in VS2005. I
know it does not help you much as a VS2003 user but I just wanted to let
you know that we're working on it :)

Thanks,
 
G

Guest

Hi
Great. It might just be my code, but it's definitely not as hot as when
debugging pure native code. If I think of anything else I'll let you know

I'm statically linking a wrapper c++ assembly against a native .lib (wrapper
debug settings is set to "mixed", final application has "enable unmanaged
debugging" set), for which I have the source code.

I'm able to step into the native .lib code, but I can't evaluate any
expression (nothing in locals tab, no watch will work, and moving the cursor
to some item won't show its value).

Is it a known problem or am I doing something wrong ?

Best regards and keep up the good work

Thibaut Barrère
 
T

Tarek Madkour [MSFT]

I'm able to step into the native .lib code, but I can't evaluate any
expression (nothing in locals tab, no watch will work, and moving the
cursor to some item won't show its value).

Is it a known problem or am I doing something wrong ?

Are you able to reproduce this problem with a simple .lib and .dll? If
so can you send it to me for investigation?

Thanks,
 

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

Top