导致 Delphi IDE 崩溃的已知结构

发布于 2024-07-25 21:24:04 字数 318 浏览 10 评论 0原文

我正在使用 Turbo Explorer 2006(更新 2),有时 IDE 在某个单元中崩溃,特别是当我尝试使用类完成时。 该单元(以及整个项目)已投入生产,并且运行良好多年,每天都进行修改,只是 IDE 工具出现了故障。

通常,如果发生这种情况,Delphi 会在崩溃中幸存下来,但 IDE 的某些部分已失效(例如,单元不在 .dpr 中的表达式的工具提示中的调试值)

我怀疑解析器在某些特定构造上终止,可能是 ifdef'ed ,因为这个单元是一个巨大的系统交换机。

某人是否知道杀死 IDE 的具体结构? 我想解决这个问题,以便我可以再次使用类完成。

I'm using Turbo Explorer 2006 (update 2), and sometimes the IDE crash in a certain unit, specially when I try to use class-completion. The unit (and whole project) are in production and have run fine for years, with daily modifications, it's just the IDE tools that fail.

Usually if this happens, Delphi survives the crash, but some parts of the IDE are defunct (e.g. debug values in tooltips for expressions whose unit is not in the .dpr)

I suspect the parser dies on some specific construct, probably something ifdef'ed, since this unit is an enormous switchboard of systems.

Does sb know specific constructs that kill the IDE? I'd like to fix this so I can use class-completion again.

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

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

发布评论

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

评论(4

酒儿 2024-08-01 21:24:04

谷歌搜索[delphi Turbo“类完成”崩溃]找到一个错误报告,听起来是什么就像你看到的同样的问题。 该错误报告列出了一个解决方法(»将“TTest”更改为“TButton”并删除“TButton = class(TTest)”。«),至少对于其给定的测试用例,但我不知道它是否适用于您的情况。

Googling for [ delphi turbo "class completion" crash ] located a bug report with what sounds like the same problem you are seeing. The bug report lists a workaround (»Change "TTest" to "TButton" and remove the "TButton = class(TTest)".«), at least for its given testcase, but I don't know if its applicable in your case.

花辞树 2024-08-01 21:24:04

我在使用动态多维数组时遇到了一些问题:

type
  Foo = array of array of Integer;

代码完成和重构不起作用,它给出了有关 ; 的错误。 预期在该声明中的某个地方,但它编译得很好。

我通过将类型声明修改为以下内容来修复它:

type
  Foo = array of TIntegerDynArray; //TIntegerDynArray is declared in Types unit

I had some problems with a dynamic multidimensional array:

type
  Foo = array of array of Integer;

Code completion and refactoring didn't work, it gave an error about a ; expected somewhere in that declaration, but it compiled just fine.

I fixed it by modifiying the type declaration to this:

type
  Foo = array of TIntegerDynArray; //TIntegerDynArray is declared in Types unit
∞觅青森が 2024-08-01 21:24:04

Delphi IDE 和(在较小程度上)编译器非常脆弱。 许多非预期的构造会导致奇怪的问题。 因此,很难立即猜出您的案例出了什么问题。 (根据你描述你的单元的方式,我怀疑 IFDEF 可能会发挥作用。)

你不能注释掉代码中的部分直到问题消失,看看是什么原因导致的吗? 如果您的单位是 ABC D,请尝试使用

(* A B *) C D

,如果没有导致错误,请尝试

A B (* C D *)

然后也许

(* A *) B (* C D *)

等等,直到您的单位只剩下一小部分不可还原的部分。 由于您正在测试 IDE 而不是编译器,因此您可能不需要注释掉的单元来编译而不会出现错误。

The Delphi IDE and (to a lesser extent) compiler are quite fragile. Many non-expected constructs will cause strange problems. So it's not easy to guess off-hand what's the trouble in your case. (The way you describe your unit, I suspect the IFDEF's may play a role though.)

Can't you comment-out parts on the code until the problem disappears, to see whay may causes it ? If your unit is A B C D, try with

(* A B *) C D

and if that causes no error, try

A B (* C D *)

then perhaps

(* A *) B (* C D *)

etc. until only a small unreducible part of your unit remains. Since you're testing the IDE not the compiler, you probably don't need your commented-out unit to compile without error.

橘亓 2024-08-01 21:24:04
{$ifdef something}
   type myclass = class
{$else]
   type myclass = class(existingclass);
{$endif}

看起来很混乱,但没有崩溃。

另外,财产声明中的 ifdef 似乎扰乱了系统。

在 D2009 中,

输入 myrecord = record
someting : 0..31 组;
结尾;

似乎抑制了完成(它咕哝着 SET),但没有崩溃。

更新

这是“一组”构造本身,完成无法处理(而编译器可以)

更新2:属性声明中的IFDEF也会使IDE感到困惑/崩溃。

{$ifdef something}
   type myclass = class
{$else]
   type myclass = class(existingclass);
{$endif}

Seems to confuse, but not crash.

Also ifdef in property declarations seems to upset the system.

In D2009,

type myrecord = record
someting : set of 0..31;
end;

seemed to inhibit completion (it mumbles about SET), but no crash.

update

It is the "set of" construct itself the completion can't handle (while the compiler can)

update 2 : IFDEFs in property declarations also confuse/crash the ide.

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