Bug 11072 - Break points on empty lines and deleted lines
Summary: Break points on empty lines and deleted lines
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Debugger ()
Version: 4.0.1
Hardware: PC Windows
: Low enhancement
Target Milestone: ---
Assignee: Jeffrey Stedfast
Depends on:
Reported: 2013-03-12 11:35 UTC by Tracy
Modified: 2014-06-11 16:07 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Tracy 2013-03-12 11:35:29 UTC
I have noticed a couple bugs with the break points.
1. You can set a break point on a row with just white space.
2. If you have a break point on a row and delete that row with a backspace, the break point moves up to the next line.

Often I will but a debug line of code in place and set a break point on it.
Once I am done with it I delete the line.
I dont need it to put the break point on the next line above the line I just removed.
If I want to break there I can put one there.
Its not a time saver in any way, rather a time waster as I have to do an extra click to get rid of it, or if I dont see it get caught at the next run.
Comment 1 Mike Krüger 2013-03-13 01:49:10 UTC
btw. source editor view is a bad place to handle the debugger breakpoint logic.
(No I didn't put it there)

It should be done using a text editor extension instead. Maybe the breakpoint logic can have an extension point for language bindings if they allow breakpoints in line XXX.

The default logic would just be allow breakpoints in non empty lines. The C# binding however may allow breakpoints only in lines that make sense (using the AST).
Comment 2 Jeffrey Stedfast 2013-03-13 13:14:46 UTC
Breakpoints on blank lines get moved once the debugger is started and we resolve the breakpoint to the nearest instruction (same as what Visual Studio does, btw, it just does it immediately instead of waiting until the debugger is started).

I just checked Visual Studio and they delete the breakpoint when you delete the entire line that it is on, so we should probably do the same.
Comment 3 Mike Krüger 2013-03-14 02:28:34 UTC
The text markers the breakpoints use are just for drawing - not for control. They've a default behavior which can't match all possible cases. The control of the breakpoints should be added outside.
Comment 4 Jeffrey Stedfast 2014-06-11 16:07:34 UTC
When you delete a line of text that a breakpoint is on, it is moved or deleted as appropriate.