Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: has_more="0" with pretty-printer installed
Date: Mon, 11 Nov 2013 07:26:00 -0000	[thread overview]
Message-ID: <5280864A.8020201@codesourcery.com> (raw)

Hi,
I find the output of "-var-create" in gdb.python/py-mi.exp confuses me a 
little,

-var-create container @ c^M
^done,name="container",numchild="0",value="{...}",type="zzz_type",thread-id="1",dynamic="1",has_more="0"^M
                                                  ^^^^^^^^^^^^
(gdb) ^M
PASS: gdb.python/py-mi.exp: create container varobj

On this test, pretty-printer is installed, and 'c' is of type 'zzz_type',

struct container
{
   string name;
   int len;
   int *elements;
};

typedef struct container zzz_type;

IIUC, has_more should be 1 here, because c has three fields.  Am I 
missing something?  The minimum steps to reproduce this problem are:

$ ./gdb ./testsuite/gdb.python/py-mi
(gdb) b main
Breakpoint 1 at 0x80485ee: file 
../../../../git/gdb/testsuite/gdb.python/py-prettyprint.c, line 264.
(gdb) run
Starting program: 
/home/yao/Source/gnu/gdb/build-git/x86/gdb/testsuite/gdb.python/py-mi

Breakpoint 1, main () at 
../../../../git/gdb/testsuite/gdb.python/py-prettyprint.c:264
264       string x = make_string ("this is x");
(gdb) python exec (open 
('gdb/git/gdb/testsuite/gdb.python/py-prettyprint.py').read ())
(gdb) interpreter-exec mi "-enable-pretty-printing"
^done
(gdb) interpreter-exec mi "-var-create container @ c"
^done,name="container",numchild="0",value="{...}",type="zzz_type",thread-id="1",dynamic="1",has_more="1"
                                                  ^^^^^^^^^^^
// note: at this point, has_more is 1, which looks right to me

(gdb) b 329
Breakpoint 2 at 0x804871e: file 
../../../../git/gdb/testsuite/gdb.python/py-prettyprint.c, line 329.
(gdb) c
Continuing.

Breakpoint 2, main () at 
../../../../git/gdb/testsuite/gdb.python/py-prettyprint.c:329
329       add_item (&c, 23);            /* MI breakpoint here */
(gdb) interpreter-exec mi "-var-create container1 @ c"
^done,name="container1",numchild="0",value="{...}",type="zzz_type",thread-id="1",dynamic="1",has_more="0"
                                                  ^^^^^^^^^^^^

// has_more becomes 0.

-- 
Yao (齐尧)


             reply	other threads:[~2013-11-11  7:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11  7:26 Yao Qi [this message]
2013-11-11  7:37 ` Yao Qi
     [not found] ` <CEA8125BCE884349929B204B961E547140798705@DEBOSVPEX001.ent.rt.verigy.net>
2013-11-11 13:04   ` Yao Qi

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=5280864A.8020201@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb@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