I'm sorry, but IMO that's about the most useless thing I can think of.
What you've basically said is that if you're going to debug your
application, if you want to check on something, you've just changed the
state of your program. This renders your debugging session absolutely
useless.
Every debugger I've worked with separates evaluate from assign so a
person can evaluate the state of the running program at any time, and as
frequently as needed, but only assign a new value when explicitly doing so.
I experienced this bug by mousing over the code and doing an evaluation
of the value under the mouse pointer. In my case, it threw an NPE which
trashed my debugging session because it bypassed the code I was trying
to test.
I can't see how this could possibly be beneficial because if what you
say holds true, I can't evaluate the parameter values prior to stepping
into the module.
Eric
Martin Entlicher wrote:
> 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>
>