Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Debugging; right click on text menu in editor option "Run to Cursor" so it executes upto the where the cursor is (typically where one right clicks)
Thanks for posting chris, I used the feedback option in Mono Develop not knowing of this bugzilla repository. When executing, it should stop at the next breakpoint if it it's hit before arriving to the desired position.
I guess this pretty much involves adding a temporary breakpoint that's removed when any breakpoint is hit.
that sounds like the generalized solution; if the cursor is in a location which cannot have a breakpoint (ex. a blank line between statements) then a simple dialog should appear saying "Cannot run to that location, choose a valid break point area".
We can't really verify whether a location is valid for a breakpoint until the project has been built in that configuration. Instead, you get a breakpoint resolution warning when the type in loaded. We could probably special-case these breakpoints so that if they failed to resolve, we'd instead insert one in the closest possible location.
I have concerns of the closest location possibly annoying and not conforming to a good user experience. While in most cases it would be a line above or below, it's will not appear to be to the cursor and the line could actually be many lines apart in the cases of comments, documentation, etc. Even a few lines off, while deterministic from an implementation standpoint, may feel non-deterministic to the user who may expect otherwise.
I'm currently neive to the mono develop architecture, but perhaps a different approach would be comparing line location with the debugging metadata.
In the original approach, if nearest were to be applied, then nearest above would be strongly preferred to avoid executing a line inadvertently below the cursor.
It's not that simple. Firstly, in order to have debugging metadata, the project has to have been built in that configuration. Since we don't have a background compiler, that means you'd have to build before you could use the 'run to this location' command, which would be really cumbersome. Secondly, debugging metadata only provides mappings of line numbers to IL offsets, and not every IL offset is guaranteed to be a valid location for a breakpoint or stepping, since that depends on implementation details of the runtime and debugger. The best we could reliably do in advance is to filter out the really obvious ones (blank lines etc).
If you consider this problem applied to breakpoints in general, it's harder, since breakpoints' validity could change as other code in the file changes. The only really reliable way is to trigger a warning at runtime when a breakpoint fails to resolve.
The reason I suggested inserting the temporary breakpoint in the closest location is because I think that'd provide the best user experience. Stopping a couple of lines too early is much more useful than just continuing on and issuing a warning. I'd almost go so far as to suggest we do this for all breakpoints.
sounds fair; thanks for the details. Running to desired point is useful enough to warrant some solution and under the circumstances described is stopping on the last line available on or before the cursor would be the better user experience
*** Bug 4035 has been marked as a duplicate of this bug. ***
*** Bug 15383 has been marked as a duplicate of this bug. ***
Can we, pretty please, implement this?