debugging - Some breakpoints are disabled (gray-crossed) in Delphi debugger – why? How to enable all of them? - Stack Overflow

I’m working with Delphi and placing breakpoints (red circles on the left side of the editor near the li

I’m working with Delphi and placing breakpoints (red circles on the left side of the editor near the line numbers). When I start debugging (e.g., using F4 or Run > Run to Cursor), some of the breakpoints remain active and stop the debugger (indicated by a red circle with a green check mark), but some breakpoints are shown with a gray cross, and the debugger does not stop at them.

What do these gray-crossed breakpoints mean?

Here’s what I’ve observed:

  • The breakpoints with a gray cross are located in a .pas file that defines a component.
  • I’ve added this .pas file to my project manually from the component’s source code.
  • I expected the debugger to stop at all breakpoints, but it seems to ignore some of them.

My questions:

  1. What causes a breakpoint to be marked with a gray cross and ignored by the debugger?
  2. Is Delphi performing some kind of decision to determine which breakpoints to honor?
  3. How can I ensure all my breakpoints are respected, including those in manually added component source files?

Additional information: all my units (.dcu files) are stored what I have indicated in Unit output directory of the project options. And, of course, the units from the component source, create .dcus here and alse recreates (at lest judging by last modified time) units here. Also: if I add some code to this component file (e.g. MessageDlg call) then this code works normal in the final .exe - I just have a problem with breakpoints: they are crossed and ignored.

I’m working with Delphi and placing breakpoints (red circles on the left side of the editor near the line numbers). When I start debugging (e.g., using F4 or Run > Run to Cursor), some of the breakpoints remain active and stop the debugger (indicated by a red circle with a green check mark), but some breakpoints are shown with a gray cross, and the debugger does not stop at them.

What do these gray-crossed breakpoints mean?

Here’s what I’ve observed:

  • The breakpoints with a gray cross are located in a .pas file that defines a component.
  • I’ve added this .pas file to my project manually from the component’s source code.
  • I expected the debugger to stop at all breakpoints, but it seems to ignore some of them.

My questions:

  1. What causes a breakpoint to be marked with a gray cross and ignored by the debugger?
  2. Is Delphi performing some kind of decision to determine which breakpoints to honor?
  3. How can I ensure all my breakpoints are respected, including those in manually added component source files?

Additional information: all my units (.dcu files) are stored what I have indicated in Unit output directory of the project options. And, of course, the units from the component source, create .dcus here and alse recreates (at lest judging by last modified time) units here. Also: if I add some code to this component file (e.g. MessageDlg call) then this code works normal in the final .exe - I just have a problem with breakpoints: they are crossed and ignored.

Share Improve this question edited Mar 27 at 17:46 AmigoJack 6,1852 gold badges19 silver badges34 bronze badges asked Mar 27 at 8:42 TomRTomR 3,2366 gold badges43 silver badges108 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 5

Answers to your questions:

  1. Breakpoints are grayed out when breakpoint information is not available. The compiler must generate the necessary information for the debugger. For this:

    1. It is necessary to enable the generation of this debugging information in the project settings:
      Project options/Building/Delphi Compiler/Linking/Debug information.

    2. Enable Projects/Your Project/Build Configurations/Debug.

    3. Conditional compilation directives should be checked - they can disable part or all of the file from generating information for the {$D-} debugger.

    4. It is necessary to rebuild the project: Projects/Your Project/Build. The \*.rsm files will be created.

    5. Now you can debug.

  2. The procedure is simple: if there is no debug information, there is no breakpoint.

  3. You won't have any breakpoints in gray.

PS: It is necessary to build a project with the option of adding debugging information enabled. It won't add itself! Only then the project will be fully ready for debugging.

When creating a finished project, debugging information is deleted from it (Release mode).

The .pas file from my component included this code:

{$D-}
interface

And this directive, of course, prevents to include the debugger info into the .dcu file. So: commenting out this directive enabled breakpoints.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744103133a4558621.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信