断点上的橄榄子弹在SharpDevelop中意味着什么

时间:2010-03-09 13:45:10

标签: c# debugging sharpdevelop

有时当我设置断点并开始调试其颜色从红色变为橄榄色时:

yellow bullet

当它发生时,调试根本不会停止 - 忽略断点。

我想知道为什么会发生这种情况以及将来如何避免这种情况。

编辑:

只有在注释的代码行上设置断点时才会发生:

not commented olive bullet

3 个答案:

答案 0 :(得分:3)

它是开源的。下载并找到相关代码花了我大约5分钟:

   public void DrawBreakpoint(Graphics g, int y, bool isEnabled, bool isHealthy)
    {
        int diameter = Math.Min(iconBarWidth - 2, textArea.TextView.FontHeight);
        Rectangle rect = new Rectangle(1,
                                       y + (textArea.TextView.FontHeight -
                                                           diameter) / 2,
                                       diameter,
                                       diameter);


        using (GraphicsPath path = new GraphicsPath()) {
            path.AddEllipse(rect);
            using (PathGradientBrush pthGrBrush = new PathGradientBrush(path)) {
                pthGrBrush.CenterPoint = new PointF(rect.Left + rect.Width / 3 , 
                                            rect.Top + rect.Height / 3);
                pthGrBrush.CenterColor = Color.MistyRose;
                Color[] colors = {isHealthy ? Color.Firebrick : Color.Olive};
                pthGrBrush.SurroundColors = colors;

                if (isEnabled) {
                    g.FillEllipse(pthGrBrush, rect);
                } else {
                    g.FillEllipse(SystemBrushes.Control, rect);
                    using (Pen pen = new Pen(pthGrBrush)) {
                        g.DrawEllipse(pen, new Rectangle(rect.X + 1, rect.Y + 1, 
                                                         rect.Width - 2, 
                                                         rect.Height - 2));
                    }
                }
            }
        }
    }

该圆圈颜色为“Color.Olive”。如果您想知道isHealthy为何为假,请使用源代码。我可以快速找到几个原因:源文件已更改或模块未加载,可能还有更多。

答案 1 :(得分:2)

如果将程序编译为“release”,则会发生这种情况。

答案 2 :(得分:1)

在您设置断点的地方评论您的行。