471,107 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,107 software developers and data experts.

why i can`t debug virtual cpp functions?

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.
Nov 17 '05 #1
10 1214
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

"Serg" <se***********@alef.ru> wrote in message
news:OI**************@TK2MSFTNGP10.phx.gbl...
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.

Nov 17 '05 #2
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.
"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> сообщил/сообщила в
новостях следующее: news:%2****************@TK2MSFTNGP10.phx.gbl...
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

"Serg" <se***********@alef.ru> wrote in message
news:OI**************@TK2MSFTNGP10.phx.gbl...
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.


Nov 17 '05 #3
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

"Serg" <se***********@alef.ru> wrote in message
news:uw**************@TK2MSFTNGP10.phx.gbl...
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.
"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> сообщил/сообщила в
новостях следующее: news:%2****************@TK2MSFTNGP10.phx.gbl...
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

"Serg" <se***********@alef.ru> wrote in message
news:OI**************@TK2MSFTNGP10.phx.gbl...
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.



Nov 17 '05 #4
"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> wrote in
news:#X**************@TK2MSFTNGP10.phx.gbl:
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,
--
Tarek Madkour, Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers
no rights.
Nov 17 '05 #5
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

"Tarek Madkour [MSFT]" <ta****@online.microsoft.com> wrote in message
news:Xn*****************************@207.46.248.16 ...
"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> wrote in
news:#X**************@TK2MSFTNGP10.phx.gbl:
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,
--
Tarek Madkour, Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers
no rights.

Nov 17 '05 #6
"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> wrote in
news:e8**************@TK2MSFTNGP10.phx.gbl:
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,
--
Tarek Madkour, Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers
no rights.
Nov 17 '05 #7
>
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.


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

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
Nov 17 '05 #8
Right now have started to wait VS2005.
joke :)
"Tarek Madkour [MSFT]" <ta****@online.microsoft.com> сообщил/сообщила в
новостях следующее: news:Xn*****************************@207.46.248.16 ...
"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> wrote in
news:#X**************@TK2MSFTNGP10.phx.gbl:
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,
--
Tarek Madkour, Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers
no rights.

Nov 17 '05 #9
Hi
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).

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
Nov 17 '05 #10
"=?Utf-8?B?VGhpYmF1dA==?=" <Th*****@discussions.microsoft.com> wrote in
news:32**********************************@microsof t.com:
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,
--
Tarek Madkour, Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers
no rights.
Nov 17 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by nenad | last post: by
62 posts views Thread by christopher diggins | last post: by
7 posts views Thread by Aguilar, James | last post: by
4 posts views Thread by The Stevemeister | last post: by
5 posts views Thread by alex goldman | last post: by
15 posts views Thread by Philipp | last post: by
reply views Thread by Dustin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.