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 245604 - Watches should be context-sensitive
Summary: Watches should be context-sensitive
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 8.0.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Maria Tishkova
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-11 22:21 UTC by tbrunhoff
Modified: 2016-07-06 14:39 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tbrunhoff 2014-07-11 22:21:16 UTC
In the same way that you've added project-specific breakpoints, you really need to add context-sensitive watches.  A simple example of the benefit is, given the functions below:

    void main()
    {
        while (true) {
            a();
            b();
        }
    }

    void a() { int x = 1; dosomething(x); }
    void b() { int y = 1; dosomething(y); }

and you have a watch defined for both x and y, the debugger yells at you about y when you are in a() and yells about x when you are in b() and yells about both x and y when you are in main().

This really would need to be a bit richer to understand the scope of variables.  For example, a static or global variable should fall in the global breakpoints.... and for extra credit, it would be good to allow the scope of watch be restricted, if needed, although a rare need.

Similar to this last one, but required, I think, rather than extra credit, would be to allow a name that matches a local scope have its watch scope expanded to global or even to a list of functions.


Product Version: NetBeans IDE Dev (Build 201407090001)
Updates: Updates available
Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.12.6-200.fc19.x86_64 running on i386; UTF-8; en_US (nb)
User directory: /home/toddb/.netbeans/dev
Cache directory: /home/toddb/.cache/netbeans/dev