在 Delphi IDE 中排除 EStackoverflow 异常的提示

发布于 2024-09-15 20:10:33 字数 622 浏览 9 评论 0原文

我正在运行 Delphi 2009。当我尝试在表单编辑器中查看表单时,我不断遇到堆栈溢出。所以我做了别人都会做的事。我使用 Delphi 来调试自身或者更确切地说是 IDE 的另一个实例。

所以我知道溢出发生在哪里,但我只是不知道该怎么办。此表单上有一个自定义组件,它拦截对 TForm.WindowProc 的调用,以便它可以响应某些 winapi 消息。当组件调用 real WindowProc 时,就会发生堆栈溢出。

当我中断异常时,调用堆栈中充满了数百个对以下内容的调用:

delphicoreide120.@Comppalmgr@TComponentPalettePageItemDelegate@CheckValid

到目前为止,我还没有成功地追踪到传递给 WindowProc 的实际消息。

任何帮助将不胜感激。

更新

我已经取得了一些进展。追踪到似乎将其关闭的消息。它是 WM_CHILDACTIVATE。当此消息传递到表单的 WindowProc 时,它会在 IDE 中引发一系列调用,最终导致堆栈溢出。现在我只需要弄清楚为什么。

I'm running Delphi 2009. When I try to view a form in the form editor I keep getting a stack overflow. So I did what anyone else would do. I used Delphi to debug itself or rather another instance of the IDE.

So I know where the overflow is occuring I just don't know what to do about it. There is a custom component on this form that is intercepting calls to TForm.WindowProc so it can respond to certain winapi messages. The stack overflow is occuring when the component invokes the real WindowProc.

When I break on the exception the call stack is filled with hundreds of calls to:

delphicoreide120.@Comppalmgr@TComponentPalettePageItemDelegate@CheckValid

So far I haven't had any luck tracking down the actual message being passed to WindowProc.

Any help would be appreciated.

Update

I've made some progress. Tracked down the message that appears to be setting this off. It's WM_CHILDACTIVATE. When this message gets passed to the form's WindowProc it sets off a series of calls within the IDE that ends with a stack overflow. Now I just need to figure out why.

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

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

发布评论

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

评论(2

枫以 2024-09-22 20:10:33

EStackOverflow 异常本身生成时(即在 < SysUtilsMapFault 或 ErrorHandler 函数a> 单元)或者仅当 EStackOverflow 已经被引发时?

当您无法中断时:当调试器启动时,堆栈可能已经部分损坏。

如果您可以在那里中断,请执行此操作,然后尝试浏览堆栈(较新的 Delphi 版本在这方面做得更好)以找到有问题的参数在 WindowProc.

调试Delphi表单设计器时;双显示器或大屏幕设置非常方便:您可以在显示器的一侧(一侧)运行有问题的 Delphi 实例,在另一侧运行调试 Delphi 实例。

编辑:虽然我在回答中提到了大屏幕side,但为了使调试步骤更加清晰:

  1. 首先确保调试和有问题的Delphi实例不重叠视觉上。
  2. 然后慢慢地越来越多地重叠有问题的 Delphi 实例,直到出现堆栈溢出。

——杰罗恩

Can you break when the EStackOverflow exception itself is being generated (i.e. in the MapFault or ErrorHandler functions of the SysUtils unit) or only when the EStackOverflow already has been raised?

When you can't break: the stack might already be partially corrupted when the debugger kicks in.

If you can break there, do it, then try to browse up the stack (newer Delphi versions are better at that) to find the offending parameter in the WindowProc.

When debugging the Delphi form designer; it is very convenient to have a dual monitor or large screen setup: you can run the offending instance of Delphi on one (side) of your monitors, the debugging Delphi instance on the other.

Edit: though I mentioned large screen and side in my answer, to make the debugging steps even clearer:

  1. Start by make sure that the debugging and offending instance of Delphi do not overlap visually.
  2. Then slowly overlap more and more of the offending Delphi instance more and more until you get the stack overflow.

--jeroen

左秋 2024-09-22 20:10:33

啊!它最终是我最近安装的第三方组件包,与异常发生的位置完全无关。尝试在新项目中查看空白表单,得到相同的结果。

软件包的编译或安装出现问题。重建/重新安装它使异常消失。

Ugh! It wound up being a third party component package I had recently installed and was completely unrelated to where the exception was occurring. Tried viewing a blank form in a new project with the same results.

Something went wrong either with the compilation or installation of the package. Rebuilding/reinstalling it made the exception disappear.

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