如何阻止调试器进入Delphi提供的单元? [英] How do I stop the debugger from stepping into Delphi-supplied units?

查看:354
本文介绍了如何阻止调试器进入Delphi提供的单元?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

调试器在错误的步骤中进入源代码(如使用 F7 ),但是我想恢复正常工作模式,其中Delphi基本DCU(库)只会编译到我的代码中,并且源不在调试中使用。

The debugger steps into the source code on errors (like with F7), but I want to restore the normal working mode where the Delphi basic DCUs (the library) are only compiled into my code, and the sources are not used in debugging.

例如,对于程序中的错误,调试器正在进入Controls.pas,进入 TControl.Click 。正常情况下(右侧安装)是为Delphi处理这些方法。

For example, on an error in my program, the debugger is stepping into Controls.pas, into TControl.Click. The normal case (right after installation) is for Delphi to step over these methods.

我应该重新编译没有调试信息的Controls.pas吗?如果是,那么如何?

Should I recompile Controls.pas without debug information? If so, how?

我将这个主题扩展到更多的信息,以便更好地理解:

I extending this theme with additional information to better understanding:

我们使用Delphi6 Prof.鼠标有什么问题(系统错误代码5)。
所以我们要重新编译到Controls.pas来替换Mouse Position getter代码。
然后:

We use Delphi6 Prof. what have problem with Mouse (System Error Code 5). So we want to recompile to Controls.pas to replace the Mouse Position getter code. Then:


  1. 我为此创建了一个文件夹:c:\D\Common\Delphi_Patches\Delphi_6 \

  2. 我把原来的Controls.pas加入它。

  3. 我修改了Controls.pas,替换了位置getter代码。 li>
  4. 我设置了Delphi的库路径,将第一个文件夹设置为c:\D\Common\Delphi_Patches\Delphi_6\

通过这些步骤,我可以使用鼠标安全代码编译源代码。

With these steps I can compiled the source with mouse-safe code.

好的,但是Delphi每次都会进入Controls.Pas在F7上,除了任何例外 - 这是非常愤怒的事情。

Ok, but then the Delphi everytime steps into Controls.pas on F7, and on any exceptions - this is very "angermaker" thing.

无论我从库路径中删除了Controls.pas那么调试器就会找到原来的Controls.pas,并打开它...: - (

No matter that I removed the "Controls.pas" from the Library path - then the debugger is finding the original "Controls.pas" for it, and opens it... :-(

我们不使用使用调试DCU 在任何代码中。

We don't use "Use Debug DCU-s" in any codes.

我尝试从编译器选项中删除调试信息,但无论如何,Delphi将打开原始inal Controls.pas ...

I tried to remove "Debug Information" from compiler options, but it is no matter, the Delphi is opens the original Controls.pas...

所以我搜索Delphi的方式不要进入Controls.pas,而是使用我的dcu ...

So I search the way to Delphi don't step into "Controls.pas", but use my dcu...

我希望这能提供更好的上下文来理解问题。

I hope this provide better context to understand the problem.

推荐答案

看到解决方案是:


  1. 创建一个仅使用新的Controls.pas的项目。

  1. create a project the uses only the new Controls.pas.

在编译器选项中取消设置调试信息选项。

unset the "Debug information" option in compiler options.

构建dcu

将dcu放入库文件夹

从此库文件夹中隐藏新的Controls.pas。

hide the new Controls.pas from this library folders.

看到这个伎俩,我不能进入controls.pas。

Wite this trick the I cannot "step into" controls.pas.

问候:dd

这篇关于如何阻止调试器进入Delphi提供的单元?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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