为什么我不能调试虚拟cpp函数? [英] why i can`t debug virtual cpp functions?

查看:67
本文介绍了为什么我不能调试虚拟cpp函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我试图进入虚拟功能调试器告诉我那里

是没有可用的源代码并出现反汇编窗口。如果函数是

非虚拟调试器成功进入它并显示源代码。

是否有任何编译器密钥可以修复它?

请帮助。

感谢adv。

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.

推荐答案

您的程序是混合模式(本机和.NET C ++)吗?使用混合C ++程序的调试器中存在(和b / b $ b令人沮丧的)问题。在

特别是,在堆栈跟踪中你可能会看到当前执行点

在一个名为msworks.dll的DLL中(或类似的,我忘了它究竟是什么) 。

跳过堆栈跟踪会让你进入你的功能。不幸的是,

单步执行将继续打开您所看到的盒子。


Steve


" ; SERG" < SE *********** @ alef.ru>在留言中写道

新闻:OI ************** @ 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.



感谢您的快速回答。

是的,我的程序处于混合模式。一切都如你所说的那样。

我想我找到了解决方案。

我写了一个简单的包装器,没有虚函数,简单地回忆起

我的对象


#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); }

};


现在一切正常

我可以在CMidLevelObj中调试我的虚函数f_init()。 />
" Steve McLellan" < sjm.NOSPAM AT fixerlabs DOT com> ó???Yéì/ó???Yéìá×

??×?ó??èóì????Y ??:news:%2 ********** ****** @ 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> ó???Yéì/ó???Yéìá ×
??×?ó??è óì???àY??: news:%2****************@TK2MSFTNGP10.phx.gbl...
您的程序是混合模式(本机和.NET C ++)吗?使用混合C ++程序的调试器中存在(和令人沮丧的)问题。特别是,在堆栈跟踪中,您可能会看到当前执行的
点位于名为msworks.dll的DLL中(或类似的,我忘了它究竟是什么)。
跳转到堆栈跟踪将使您进入您的功能。
不幸的是,踩踏将继续打开你所看到的盒子。

史蒂夫

" Serg" < SE *********** @ alef.ru>在消息中写道
新闻:OI ************** @ 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


没有可用的源代码并出现反汇编窗口。如果函数
is no source code available" and disassemble window appears. If function


非虚拟调试器成功进入它并显示源代码。
是否有任何编译器密钥可以修复它?
请帮助。
谢谢你。
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.




是的,那就行了。调试器似乎更稳定运行非托管

代码 - 有时,如果

此问题发生,我会将代码编译为非托管的。

干杯,


史蒂夫


" Serg" < SE *********** @ alef.ru>在留言中写道

新闻:uw ************** @ TK2MSFTNGP10.phx.gbl ...
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...
谢谢你快速回答。
是的,我的程序处于混合模式。一切都如你所说。
我想我找到了解决方案。
我写了一个没有虚函数的简单包装,只需
就可以回忆起我的对象

# pragma unmanaged
class IMidLevelObj
{
私人:
CMidLevelObj * mObj;
公开:
IMidLevelObj(CMidLevelObj * pObj){mObj = pObj; }〜
virtual~IMidLevelObj(void){}
int f_init(int ID){return mObj-> f_init(ID); }
};

现在一切正常
我可以在CMidLevelObj中调试我的虚函数f_init()。

" Steve McLellan" < sjm.NOSPAM AT fixerlabs DOT com> ó???Yéì/ó???Yéìá×
??×?ó??èóì????Y ??:新闻:%2 ************** ** @ 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> ó???Yéì/ó???Yéìá ×
??×?ó??è óì???àY??: news:%2****************@TK2MSFTNGP10.phx.gbl...
您的程序是混合模式(本机和.NET C ++)吗?使用混合C ++程序的调试器中存在(和令人沮丧的)问题。特别是,在堆栈跟踪中你可能会看到当前执行
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


指向

的是一个名为msworks.dll的DLL(或类似的,我忘记了什么它确实是
)。跳过堆栈跟踪会让你进入你的功能。
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,

单步执行将继续打开你正在看到的盒子。

Serg < SE *********** @ alef.ru>在消息中写道
新闻:OI ************** @ TK2MSFTNGP10.phx.gbl ...
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


没有可用的源代码并出现反汇编窗口。如果
is no source code available" and disassemble window appears. If


函数是

非虚拟调试器成功进入它并显示源代码。
是否有任何编译器密钥可以修复它?
请帮助。
感谢adv。
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.





这篇关于为什么我不能调试虚拟cpp函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