From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24669 invoked by alias); 18 Sep 2013 13:55:27 -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 24657 invoked by uid 89); 18 Sep 2013 13:55:26 -0000 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; Wed, 18 Sep 2013 13:55:26 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_50,FROM_12LTRDOM,RDNS_NONE,SPF_HELO_FAIL autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VMIDy-0006UX-8o from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 18 Sep 2013 06:55:22 -0700 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); Wed, 18 Sep 2013 06:55:22 -0700 Received: from qiyao.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; Wed, 18 Sep 2013 06:55:22 -0700 From: Yao Qi To: Subject: [RFC 0/7] Move language-related stuff out of varobj.c Date: Wed, 18 Sep 2013 13:55:00 -0000 Message-ID: <1379512482-31773-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00591.txt.bz2 This patch series is to move language-related stuff out of varobj.c to ada-varobj.c, c-varobj.c and jv-varobj.c. This will shorten varobj.c, and make it easier for varobj support for new languages. Nowadays, we have 'struct language_specific' which is about language operations in varobj. This can be moved out of varobj.c and shared for different languages. This is what patch 5/7 does. Operations of each language need to know 'struct varobj', so 'struct varobj' should be moved to varobj.h. This is what patch 4/7 does. Note that we don't move all 'struct varobj' to varobj.h because some fields are related to dynamic varobj, and make no sense to expose them. I move basic part of 'struct varobj' to varobj.h, and define a new struct varobj_dynamic to extend 'struct varobj'. Then, we can move language related operations out of varobj.c to c-varobj.c, ada-varobj.c and jv-varobj.c respectively. This is done by patch 6/7. Patch 1/7 - 3/7 are cleanups, to remove unused bits in varobj.c. Patch 7/7 is a cleanup too. Note that static array 'languages' is still used in varobj.c, which is not really necessary. We can remove it and move each 'struct lang_varobj_ops *' to be a field of 'struct language_defn'. I don't include this change in this series because I'd like to post patches for review before I go too far away. The whole series is tested on x86_64-linux. Comments? *** BLURB HERE *** Yao Qi (7): Remove field language in struct language_specific Remove vlang_unknown Remove field value_of_root Move struct varobj to varobj.h. New lang-varobj.h Move language stuff out of varobj.c Remove ada-varobj.h. gdb/Makefile.in | 12 +- gdb/ada-varobj.c | 151 +++++- gdb/ada-varobj.h | 55 -- gdb/c-varobj.c | 902 +++++++++++++++++++++++++++ gdb/gdbtypes.c | 16 + gdb/gdbtypes.h | 4 + gdb/jv-varobj.c | 104 ++++ gdb/lang-varobj.h | 79 +++ gdb/varobj.c | 1783 +++++++---------------------------------------------- gdb/varobj.h | 98 +++- 10 files changed, 1571 insertions(+), 1633 deletions(-) delete mode 100644 gdb/ada-varobj.h create mode 100644 gdb/c-varobj.c create mode 100644 gdb/jv-varobj.c create mode 100644 gdb/lang-varobj.h -- 1.7.7.6