Bug 3595 - Cannot set breakpoint to valid expression
Summary: Cannot set breakpoint to valid expression
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Zoltan Varga
Depends on:
Reported: 2012-02-22 14:16 UTC by Marek Safar
Modified: 2017-07-11 22:47 UTC (History)
3 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 GitHub or Developer Community 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 Marek Safar 2012-02-22 14:16:22 UTC
using System.Globalization;

class C
	internal static void FindSign (ref int pos, string s, NumberFormatInfo nfi, ref bool foundSign, ref bool negative)
		if ((pos + nfi.NegativeSign.Length) <= s.Length &&
			s.IndexOf (nfi.NegativeSign, pos, nfi.NegativeSign.Length) == pos) {
			negative = true;
			foundSign = true;
			pos += nfi.NegativeSign.Length;
		} else if ((pos + nfi.PositiveSign.Length) < s.Length) {
			int res = s.IndexOf (nfi.PositiveSign, pos, nfi.PositiveSign.Length); // Set a breakpoint here and StepInto, debugger goes to last return
			if (s.IndexOf (nfi.PositiveSign, pos, nfi.PositiveSign.Length) == pos) { // Or set a breakpoint here, it's never hit
				negative = false;
				pos += nfi.PositiveSign.Length;
				foundSign = true;

	public static void Main ()
		int i = 4;
		string s = "aaxxxxxxxxxxxxx";
		bool b2 = false, b3 = false;

		FindSign (ref i, s, CultureInfo.InvariantCulture.NumberFormat, ref b2, ref b3);
Comment 1 Rodrigo Kumpera 2013-09-09 12:03:21 UTC
Does this remain valid?