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.
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.
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.
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.
Fixed (although it took me 3+ days to get hg on Solaris to work:-)
Pointers are still not expandable in Watches.
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.
Making this 6.1 instead of 6.1m2 because I've been asked to focus on Windows issues first.
Focusing on Windows for m2
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.
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...
Fixed in http://hg.netbeans.org/main?cmd=changeset;node=369908fcb6c7.
verified in 200802110004 build