Bug 196846 - Variables view does not contain latest arguments values
Variables view does not contain latest arguments values
Status: VERIFIED FIXED
Product: cnd
Classification: Unclassified
Component: Debugger
7.0
All All
: P1 (vote)
: 7.0
Assigned To: Egor Ushakov
issues@cnd
: 70_HR_FIX
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-18 11:59 UTC by Egor Ushakov
Modified: 2011-03-31 13:29 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Egor Ushakov 2011-03-18 11:59:02 UTC
steps to reproduce:
- create welcome sample
- step into
- open variables tab
- change argc value to 7
- switch to any other tab and then back to variables
it will show argc value as 5
Comment 1 Alexander Pepin 2011-03-21 14:21:32 UTC
Such behavior misleads the user as (s)he can see two different values of the same variable simultaneously.  I believe it should be fixed by FCS.
Comment 2 Alexander Pepin 2011-03-21 17:59:32 UTC
Another scenario (string values are not updated):
- create Quote sample
- set breakpoints in lines 133 and 67
- create a watch for customerName
- start debugging
- enter any string e.g. "aaa", debugger stops in line 133
- open Variables, it shows "aaa" for both the watch and variable (customerName)
- do continue, debugger stops in line 67, Variables view is updated according to context
- do continue and enter "zzz", debugger stops in line 133
- open Variables
Result: Watch for "customerName" shows "zzz" whereas a variable "customerName" remains "aaa".

