V
V
Viktor Gorobchuk2020-04-29 18:44:47
linux
Viktor Gorobchuk, 2020-04-29 18:44:47

Breakpoints don't work on Linux. Why can this be?

Breakpoints don't work when running in vs code or jetbrains rider. I am running a program and I want to get the result of this method. at runtime, I put a breakpoint at any point and it doesn't fire.
They work for me only if they are set before debugging starts and if in this method I put the output on the console.
The code executes adequately and the output works. It's just that the method works for a very long time and I want to see what iteration after 15 seconds.

static double Result()
        {
            double result = 2;
            for (int i = 3; i < 2000000; i+=2)
            {
                bool check = true;
                for (int k = 2; k <= i / 2; k++)
                    if (i % k == 0)
                    {
                        check = false;
                        break;
                    }

                if (check)
                    result += i;
            }

            return result;
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-04-30
@Gorob

Most obvious build in Debug mode?
In addition, use the classes from System.Diagnostics
Debug
Trace
To display values, they are even better in something for monitoring values

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question