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 112660 - Local variable and Watch nodes collapse after every step
Summary: Local variable and Watch nodes collapse after every step
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P1 blocker (vote)
Assignee: _ gordonp
URL:
Keywords:
: 117975 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-08-13 15:35 UTC by Alexander Pepin
Modified: 2009-06-25 10:59 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch against version 1.49 (release60 with previously proposed updates) version (1.42 KB, patch)
2007-11-08 16:00 UTC, _ gordonp
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pepin 2007-08-13 15:35:06 UTC
On windows expanded nodes in Local Variables window get collapsed after every step command. That creates a lot of
inconvenience for a user who is trying to watch a class variable etc.
Comment 1 _ gordonp 2007-08-13 16:27:32 UTC
Please take a 2nd look. There is a known timing problem where sometimes no turner is displayed
so a previously expanded node is collapsed. I don't know of any problems where an expanded node
is still recognized as a struct/class but not expanded. Please see if what you're reporting is
the same as the known timing problem.
Comment 2 Alexander Pepin 2007-08-13 16:53:51 UTC
No it's another issue. I use a sample that does not have problem with performance. 
Comment 3 Alexander Pepin 2007-08-13 16:58:13 UTC
here it is:
#include <iostream>

using namespace std;



class A{
public:
    char c;
    int a;
    int b[5];
    int* arr;
    union un_t{
        int iii;
        char ch;
        float f;
    } un;
};
//
// 
//
int main(int argc, char** argv) {
    
    A aaa;
    aaa.a = 3;
    aaa.arr = new int[5];
    for(int i= 0; i<5; i++){
        aaa.arr[i] = i;
        aaa.b[i] = 5-i;
    }
    aaa.un.ch = 'a';
    aaa.c = aaa.un.ch;
    for(;;){
        cout<<"step"<<endl;
    }
    
    
    return (EXIT_SUCCESS);
}
Comment 4 _ gordonp 2007-08-13 17:25:38 UTC
For the short term, can you use a test case which doesn't use unions? I'll let you know when
unions are working.
Comment 5 _ gordonp 2007-08-16 21:31:27 UTC
I've duplicated the problem and started working on a fix. My 1st fix broke other stuff but
I'll continue working on it.
Comment 6 _ gordonp 2007-08-22 04:53:48 UTC
Found the problem and fixed it in todays commit.
Comment 7 _ gordonp 2007-08-22 04:55:35 UTC
Fixed (2nd try - IssueZilla error)
Comment 8 soldatov 2007-09-10 14:44:19 UTC
Verified in 070908 build
Comment 9 Alexander Pepin 2007-09-26 16:29:37 UTC
The bug is reproducible with a new scenario:
- create a new project with the following source code:
#include <iostream>

using namespace std;
//
// 
//

class A{
    int a;
};
class B {
    int b;
//    A a;
};
class D{
    double d;
};
class C : public A, 
        public B,
        public D{
    char c;
    
};

int main(int argc, char** argv) {
    
    C c;
    
    cout<<"start"<<endl;
    cout<<"end"<<endl;
    return (EXIT_SUCCESS);
}

- do step into project
- do step over to create an instance of "C"
- open LV
- expand all subnodes of variable "c"
- set a new value for "c-><Base Class>A->a" e.g. 111
- do step over
Result: All subnodes of "c" get collapsed.
Comment 10 Alexander Pepin 2007-09-26 17:16:45 UTC
I raise the priority so it's a regression compared to build 20070925 (appeared in 20070926) and now it's reproducible on
all platforms.
Comment 11 _ gordonp 2007-10-06 00:41:00 UTC
I have a workaround which can be used if this defect is blocking other tests. Click to another
debugger view (Call Stack, Breakpoints, or Watches) and then back to LV. Any missing turners
should now be displayed and all expanded nodes should be expanded.
Comment 12 Alexander Pepin 2007-10-06 17:14:30 UTC
build 20071006 works fine with the original scenario 
but 
in a class function child nodes of "this" or any another element get collapsed after each step (workaround works)

#include <stdio.h>

class D{
    double d;
};
class C: public D{
    float c;
};
class B{
    C cc;
    int b;
public:
    void foo(){
        //cout<<"in class B"<<endl;
        C c;
        B* pClass = this;
        printf("Inside B\n");
        for(int i = 0; i<3; i++){
            printf("step %d\n", i);
        }
    }
};
int main(int argc, char** argv) {
    B* pb = new B();
    pb->foo();
    return 0;
}
Comment 13 _ gordonp 2007-10-08 14:24:25 UTC
*** Issue 117975 has been marked as a duplicate of this issue. ***
Comment 14 _ gordonp 2007-10-09 00:17:27 UTC
Fixed
Comment 15 Alexander Pepin 2007-10-16 16:30:31 UTC
Fixed on all platforms except Windows.
On windows (GDB 6.5) the bug is reproducible using the following scenario:
- create a new C++ Application with the following source code:

#include <stdlib.h>

//
class A{
    int a;
};
// 
class B: public A{
    float b;
};
//
class C{
    int* pI;
    B* pB;
public:
    C(){
        pI = new int(10);
        pB = new B();
    }
};
//
int main(int argc, char** argv) {

    C* pC = new C();

    C* cc[4];

    for(int i=0; i<4; i++){
        cc[i] = new C();
    }
    
    return (EXIT_SUCCESS);
}

- build the project
- set a breakpoint at "for" statement
- run debugger
- when the BP is reached open LV and expand "pC" node and all its subnodes
- keep doing "step over" through the "for" block
Result: After some steps over all nodes in LV get collapsed.
Comment 16 Alexander Pepin 2007-10-23 15:59:49 UTC
Now as it has become a Windows specific bug I downgrade the priority to P2 assuming that it should be fixed in NB 6.0.
Comment 17 Alexander Pepin 2007-11-07 19:48:18 UTC
The bug is also can be reproduced in Quote project
- set a breakpoint in line 115 of quote.cc
- run debugger
- open LV
- enter "John" in console
- when the breakpoint is reached do step over
Result: All nodes in LV get collapsed, turners disappear, types disappear.
Comment 18 _ gordonp 2007-11-08 16:00:54 UTC
Created attachment 52730 [details]
Patch against version 1.49 (release60 with previously proposed updates) version
Comment 19 _ gordonp 2007-11-08 16:03:03 UTC
Fixed in 20071108 nightly.
Comment 20 Alexander Pepin 2007-11-08 16:09:45 UTC
verified in trunk build 20071108
Comment 21 Jesse Grodnik 2007-11-08 17:16:33 UTC
Escaleted according to HR process.
Comment 22 Thomas Preisler 2007-11-08 17:29:29 UTC
Fixed reviewed by Thomas Preisler (thp).
Comment 23 Alexander Pepin 2007-11-12 11:32:03 UTC
verified in RC1 build