From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98873 invoked by alias); 20 Sep 2016 18:20:20 -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 98856 invoked by uid 89); 20 Sep 2016 18:20:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1131 X-HELO: esa4.dell-outbound.iphmx.com Received: from Unknown (HELO esa4.dell-outbound.iphmx.com) (68.232.149.214) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Sep 2016 18:20:09 +0000 Received: from esa6.dell-outbound2.iphmx.com ([68.232.154.99]) by esa4.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2016 13:20:02 -0500 From: Received: from ausc60ps301.us.dell.com ([143.166.148.206]) by esa6.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Sep 2016 00:20:01 +0600 X-LoopCount0: from 10.170.28.39 To: CC: , Subject: Re: [PATCH] Implement floordiv operator for gdb.Value Date: Tue, 20 Sep 2016 19:06:00 -0000 Message-ID: <1BF475D4-EC47-4C40-8C87-2C47B1C89F2A@dell.com> References: <20160920132633.GA897@redhat.com> <883c76d5-54e9-e8fe-5713-eec2c4010498@redhat.com> <20160920163556.GB5736@redhat.com> <1196FC25-F9EC-4A16-B675-19AA200E7B94@dell.com> <20160920171107.GE5736@redhat.com> In-Reply-To: <20160920171107.GE5736@redhat.com> Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2016-09/txt/msg00236.txt.bz2 > On Sep 20, 2016, at 1:11 PM, Jonathan Wakely wrote: >=20 > On 20/09/16 17:00 +0000, Paul.Koning@dell.com wrote: >>=20 >>> On Sep 20, 2016, at 12:35 PM, Jonathan Wakely wrot= e: >>>=20 >>>> ... >>>=20 >>> This seems to be an existing property of gdb.Value, as even using the >>> normal division operator (and without my patch) I see floats printed >>> without a decimal part when they are an integer value: >>>=20 >>> (gdb) python print (gdb.Value(5.0)/5.0) >>> 1 >>> (gdb) python print (5.0/5.0) >>> 1.0 >>=20 >> In all this, please keep in mind that this is one place where Python 2 a= nd Python 3 differ: >=20 > Right, see https://sourceware.org/ml/gdb-patches/2016-09/msg00221.html > for a crazy idea that would make gdb.Value match the Python version > it's built against. >=20 > That wouldn't help for Python 2 using __future__ division though. Yes. You'd expect that this would be easy to find, but that isn't the case= . It may be accessible from C code, if you can find the parser flags from = where you are. Look for CO_FUTURE in the source tree. paul