From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26138 invoked by alias); 9 Dec 2013 01:02:47 -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 26128 invoked by uid 89); 9 Dec 2013 01:02:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ea0-f179.google.com Received: from Unknown (HELO mail-ea0-f179.google.com) (209.85.215.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 09 Dec 2013 01:02:45 +0000 Received: by mail-ea0-f179.google.com with SMTP id r15so1257441ead.24 for ; Sun, 08 Dec 2013 17:02:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=g0xHKjDB6L3HerTM7sedhR0cQdPMmIMazA+cuITcizw=; b=YTJ+aIVD8d4c6CCaBOw5CYhpjiAjcwXcF+TVl0tg4ocx9SyaFVxXg0lyrzp4QwFi5m DPVGFFF+fRIhMFOEzLWe8ee1JTbgr02lerhvYlcxhmoLMz8wC1bAnJB7Qjd9bBfKF1Qz V3syZXdup92pM5ZbGESi2WLfImq5r8Nt3+3bLlqvvlx/eUYnURYHY+LzztioCFbgBx12 LAd7mJh+w2Tz708TDMOw+6JOqPumqrWf9D0dsrpOn2Ube+5Ehzi0W3G11WgnubfCNzg0 pGza+a53WGqJAD/uQGSrU5IQZmogf0ABKWUmiROfdS6o18enPAsKCMPoL96yovx1R0Dg 7Rrg== X-Gm-Message-State: ALoCoQl5NO+9H0l4H/UnNTeyL5QW4WI5oCR0sZrmDqg+MnizVM+AGoUNCeosld+cs+6GDzOZaq0jYxiNndq+v45wzQijmq2J6gXWgqRn3VgEaHK4QhaEFaLXksKjA93xM9M6bU0lTKRVc/cTvMO6eojUEnZIYUHGn5YtYZU8NgTpHjr/z11v+kNrhQMXHD0G7gErkNFamFswmWpPIRgc7RlLHuBz4XWZ+Q== MIME-Version: 1.0 X-Received: by 10.14.3.130 with SMTP id 2mr10564390eeh.36.1386550955530; Sun, 08 Dec 2013 17:02:35 -0800 (PST) Received: by 10.14.151.72 with HTTP; Sun, 8 Dec 2013 17:02:35 -0800 (PST) Date: Mon, 09 Dec 2013 01:02:00 -0000 Message-ID: Subject: [RFC/Patch] PR 16113: Allow gdb.Field objects as subscripts on gdb.Value objects From: Siva Chandra To: gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00314.txt.bz2 Hi, The attached patch addresses the marked PR. The doc and NEWS changes are incomplete as it depends on whether the route I have taken in this patch is acceptable. I will fill them after I get (dis/)approval. Other changes to the doc and NEWS are present. 2013-12-08 Siva Chandra Reddy PR 16113: Allow gdb.Field objects with the subscript operator on gdb.Value objects of struct/class values. * NEWS (Python Scripting): Add entry for the new feature. * python/py-type.c (gdbpy_is_field): New function * python/py-value.c (valpy_getitem): Allow subscript value to be a gdb.Field object. (value_has_field): New function (get_field_flag): New function * python/python-internal.h (gdbpy_is_field): Add declaration. testsuite/ * gdb.python/py-value-cc.cc: Improve test case. * gdb.python/py-value-cc.exp: Add new tests. doc/ * gdb.texinfo (Values From Inferior): Add a note about using gdb.Field objects as subscripts on gdb.Value objects.