public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "tromey at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug varobj/13708] Erasing an element from std::vector isn't reported by -var-update, when pretty printing is enabled
Date: Tue, 21 Feb 2012 19:27:00 -0000	[thread overview]
Message-ID: <bug-13708-4717-CWFiKObXkA@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <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.


  parent reply	other threads:[~2012-02-21 19:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-18 13:30 [Bug varobj/13708] New: erasure of " dodji at seketeli dot org
2012-02-18 13:30 ` [Bug varobj/13708] Erasing " dodji at seketeli dot org
2012-02-21 19:27 ` tromey at redhat dot com [this message]
2014-09-12 23:08 ` sergiodj at redhat dot com
2023-08-31 16:37 ` tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-13708-4717-CWFiKObXkA@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).