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

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

by Claudiu Bulcu :: Rate this Message:

Reply to Author | View in Thread

Hi Martin,

I thought that the evaluator works on copy values... That way my application's flow wouldn't be disrupted, and the debugging would be meaningful (get what expected, according to my in data, an not the data the evaluator brings in). If I wanted to change my data I would have changed (voluntarily) the initial variables values at debug time.

But of course this is an external view of things. Maybe there are technical limitations to achieving that functionality, I'm not aware of.

On Thu, Jun 18, 2009 at 11:36 AM, Martin Entlicher <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>



--
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

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