473,396 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 1316
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Prabu | last post by:
Hi, I'm new to python, so excuse me if i'm asking something dumb. Does python provide a mechanism to implement virtual functions? Can you please give a code snippet also...:) Thanx in advance...
18
by: nenad | last post by:
Wouldn't it be nice if we could do something like this: class Funky{ public: auto virtual void doStuff(){ // dostuff } };
62
by: christopher diggins | last post by:
Since nobody responded to my earlier post , I thought I would try to explain what I am doing a bit differently. When multiply inheriting pure virtual (abstract) base classes, a class obviously...
7
by: Aguilar, James | last post by:
I've heard that virtual functions are relatively ineffecient, especially virtual functions that are small but get called very frequently. Could someone describe for me the process by which the...
0
by: Chris F Clark | last post by:
In our C++ project we have some internal bug reporting macros that we use to get useful information when the program does something unexpected. Essentially at the point of the error, we invoke an...
4
by: The Stevemeister | last post by:
Hi, I have an entity class (from a rendering engine) with about 100 functions now that are virtual. So far no slowdowns, but since I've done alot of work with OWL and MFC over the years, and I...
5
by: alex goldman | last post by:
When compiling this code with g++ -Wall -pedantic -ansi -c program.cpp # this is GCC-3.3.4 ###################################### #include <vector> class b { public: virtual void f() = 0;...
15
by: Philipp | last post by:
Hello I don't exactly understand why there are no static virtual functions. I would have liked something like this: class Base{ static virtual std::string getName(){ return "Base"; } }
0
by: Dustin | last post by:
Hi all, I have the gd and gd2 libraries compiled into my php install, but the jpeg functions do not exist. I found out this is because I don't have jpeg support compiled in specifically. So, I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.