From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26017 invoked by alias); 16 Dec 2013 22:24:19 -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 25973 invoked by uid 89); 16 Dec 2013 22:24:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ea0-f179.google.com Received: from mail-ea0-f179.google.com (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, 16 Dec 2013 22:24:17 +0000 Received: by mail-ea0-f179.google.com with SMTP id r15so2540691ead.24 for ; Mon, 16 Dec 2013 14:24:14 -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:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=xIMkY/+qLwDxbTUTkewdJ7b8PgoWZQa3HVAXAn2h+xE=; b=M1w83lmPhhloEzJ855MtVy1rh5tFRIKKRrs1/DSKgQZHFmY0dGsqG9TjYGNWUrbIhw knth+W5+cgR3kuK80rCairSTBPTv16hDRrNwVUUKxcPM9F/mJKAUFEwaRwdcxmMIZec0 5ylnN7d2U5Pd60eYF9lihqsJHAi4uQu0wJb+gJRE4peY+0rfQOvRFUc5GZlIaR89fEE7 vhN8kAdE5XZaP6Ed7rR6f8Ti4XbGeKEjG7ldncl0O7rfdrg35xrtttD8a409vM1zEUqQ QHMFoEIyk0bBESI4YsfRZVaZlZj1x2s0wZbw3y/dVLewJoDWXIOBkdEmF0woegxcUfY1 11tA== X-Gm-Message-State: ALoCoQmHoVeZZlj1xoORAoQF4rSNKe4wa/r9yubdgNBVNjxAcasBQ+rX3Oc5PEzAK8nAQ2Q/j6VF+bvQTsSQGs7pgNKGdK20eND//m8Zuxm71ONiWYn4SQuofTBFA/EdxBm+SKQSqHYslWvtLHJJkgMmKRrfur21JEe1Z+ShZeac+hljEDp7rmwv2Dphpjf/eUQgdj1FW9sYPBKPMYpZegZZmn6S7B4pdg== MIME-Version: 1.0 X-Received: by 10.14.3.130 with SMTP id 2mr19232188eeh.36.1387232654277; Mon, 16 Dec 2013 14:24:14 -0800 (PST) Received: by 10.14.151.72 with HTTP; Mon, 16 Dec 2013 14:24:14 -0800 (PST) In-Reply-To: References: <871u1j2ldi.fsf@fleche.redhat.com> Date: Mon, 16 Dec 2013 22:24:00 -0000 Message-ID: Subject: Re: [RFC/Patch] Call overloaded operators to perform valid Python operations on struct/class values. From: Siva Chandra To: Doug Evans Cc: Tom Tromey , gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00606.txt.bz2 On Sun, Dec 15, 2013 at 11:48 PM, Doug Evans wrote: > For myself, I'm just going slow on this one. E.g., is there another > way to provide this? > E.g., some kind of facility that uses gdb's language parsers but let's > one pass in gdb.Value objects from Python? > It sounds doable, but I haven't thought about it very hard (it might > not even make sense, or it may require more effort). > Its drawback to the current proposal is that it would be a bit more > verbose, but it has to potential of handling a lot more cases. I am not sure I fully understand this alternative. My patch adds the ability to use valid Python operators on gdb.Value objects in Python code. Operators which have different semantics in Python (like '[]', ',' etc.), and operators which do not exist in Python (like '->') cannot be facilitated. But, my patch adds the ability to use all other operators which are valid (as far as my understanding today stands at) in Python.