Gdb log is:
~"GNU gdb 6.8.0.20080328-cvs (cygwin-special)\n"
~"Copyright (C) 2008 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n"
~"This is free software: you are free to change and redistribute it.\n"
~"There is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\n"
~"and \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-pc-cygwin\".\n"
&"C:\\\\Users\\\\ap153252/.gdbinit: No such file or directory.\n"
(gdb) 
2-gdb-set print repeat 0
3-gdb-set backtrace limit 1024
4-file-exec-and-symbols  "C:/Users/ap153252/Documents/NetBeansProjects/Quote_22/dist/Debug/Cygwin_4.x-Windows/quote_22"
2^done
(gdb) 
3^done
(gdb) 
4^done
(gdb) 
5-file-list-exec-source-file
6cd C:\Users\ap153252\Documents\NetBeansProjects\Quote_22
7-exec-arguments 
8-var-create - * customerName
9-var-update --all-values * 
5^done,line="109",file="quote.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc",macro-info="0"
(gdb) 
10-break-insert -f "C:/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc:133"
1
11-break-insert -f "C:/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc:67"
1
12-break-insert -t _start
&"cd C:\\Users\\ap153252\\Documents\\NetBeansProjects\\Quote_22\n"
~"Working directory /cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Quote_22.\n"
6^done
(gdb) 
7^done
(gdb) 
&"mi_cmd_var_create: unable to create variable object\n"
8^error,msg="mi_cmd_var_create: unable to create variable object"
(gdb) 
9^done,changelist=[]
(gdb) 
10^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0040263c",func="main",file="quote.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc",line="133",times="0"}
(gdb) 
&"\n"
1^done
(gdb) 
11^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00401f26",func="getDiscountFor",file="quote.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc",line="67",times="0"}
(gdb) 
&"\n"
1^done
(gdb) 
&"Function \"_start\" not defined.\n"
12^error,msg="Function \"_start\" not defined."
(gdb) 
No command for record 1^done
No command for record 1^done
13-break-insert -t main
13^done,bkpt={number="3",type="breakpoint",disp="del",enabled="y",addr="0x00402579",func="main",file="quote.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc",line="118",times="0"}
(gdb) 
14-exec-run
14^running
(gdb) 
~"[New thread 6632.0x1638]\n"
&"Error: dll starting at 0x776b0000 not found.\n"
&"Error: dll starting at 0x76c80000 not found.\n"
&"Error: dll starting at 0x776b0000 not found.\n"
&"Error: dll starting at 0x777d0000 not found.\n"
~"[New thread 6632.0x13cc]\n"
14*stopped,thread-id="1",frame={addr="0x00402579",func="main",args=[],file="quote.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc",line="118"}
(gdb) 
15info threads
&"info threads\n"
~"  2 thread 6632.0x13cc  0x77acf895 in ntdll!RtlUpdateClonedSRWLock ()\n"
~"   from /cygdrive/c/Windows/system32/ntdll.dll\n"
~"* 1 thread 6632.0x1638  main () at quote.cc:118\n"
15^done
(gdb) 
16-exec-continue
16^running
(gdb) 
16*stopped,reason="breakpoint-hit",bkptno="1",thread-id="1",frame={addr="0x0040263c",func="_fu31___ZSt3cin",args=[],file="quote.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc",line="133"}
(gdb) 
17-stack-list-frames
17^done,stack=[frame={level="0",addr="0x0040263c",func="_fu31___ZSt3cin",file="quote.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc",line="133"}]
(gdb) 
18-stack-list-arguments 1
18^done,stack-args=[frame={level="0",args=[]}]
(gdb) 
19-var-create - * customerName
20-var-update --all-values * 
21-stack-list-locals --simple-values
19^done,name="var2",numchild="2",value="{...}",type="string"
(gdb) 
20^done,changelist=[]
(gdb) 
22-var-show-attributes "var2"
23-data-evaluate-expression "customerName"
21^done,locals=[{name="discount",type="int",value="-1"},{name="customerName",type="string"},{name="MySystem",type="System"},{name="response",type="char",value="97 'a'"},{name="type",type="int",value="1629509864"},{name="amount",type="int",value="1628937800"},{name="MyCpu",type="class Cpu"}]
(gdb) 
22^done,attr="noneditable"
(gdb) 
23^done,value="{static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0xc79a54 \"aaa\"}}"
(gdb) 
24-var-create - * discount
25-var-create - * customerName
26-var-create - * MySystem
27-var-create - * response
28-var-create - * type
29-var-create - * amount
30-var-create - * MyCpu
24^done,name="var3",numchild="0",value="-1",type="int"
(gdb) 
25^done,name="var4",numchild="2",value="{...}",type="string"
(gdb) 
26^done,name="var5",numchild="1",value="{...}",type="System"
(gdb) 
27^done,name="var6",numchild="0",value="97 'a'",type="char"
(gdb) 
28^done,name="var7",numchild="0",value="1629509864",type="int"
(gdb) 
29^done,name="var8",numchild="0",value="1628937800",type="int"
(gdb) 
30^done,name="var9",numchild="1",value="{...}",type="class Cpu"
(gdb) 
31-var-show-attributes "var3"
32-var-show-attributes "var4"
33-data-evaluate-expression "customerName"
34-var-show-attributes "var5"
35-var-show-attributes "var6"
36-var-show-attributes "var7"
37-var-show-attributes "var8"
38-var-show-attributes "var9"
31^done,attr="editable"
(gdb) 
32^done,attr="noneditable"
(gdb) 
33^done,value="{static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0xc79a54 \"aaa\"}}"
(gdb) 
34^done,attr="noneditable"
(gdb) 
35^done,attr="editable"
(gdb) 
36^done,attr="editable"
(gdb) 
37^done,attr="editable"
(gdb) 
39-var-evaluate-expression var3
38^done,attr="noneditable"
(gdb) 
40-var-evaluate-expression var6
41-var-evaluate-expression var7
42-var-evaluate-expression var8
39^done,value="-1"
(gdb) 
40^done,value="97 'a'"
(gdb) 
41^done,value="1629509864"
(gdb) 
42^done,value="1628937800"
(gdb) 
43-var-list-children --all-values "var2"
43^done,numchild="2",children=[child={name="var2.public",exp="public",numchild="1",value=""},child={name="var2.private",exp="private",numchild="1",value=""}]
(gdb) 
44-var-list-children --all-values "var2.public"
45-var-list-children --all-values "var2.private"
44^done,numchild="1",children=[child={name="var2.public.npos",exp="npos",numchild="0",value="",type="const size_t"}]
(gdb) 
45^done,numchild="1",children=[child={name="var2.private._M_dataplus",exp="_M_dataplus",numchild="2",value="{...}",type="std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider"}]
(gdb) 
46-var-show-attributes "var2.public.npos"
47-var-show-attributes "var2.private._M_dataplus"
46^done,attr="noneditable"
(gdb) 
47^done,attr="noneditable"
(gdb) 
48-exec-continue
48^running
(gdb) 
48*stopped,reason="breakpoint-hit",bkptno="2",thread-id="1",frame={addr="0x00401f26",func="getDiscountFor",args=[{name="name",value="{static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x28cc84 \"T\\232\\307\"}}"}],file="quote.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc",line="67"}
(gdb) 
49-stack-list-frames
49^done,stack=[frame={level="0",addr="0x00401f26",func="getDiscountFor",file="quote.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc",line="67"},frame={level="1",addr="0x00402659",func="_fu31___ZSt3cin",file="quote.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc",line="133"}]
(gdb) 
50-stack-list-arguments 1
51-var-create - * customerName
52-var-update --all-values * 
53-data-evaluate-expression "customerName"
54-data-evaluate-expression "customerName"
50^done,stack-args=[frame={level="0",args=[{name="name",value="{static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x28cc84 \"T\\232\\307\"}}"}]},frame={level="1",args=[]}]
(gdb) 
55-stack-list-locals --simple-values
&"mi_cmd_var_create: unable to create variable object\n"
51^error,msg="mi_cmd_var_create: unable to create variable object"
(gdb) 
52^done,changelist=[]
(gdb) 
&"No symbol \"customerName\" in current context.\n"
53^error,msg="No symbol \"customerName\" in current context."
(gdb) 
&"No symbol \"customerName\" in current context.\n"
54^error,msg="No symbol \"customerName\" in current context."
(gdb) 
55^done,locals=[{name="it",type="std::_List_iterator<Customer>"}]
(gdb) 
56-var-create - * it
57-var-create - * name
58-var-update --all-values * 
59-data-evaluate-expression "customerName"
56^done,name="var11",numchild="1",value="{...}",type="std::_List_iterator<Customer>"
(gdb) 
57^done,name="var12",numchild="2",value="{...}",type="string"
(gdb) 
58^done,changelist=[]
(gdb) 
&"No symbol \"customerName\" in current context.\n"
59^error,msg="No symbol \"customerName\" in current context."
(gdb) 
60-var-show-attributes "var11"
61-var-show-attributes "var12"
62-data-evaluate-expression "name"
60^done,attr="noneditable"
(gdb) 
61^done,attr="noneditable"
(gdb) 
62^done,value="{static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x28cc84 \"T\\232\\307\"}}"
(gdb) 
63-var-list-children --all-values "var4"
64-var-list-children --all-values "var5"
65-var-list-children --all-values "var9"
63^done,numchild="2",children=[child={name="var4.public",exp="public",numchild="1",value=""},child={name="var4.private",exp="private",numchild="1",value=""}]
(gdb) 
64^done,numchild="1",children=[child={name="var5.private",exp="private",numchild="2",value=""}]
(gdb) 
65^done,numchild="1",children=[child={name="var9.Module",exp="Module",numchild="1",value="{...}",type="Module"}]
(gdb) 
66-var-list-children --all-values "var4.public"
67-var-list-children --all-values "var4.private"
68-var-list-children --all-values "var5.private"
69-var-show-attributes "var9.Module"
66^done,numchild="1",children=[child={name="var4.public.npos",exp="npos",numchild="0",value="",type="const size_t"}]
(gdb) 
70-var-show-attributes "var4.public.npos"
67^done,numchild="1",children=[child={name="var4.private._M_dataplus",exp="_M_dataplus",numchild="2",value="{...}",type="std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider"}]
(gdb) 
68^done,numchild="2",children=[child={name="var5.private.moduleList",exp="moduleList",numchild="1",value="{...}",type="std::vector<Module*, std::allocator<Module*> >"},child={name="var5.private.supportMetric",exp="supportMetric",numchild="0",value="192",type="int"}]
(gdb) 
69^done,attr="noneditable"
(gdb) 
71-var-show-attributes "var4.private._M_dataplus"
72-var-show-attributes "var5.private.moduleList"
73-var-show-attributes "var5.private.supportMetric"
70^done,attr="noneditable"
(gdb) 
71^done,attr="noneditable"
(gdb) 
72^done,attr="noneditable"
(gdb) 
73^done,attr="editable"
(gdb) 
74-exec-continue
74^running
(gdb) 
74*stopped,reason="breakpoint-hit",bkptno="1",thread-id="1",frame={addr="0x0040263c",func="_fu31___ZSt3cin",args=[],file="quote.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc",line="133"}
(gdb) 
75-stack-list-frames
75^done,stack=[frame={level="0",addr="0x0040263c",func="_fu31___ZSt3cin",file="quote.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Quote_22/quote.cc",line="133"}]
(gdb) 
76-stack-list-arguments 1
76^done,stack-args=[frame={level="0",args=[]}]
(gdb) 
77-var-create - * customerName
78-var-update --all-values * 
79-data-evaluate-expression "name"
80-data-evaluate-expression "customerName"
81-stack-list-locals --simple-values
77^done,name="var13",numchild="2",value="{...}",type="string"
(gdb) 
78^done,changelist=[{name="var12",in_scope="false"},{name="var11",in_scope="false"}]
(gdb) 
&"No symbol \"name\" in current context.\n"
79^error,msg="No symbol \"name\" in current context."
(gdb) 
80^done,value="{static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0xc79a54 \"zzz\"}}"
(gdb) 
81^done,locals=[{name="discount",type="int",value="-1"},{name="customerName",type="string"},{name="MySystem",type="System"},{name="response",type="char",value="97 'a'"},{name="type",type="int",value="1629509864"},{name="amount",type="int",value="1628937800"},{name="MyCpu",type="class Cpu"}]
(gdb) 
82-var-show-attributes "var13"
83-data-evaluate-expression "customerName"
82^done,attr="noneditable"
(gdb) 
83^done,value="{static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0xc79a54 \"zzz\"}}"
(gdb) 
84-var-list-children --all-values "var11"
85-var-list-children --all-values "var12"
84^done,numchild="1",children=[child={name="var11.public",exp="public",numchild="1",value=""}]
(gdb) 
86-var-list-children --all-values "var11.public"
85^done,numchild="2",children=[child={name="var12.public",exp="public",numchild="1",value=""},child={name="var12.private",exp="private",numchild="1",value=""}]
(gdb) 
87-var-list-children --all-values "var12.public"
88-var-list-children --all-values "var12.private"
86^done,numchild="1",children=[child={name="var11.public._M_node",exp="_M_node",numchild="1",value="",type="std::_List_node_base *"}]
(gdb) 
89-var-show-attributes "var11.public._M_node"
87^done,numchild="1",children=[child={name="var12.public.npos",exp="npos",numchild="0",value="",type="const size_t"}]
(gdb) 
88^done,numchild="1",children=[child={name="var12.private._M_dataplus",exp="_M_dataplus",numchild="2",value="{...}",type="std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider"}]
(gdb) 
90-var-show-attributes "var12.public.npos"
91-var-show-attributes "var12.private._M_dataplus"
89^done,attr="noneditable"
(gdb) 
90^done,attr="noneditable"
(gdb) 
91^done,attr="noneditable"
(gdb)
Comment 3 Egor Ushakov 2011-03-24 08:43:51 UTC
on every variables tab open (or select) we request locals and update them with values they had in the beginning of the current frame (as gdb reports)
Comment 4 Egor Ushakov 2011-03-24 13:09:46 UTC
correction:
locals work fine, the problem is only with current function arguments
Comment 5 Egor Ushakov 2011-03-25 11:17:16 UTC
fixed in trunk:
http://hg.netbeans.org/cnd-main/rev/75ccaaa8292d
Comment 6 Alexander Pepin 2011-03-25 17:48:29 UTC
The second scenario (Comment #2) is still reproducible in dev build 5032.
Comment 7 Egor Ushakov 2011-03-26 06:25:00 UTC
fixed in:
http://hg.netbeans.org/cnd-main/rev/c47d27252549
Comment 8 Quality Engineering 2011-03-28 08:49:28 UTC
Integrated into 'main-golden', will be available in build *201103280400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/75ccaaa8292d
User: Egor Ushakov <gorrus@netbeans.org>
Log: fixed #196846 (Variables view does not contain latest arguments values)
Comment 9 Alexander Pepin 2011-03-28 12:04:40 UTC
verified in dev build #5040
Comment 11 Alexander Pepin 2011-03-31 13:29:26 UTC
Verified in RC2 build 20110331


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo