From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29187 invoked by alias); 14 Feb 2014 08:46:41 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 29104 invoked by uid 89); 14 Feb 2014 08:46:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Feb 2014 08:46:39 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WEEPs-0006jT-Ia from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Fri, 14 Feb 2014 00:46:36 -0800 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 14 Feb 2014 00:46:36 -0800 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Fri, 14 Feb 2014 00:46:35 -0800 From: Yao Qi To: Subject: [PATCH 06/12] Use varobj_is_dynamic_p more widely Date: Fri, 14 Feb 2014 08:46:00 -0000 Message-ID: <1392367471-13527-7-git-send-email-yao@codesourcery.com> In-Reply-To: <1392367471-13527-1-git-send-email-yao@codesourcery.com> References: <1392367471-13527-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00494.txt.bz2 Use varobj_is_dynamic_p more widely so that the callers of varobj_is_dynamic_p are unchanged when we add available-children-only stuff in varobj_is_dynamic_p. gdb: 2014-02-14 Yao Qi * varobj.c (varobj_get_num_children): Call varobj_is_dynamic_p. (varobj_list_children): Likewise. (varobj_update): Likewise. Update comments. --- gdb/varobj.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/gdb/varobj.c b/gdb/varobj.c index 66596b5..8905087 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -895,7 +895,7 @@ varobj_get_num_children (struct varobj *var) { if (var->num_children == -1) { - if (var->dynamic->pretty_printer != NULL) + if (varobj_is_dynamic_p (var)) { int dummy; @@ -922,7 +922,7 @@ varobj_list_children (struct varobj *var, int *from, int *to) var->dynamic->children_requested = 1; - if (var->dynamic->pretty_printer != NULL) + if (varobj_is_dynamic_p (var)) { /* This, in theory, can result in the number of children changing without frontend noticing. But well, calling -var-list-children on the same @@ -1715,10 +1715,9 @@ varobj_update (struct varobj **varp, int explicit) } } - /* We probably should not get children of a varobj that has a - pretty-printer, but for which -var-list-children was never - invoked. */ - if (v->dynamic->pretty_printer != NULL) + /* We probably should not get children of a dynamic varobj, but + for which -var-list-children was never invoked. */ + if (varobj_is_dynamic_p (v)) { VEC (varobj_p) *changed = 0, *type_changed = 0, *unchanged = 0; VEC (varobj_p) *new = 0; -- 1.7.7.6