This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug varobj/13708] Erasing an element from std::vector isn'treported by -var-update, when pretty printing is enabled
- From: "tromey at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 21 Feb 2012 19:25:56 +0000
- Subject: [Bug varobj/13708] Erasing an element from std::vector isn'treported by -var-update, when pretty printing is enabled
- Auto-submitted: auto-generated
- References: <bug-13708-4717@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=13708
Tom Tromey <tromey at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |WAITING
CC| |tromey at redhat dot com
--- Comment #1 from Tom Tromey <tromey at redhat dot com> 2012-02-21 19:25:56 UTC ---
I think gdb is correct here. Here's my analysis.
I'm moving this to WAITING pending your agreement.
> But then after line 17, (that erases the last element of the vector),
> -var-update on the varobj does not report the fact that the variable got
> deleted.
Here are the last two -var-update calls:
-var-update --all-values var1
^done,changelist=[{name="var1",value="{...}",in_scope="true",type_changed="false",new_num_children="2",displayhint="array",dynamic="1",has_more="0",new_children=[{name="var1.[1]",exp="[1]",numchild="0",value="
\"fila\"",type="std::basic_string<char, std::char_traits<char>,
std::allocator<char> >",thread-id="1",displayhint="string",dynamic="1"}]}]
-var-update --all-values var1
^done,changelist=[]
The first -var-update shown reports 2 elements. Then the inferior
adds an element and removes it. Then we do another -var-update. At
this point, the vector is identical to the last time it was updated.
If I instead -var-update at line 14 in the inferior, I get:
^done,changelist=[{name="var1",value="{...}",in_scope="true",type_changed="false",new_num_children="2",displayhint="array",dynamic="1",has_more="0"}]
Here is the test input I am using, run like: gdb -i=mi2 ./pr < script:
set data-directory /usr/share/gdb
-enable-pretty-printing
b 10
run
-var-create - * v
-var-list-children --all-values var1
b 14
cont
-var-update --all-values var1
b 22
cont
p/r v
p v
-var-update --all-values var1
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.