This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 195144 - "Evaluate Expression" action disabled
Summary: "Evaluate Expression" action disabled
Status: CLOSED WONTFIX
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.0
Hardware: PC Linux
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-07 21:19 UTC by Jiri Kovalsky
Modified: 2011-02-14 14:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Debug menu with Evaluate Expression item disabled. (104.17 KB, image/png)
2011-02-07 21:19 UTC, Jiri Kovalsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2011-02-07 21:19:45 UTC
Created attachment 105710 [details]
Debug menu with Evaluate Expression item disabled.

Product Version: NetBeans IDE 7.0 Beta 2 (Build 201102052128)
Java: 1.6.0_23; Java HotSpot(TM) 64-Bit Server VM 19.0-b09
System: Linux version 2.6.35-22-generic running on amd64; UTF-8; cs_CZ (nb)
Userdir: /home/cesilko/.netbeans/7.0beta2

Description:
============
"Evaluate Expression" action is greyed out when debugging session is started. This is regression against NetBeans IDE 6.9.1 behavior. See attached screenshot.

Steps to reproduce:
===================
1. Launch NetBeans IDE 7.0 Beta 2 candidate build #201102052128 with clean userdir.
2. Generate Anagram Game sample project and invoke "Debug > Debug Main Project" from main menu.
3. Once the debugger and application is started invoke "Debug" menu to see that 
"Evaluate Expression" action is disabled.
Comment 1 Martin Entlicher 2011-02-08 09:50:05 UTC
And does it enable when debugger hits a breakpoint?
We can not evaluate anything when all threads are running. There needs to be some context - suspended thread - in which the evaluation takes place.
It works fine for me when a breakpoint is hit.
Comment 2 Jiri Kovalsky 2011-02-11 11:25:02 UTC
Yes, I understand that Martine. Evaluation of expressions does not make sense if the program execution is not stopped. But it's a regression so I reported it. So, in other words this (disabled action) is intentional change against NetBeans IDE 6.9.1? Thanks for your clarification.
Comment 3 Martin Entlicher 2011-02-11 13:30:55 UTC
Aha, so I've checked the history...
Originally, the Evaluate Expression action was enabled only when there was some current thread. But then the action was made always enabled by Dan in changeset http://hg.netbeans.org/releases/rev/e6ce26f3cb14. After I was moving the action into debugger core UI - http://hg.netbeans.org/main/rev/8fc152089118, I've reused the old behavior.

Unfortunately, there's no reference to some UI proposal or spec. when the action was made always enabled. I'll try to find some...
The Evaluate Expression window is not usable till debugger is stopped on some breakpoint anyway.
Comment 4 Jiri Kovalsky 2011-02-11 13:54:17 UTC
According to the NetBeans IDE 6.8 test specification [1] the action should be enabled. Probably just to have a chance to open the evaluator window.

[1] http://wiki.netbeans.org/TS_68_Debugger_Sanity#Test_suite:_Evaluate_Expression_View
Comment 5 Martin Entlicher 2011-02-11 14:02:58 UTC
O.K. I'm reopening this to reevaluate...
Comment 6 Martin Entlicher 2011-02-14 09:04:53 UTC
I'm sorry, but this is now impossible to implement.
After changes in issue #191394 the "Evaluate Expression" action looks for a currently active debugger-specific provider and run it. Java debugger opens a different evaluator window than gdb debugger (which is under Window -> Debugging -> Expression Evaluation, also disabled when C/C++ session is not running). Therefore, if no debugger session is active, there's no universal evaluator window to open.

IMHO this is no problem for NetBeans users. When there's no debugging session, there's no way to evaluate anything. This should not be a regression from usability point of view.
Comment 7 Jiri Kovalsky 2011-02-14 14:46:43 UTC
OK, I understand. Then I only updated the test specification accordingly. Thanks for the investigation Martine.