为什么断点是绿色的并且不起作用? [英] Why are breakpoints green and not working?

查看:201
本文介绍了为什么断点是绿色的并且不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试对代码运行调试,但是不知何故它停止了工作。这是一个片段及其显示的绿线:

I am trying to run a debug on my code, but somehow it stopped working. Here is a snippet and the green lines it is showing:


  • 我试图右键单击我的项目,然后清理

  • 尝试
    删除临时文件,例如 .stat .dcu

  • 来回切换到发布 Debug 模式,重建,重新编译。

  • Project->下的 Debugging 选项。选项-> Delphi编译全部设置为true。

  • 检查搜索路径中是否没有重复的文件。

  • 其他项目正常运行。

  • 也尝试过宣誓。

  • I have tried to right click on my project and clean it.
  • Tried to delete temporary files, like .stat and .dcu.
  • Switching back and forth to Release and Debug modes, rebuilding, recompiling them.
  • The Debugging options under Project -> Options -> Delphi compilingare all set to true.
  • Checked if there are no duplicate files in the search paths.
  • Other projects are working correctly.
  • Also tried swearing.

我在做什么错?

推荐答案

这是一种正常的编译器行为。当从未从程序内部的任何地方调用过程(代码行)时,就会发生这种情况。编译器会跳过此类过程和功能(其中的所有代码行)。
看图片。

It is a kind of normal compiler behaviour. It ever happens when the procedure (code line) is never called from anywhere inside your program. Compiler skips such procedures and functions (all the code lines within them). See the picture.

您只需检查该过程(行)是否真的至少在应用程序内的任何位置被调用过一次即可。

You just need to check if the procedure (line) is really at least once called from anywhere inside your application.

已附加

当永远都不能调用代码行并且可以在编译时对它(逻辑语句)进行评估(结果是预先知道的,并且在运行时不会受到影响)时,也会发生这种情况。编译器优化跳过这些行的代码。这就是为什么它不接受中断的原因。

This also takes place when the code line can never be called and this (the logic statement) can be evaluated at compilation (the result is known in advance and can not be affected at runtime). The compiler optimizes the code skipping such lines. That is why it does not accept breaks at them.

这是后一过程的分解图。第37和38行的如果为false则... 语句被省略:

Here is a diassembly of the latter procedure. The if false then ... statement at lines 37 and 38 is omitted:

这篇关于为什么断点是绿色的并且不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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