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 126197 - Pointers are not expandable in LV and Watches
Summary: Pointers are not expandable in LV and Watches
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All Linux
: P2 blocker (vote)
Assignee: _ gordonp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-29 15:11 UTC by Alexander Pepin
Modified: 2009-06-25 10:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pepin 2008-01-29 15:11:55 UTC
Steps to reproduce:
- create a new C++ application wiith the following source:
struct A{
    int a;
    bool b;
    char c;
    double d;
};
//
int main(int argc, char** argv) {
    
    A aa;
    A* pA = &aa;
    aa.b = false;
    
    for( int i=0; i<5; i++){
        aa.a = i;
        aa.b = !aa.b;
        aa.c = 'a'+i;
        aa.d = 1.0*i/aa.c;
    }
    
    return 0;
}

- build it
- do step into
- create a new watch for "pA"
- open LV
- do step over
Result: "pA" is not expandable neither in Watches nor in LV.
Comment 1 _ gordonp 2008-01-29 16:44:35 UTC
I've tested (recently) mostly on Solaris and Windows and this problem is intermittent on
both of those platforms (although I do see it and am actively working on it). I'm downloading
the latest Linux nightly and will give it a shot there.

Note: The root cause of this issue is identical to 126196. Once one is fixed, the other should
be too.
Comment 2 _ gordonp 2008-01-30 22:19:51 UTC
In AbstractClass.isValidPointer(String x), I parsed x into an int. On Linux this parse
threw an exception (caught) and returned false. I switched the code to parse it into a
long and it now works.

I'm leaving this as Started because of hg problems on Solaris. Hopefully I'll get my
push to work and then I'll mark it fixed tomorrow.
Comment 3 _ gordonp 2008-01-31 23:47:22 UTC
Fixed (although it took me 3+ days to get hg on Solaris to work:-)
Comment 4 Alexander Pepin 2008-02-04 15:40:10 UTC
Pointers are still not expandable in Watches.
Comment 5 Alexander Pepin 2008-02-04 16:02:25 UTC
The fix works only for the first watch in the list of already created watches. If user creates a new watch for a pointer
then it can not expandable.
For the sample above it could be illustrated with the following scenario:
- create the sample application
- do step into
- do step over
- switch to LV
 argv - is expandable, OK
 pA - is expandable, OK
- switch to Watches
- create a new Watch for "argv"
 argv - is not expandable!!!
- create a new Watch for "pA"
 pA - is not expandable!!!
- stop debugging
- do step into once again
- switch to Watches
Result: pA is now expandable but argv is not.




  
Comment 6 _ gordonp 2008-02-04 22:13:07 UTC
Making this 6.1 instead of 6.1m2 because I've been asked to focus on Windows issues first.
Comment 7 _ gordonp 2008-02-04 22:14:38 UTC
Focusing on Windows for m2
Comment 8 _ gordonp 2008-02-06 01:23:52 UTC
I think this is not an exclusive Linux bug and I think I fixed it in changeset
http://hg.netbeans.org/main?cmd=changeset;node=75eee5aeee9a.

There is a race condition in setting the type of a watch. The type can be set
from the Watch View (WV) being displayed or it can get set from the end-of-step
change. Since these happen on separate threads at approximately the same time,
I have no control over which gets called first.

Pre-fix, the step update worked correctly but the WV update used the wrong gdb
type request (there are 2 type commands, one asks for the short type name and
the other for detailed type information). Making the WV update use the correct
type command fixed a problem I had on Windows. I just started a clone/build on
Linux and will see if it also fixes the problem in this issue.
Comment 9 _ gordonp 2008-02-06 02:01:48 UTC
Linux build done - My fix improved it. I get a turner in LV but not in WV. Since
its a Linux-only issue (still), I won't pursue it for now...
Comment 10 _ gordonp 2008-02-08 00:37:44 UTC
Fixed in http://hg.netbeans.org/main?cmd=changeset;node=369908fcb6c7.
Comment 11 soldatov 2008-02-11 10:04:05 UTC
verified in 200802110004 build