调试器中的结果不同 [英] diferent results in debugger

查看:68
本文介绍了调试器中的结果不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的结果有所不同,这取决于我在调试器中运行我的应用程序

,还是单独运行(或者使用< ctrl-f5> ;)


调试器中的结果似乎更正确,虽然

应用程序尚未完成,但仍有很多错误。


处理过程非常复杂,很难确定差异在哪里可以发生b

它是3d模型的可视化显示,还有几个表面

不一样。


有很多复杂的polyhderon到多面体交叉处理。

需要大约10秒的CPU时间,更简单的运行不会显示差异。


如果我运行调试或发布版本,结果是相同的,

它只是取决于调试器是否被连接。


我认为调试器没有任何区别,

certianly我不知道它是如何产生影响的对我的结果?


我很困惑,任何人都知道从哪里开始寻找?

我没有使用任何不安全的代码,但它让我想起c ++用指针

指向随机位置... c#不会允许这种事情吗?


谢谢

Colin = ^。^ =

Hi,
Ive got a difference in results depending on wether I run my app
in the debugger, or run it seperatly (or with <ctrl-f5>)

the results in the debugger seem to be more correct, although
the app isnt finished and theres still a lot of things it gets wrong.

the processing is so complex its hard to determine where the difference can
be occuring,
its a visual display of 3d models, and theres a couple of surfaces
wich arent the same.

theres a lot of complex polyhderon to polyhedron intersection processing.
takes about 10 seconds of cpu time, simpler runs dont show the difference.

If I run the debug or the release version the results are the same,
it just depends if the debugger is attatched or not.

I thought the debugger made no diference,
certianly I cant see how it can make a difference to my results ?

I''m confused, anyone got any idea where to start looking ?
ive not used any unsafe code, but it reminds me of c++ with pointers
pointing to random places ... c# wouldnt allow this sort of thing would it?

thanks
Colin =^.^=

推荐答案

您是否尝试记录中间结果以后再进行比较?


顺便说一句,使用单元测试将缓解这项任务


-

