« Return to Thread: [67cat][debugger] Expression evaluation issue?

Re: [67cat][debugger] Expression evaluation issue?

by Martin Entlicher :: Rate this Message:

Reply to Author | View in Thread

Claudiu, the expression that you evaluate have the same effect as if you
execute it. This was implemented intentionally, since in the past many
users complained that evaluation of "a = 10" does not set the value to "a".
You're evaluating "subtract--", which is exactly the same as "subtract =
subtract - 1". You're setting a new value to subtract, so no surprise
that it change the program.

The same effect have method evaluation. If you have a method:
doSubtract() {
   subtract--;
}
and evaluate "doSubtract()", the value of "subtract" will also change
and there's nothing we can do about that.

Therefore we've decided that debugger will behave as consistently and
transparently as possible and evaluate everything as if it was executed.

Does that make sense?
Martin

Claudiu Bulcu wrote:

> Hi,
>
> Have you seen the following before?
>
> I have an expression like this:
>
> paramsCount - (subtract--)
>
> both being int variables.
>
> Every time I hover over the selected expression (quick evaluation),
> the result is incremented over and over again. Is this by design. I
> would expect that expression being evaluated to the same value,
> regardless what the subtract value becomes later in my code.
>
> Try this at home with NB 6.7 RC3.
>
> Regards,
>
> --
> Claudiu Bulcu
> Software Developer
>
> "A wise person will listen and take in more instruction, and a man of
> understanding is the one who acquires skillful direction"
>
> http://udy.smugmug.com
> www.bulcu.ro <http://www.bulcu.ro>

 « Return to Thread: [67cat][debugger] Expression evaluation issue?