调试断点仅在 DataModule 单元中不起作用 - Delphi

发布于 2024-07-28 23:54:48 字数 218 浏览 3 评论 0原文

调试断点在我系统的所有其他 38 个单元中工作正常。 但是,在我的 DataModule 中,有 +- 10.000 行,delphi 在我通过 F9/F8/F7 启动后禁用。 在该单元源的任何部分,甚至在 OnCreate、SQLConnection.Active:=true 等强制步骤上也是如此。 详细信息: 直到 +- 20 天前都可以正常工作。 我正在使用 D7,并且也有所有组件来源。 谢谢 费利佩

Debug breakpoint's works fine in all other 38 units of my system. But, in my DataModule, that have +- 10.000 lines, delphi disables then after I launch by F9/F8/F7. In any part of source that unit, even on obrigatory steps like OnCreate, SQLConnection.Active:=true, etc.
Detail: works fine until +- 20 days ago.
I'm using D7 and have all sources of components also.
Thanks
Felipe

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

森林很绿却致人迷途 2024-08-04 23:54:48

尝试进行完整构建(Shift+F9)。 如果这不起作用,那么如果您 在代码中模拟断点会发生什么 与下面的?

asm int 3 end;

Try doing a full build (Shift+F9). If that does not work, then what happens if you simulate a breakpoint in code with the below?

asm int 3 end;
硪扪都還晓 2024-08-04 23:54:48

检查数据模块的源文件的多个副本。 有时,您认为正在运行的代码并不是编译器和调试器看到的代码。

接下来,确保您没有意外使用 {$D-} 或 {$DEBUGINFO OFF} 关闭代码中的调试。 这可以关闭单个单元的调试信息。

另外,请确保您已在“工具”|“选项”|“调试器选项”中打开“集成调试”。 我知道你说过你可以调试其他地方,但确保集成调试不会以某种方式意外关闭也没什么坏处。

Check for multiple copies of your source file for the datamodule. Sometimes the code you think you're running isn't the code the compiler and debugger are seeing.

Next, make sure you haven't accidentally turned off debugging in your code with {$D-} or {$DEBUGINFO OFF}. This can turn off debugging info for a single unit.

Also, make sure you've turned on Integrated Debugging in Tools|Options|Debugger Options. I know you said you could debug other places, but it can't hurt to make sure that integrated debugging didn't get accidentally turned off somehow.

瘫痪情歌 2024-08-04 23:54:48

我发现了这个问题。 Delphi7 中的一个奇怪行为限制了接口类部分中的字段数量,介于: type TDM=class(TDataModule) 和 private 部分之间。 我删除了一些字段(数据集字段(+-40 字段))并再次运行调试。 我再次添加这些字段,但调试未运行。 我确信这是一个限制,因为我删除了哪些组件字段并不重要。 我尝试了多个字段,也来自不同的表,添加、测试和删除。 这很遗憾,但这是事实......
感谢您的帮助。

I discovered this problem. It's a weird behavior in Delphi7 that limits the number of fields in interface class section, between: type TDM=class(TDataModule) and private section. I deleted some fields (DataSet Fields (+-40 fields)) and degub runs again. I add these fields again, and debug not runs. I'm sure that's a limit, because doesn't mather which component fields I deleted. I tried with several fields, from different tables too, adding, testing and deleting. It's a shame, but is true...
Thanks for your help.

握住我的手 2024-08-04 23:54:48

我有一个模糊的记忆,在旧的 D7 中调试非常大的文件是有问题的。
尝试将大单元分成几个类,看看是否可以在单元外进行调试。
另一种选择可能是关闭大文件中除要调试的部分之外的调试信息。 值得一试。

I have a vague memory that debugging very large files was buggy in old D7.
Try to break you big unit in several classes and se if you can debug outside your unit.
Another option could be to turn off debuginfo in your big file except the section you want to debug. It is worth a try.

水溶 2024-08-04 23:54:48

不久前,Steve Trefethen 发表了一篇博文,解释了一些可能的原因,不过如果你说你可以调试其他单元,我怀疑它们是否适用。

我们在 Delphi 5 中的一个大 DataModule 上遇到了同样的问题,它不允许我们调试它,并且有点把它归结为文件太大而无法调试,而 Delphi 不喜欢它。 当我们迁移到Delphi 2007时,我们可以再次调试它。 不知道为什么,没有任何改变(代码方面)。

There's a blog post from Steve Trefethen, a while back, explaining some possible reasons, although if you say you can debug other units, I doubt they'll apply.

We had the same issue with a large DataModule in Delphi 5 that wouldn't let us debug it, and kind of put it down to it being too large a file to debug and Delphi not liking it. When we moved to Delphi 2007, we could debug it again. Not sure why, nothing had changed (code wise).

若相惜即相离 2024-08-04 23:54:48

Felipe,这个单元是否不允许您在移入或移出内存的 dll 中进行调试? 我发现在调试 dll 时,如果我在可执行文件中执行某些操作来执行另一个 dll 中的代码或卸载问题单元所在的 dll - Delphi 将禁用所有断点。 通常,重新启动 Delphi 并确保在内存中保留问题单元 dll 的单个实例是解决此问题的唯一方法。

我怀疑大小是问题所在,因为我有一个定期调试的 17k 行单元。

Felipe, is the unit that will not allow you to debug in a dll that is being moved into or out of memory? I've found when debugging dll's that if I do something in the executable that executes code in another dll or unloads the dll that the problem unit is in - Delphi will disable all breakpoints. Usually a restart of Delphi and being sure to keep a single instance of the problem unit's dll in memory is the only solution for this problem.

I doubt size is the issue, as I have a 17k line unit that I debug regularly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文