WBR,Michael Nemtsev [.NET / C#MVP]。

博客: http://spaces.live.com/laflour


" colin"写道:
did u try to log intermediate results to compate them afterwards?

btw, using unit tests will mitigate this task

--
WBR, Michael Nemtsev [.NET/C# MVP].
Blog: http://spaces.live.com/laflour

"colin" wrote:



我的结果有所不同,取决于我运行我的应用程序

in调试器,或单独运行(或使用< ctrl-f5>)


调试器中的结果似乎更正确,尽管

应用程序还没有完成,还有很多东西都会出错。


处理过程非常复杂,难以确定差异可能发生在哪里b


它是3d模型的视觉显示,而且有几个表面

不一样。


很多复杂的polyhderon到多面体交叉处理。

大约需要10秒的cpu时间,更简单的运行不会显示差异。


如果我运行调试或者发布版本的结果是一样的,

它只是取决于调试器是否被附加。


我认为调试器没有任何区别,

certian我无法看到它如何能对我的结果产生影响?


我很困惑,任何人都知道从哪里开始寻找?

ive没有使用任何不安全的代码,但它让我想起了带有指针的c ++

指向随机的地方...... c#会不允许这样的事情呢?


谢谢

Colin = ^。^ =
Hi,
Ive got a difference in results depending on wether I run my app
in the debugger, or run it seperatly (or with <ctrl-f5>)

the results in the debugger seem to be more correct, although
the app isnt finished and theres still a lot of things it gets wrong.

the processing is so complex its hard to determine where the difference can
be occuring,
its a visual display of 3d models, and theres a couple of surfaces
wich arent the same.

theres a lot of complex polyhderon to polyhedron intersection processing.
takes about 10 seconds of cpu time, simpler runs dont show the difference.

If I run the debug or the release version the results are the same,
it just depends if the debugger is attatched or not.

I thought the debugger made no diference,
certianly I cant see how it can make a difference to my results ?

I''m confused, anyone got any idea where to start looking ?
ive not used any unsafe code, but it reminds me of c++ with pointers
pointing to random places ... c# wouldnt allow this sort of thing would it?

thanks
Colin =^.^=


2008年1月2日星期三13:16:09 -0800,colin < co ********* @ ntworld.NOSPAM.com>

写道:
On Wed, 02 Jan 2008 13:16:09 -0800, colin <co*********@ntworld.NOSPAM.com>
wrote:

我有区别结果取决于我在调试器中运行我的应用程序

,或单独运行(或使用< ctrl-f5>)


结果在调试器似乎更正确,虽然

应用程序还没有完成,但仍然有很多错误。

[...]

我认为调试器没有区别,

我不知道它是如何对我的结果产生影响的?


我很困惑,任何人都知道从哪里开始寻找?
Ive got a difference in results depending on wether I run my app
in the debugger, or run it seperatly (or with <ctrl-f5>)

the results in the debugger seem to be more correct, although
the app isnt finished and theres still a lot of things it gets wrong.
[...]
I thought the debugger made no diference,
certianly I cant see how it can make a difference to my results ?

I''m confused, anyone got any idea where to start looking ?



如果没有可靠地再现

问题的简洁但完整的代码示例,那么提供任何有用的东西都非常困难。


也就是说,如果您的代码中有多个线程运行,那么我的首先怀疑是您未能正确同步您的代码/>
某种程度上的线程。


通常是因为一个人实际上正在逐步调试

调试器中的代码。这通常会导致无意中添加一些同步,或者至少改变时间以避免出现问题。

但是可以想象,即使你''不要单步执行

调试器中的代码,调试器的存在可能会改变代码的时间,足以改变结果。

如果你没有多个线程,那么我甚至不会猜测可能是什么问题。在任何一种情况下,你都应该做一些

的工作来提出一个简洁但完整的代码示例,它可靠地确定了b $ b再现问题。


我意识到你的应用程序很复杂,而且可能很难缩小范围。但这并没有改变这样做的重要性。

如果有的话,应用程序越复杂,越有条理,并且需要小心谨慎,你需要尝试追查像这样的困难问题。


Pete

Without a concise-but-complete sample of code that reliably reproduces the
problem, it''s very difficult to offer anything useful.

That said, _if_ you have multiple threads operating in your code, then my
first suspicion would be that you have failed to properly synchronize your
threads somehow.

Usually it''s because one is actually stepping through code in the
debugger. This often has the effect of adding some synchronization
inadvertently, or at least changing the timing enough to avoid problems.
But it''s conceivable that even if you''re not stepping through code in the
debugger, the presence of the debugger could change the timing of the code
enough to change the outcome.

If you don''t have multiple threads, then I wouldn''t even hazard a guess as
to what might be the problem. In either case, you should really do some
work to come up with a concise-but-complete sample of code that reliably
reproduces the problem.

I realize your application is complex and it may be very difficult to
narrow things down. But that doesn''t change the importance of doing so.
If anything, the more complex the application, the more methodical and
careful you need to be in trying to track down difficult problems like
this.

Pete


一个非常常见的问题是做真的在属性中工作。


当您在调试器中检查变量时,它可能会通过属性

访问器。如果是这样,您在访问者中所做的任何工作都会发生。这意味着如果您要更新日志或跟踪计数,检查

调试器中的变量将导致各种问题。


你是应用程序使用线程和并行吗?如果是这样,你可能会有一堆

并发错误...


-

Chris Mullins


" colin" < co ********* @ ntworld.NOSPAM.com写在留言中

新闻:ta ***************** @ newsfe3 -win.ntli.net ...
A very common problem is doing real work in properties.

When you inspect a variable in the debugger, it may go through the property
accessor. If so, any work you do in the accessor will happen. This means if
you''re updating a log, or tracking a count, inspecting a variable in the
debugger will cause all sorts of problems.

Is you app using threads and parallelism? If so, you may have a bunch of
concurrency bugs...

--
Chris Mullins

"colin" <co*********@ntworld.NOSPAM.comwrote in message
news:ta*****************@newsfe3-win.ntli.net...



我的结果有所不同取决于我运行我的应用程序
,或单独运行(或使用< ctrl-f5>)


调试器中的结果似乎更正确,尽管

应用程序还没有完成,还有很多东西都出错了。


处理过程太复杂了很难确定差异在哪里

可以发生,

它是3d模型的视觉显示,还有几个表面

不同。


theres很多复杂的polyhderon到多面体交叉处理。

大约需要10秒的cpu时间,更简单的运行不会显示差异。


如果我运行调试或发布版本,结果是相同的,

它只取决于deb ugger是否有人接受。


我认为调试器没有任何区别,

我不知道它怎么能对我的结果产生影响?


我很困惑,任何人都知道从哪里开始寻找?

我没有使用任何不安全的代码,但它让我想起了带有指针的c ++ />
指向随机位置... c#不允许这样的东西会

吗?


谢谢

Colin = ^。^ =
Hi,
Ive got a difference in results depending on wether I run my app
in the debugger, or run it seperatly (or with <ctrl-f5>)

the results in the debugger seem to be more correct, although
the app isnt finished and theres still a lot of things it gets wrong.

the processing is so complex its hard to determine where the difference
can be occuring,
its a visual display of 3d models, and theres a couple of surfaces
wich arent the same.

theres a lot of complex polyhderon to polyhedron intersection processing.
takes about 10 seconds of cpu time, simpler runs dont show the difference.

If I run the debug or the release version the results are the same,
it just depends if the debugger is attatched or not.

I thought the debugger made no diference,
certianly I cant see how it can make a difference to my results ?

I''m confused, anyone got any idea where to start looking ?
ive not used any unsafe code, but it reminds me of c++ with pointers
pointing to random places ... c# wouldnt allow this sort of thing would
it?

thanks
Colin =^.^=



这篇关于调试器中的结果不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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