From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7665 invoked by alias); 21 Aug 2013 15:37:14 -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 7656 invoked by uid 89); 21 Aug 2013 15:37:14 -0000 X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 Received: from ausxipps301.us.dell.com (HELO ausxipps301.us.dell.com) (143.166.148.223) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 21 Aug 2013 15:37:11 +0000 X-LoopCount0: from 10.175.216.249 From: To: CC: , Subject: Re: [patch] [python] Fix Python 3 build and testsuite issues Date: Wed, 21 Aug 2013 15:37:00 -0000 Message-ID: References: <521230C8.2040803@redhat.com> <878uzxlkl1.fsf@fleche.redhat.com> <52124B8D.6010609@redhat.com> <87ppt9jzrl.fsf@fleche.redhat.com> <5213C6BA.7030703@redhat.com> <87d2p8gmlo.fsf@fleche.redhat.com> <5213D26D.4070003@redhat.com> <5214CECF.30103@redhat.com> <8761uzf5t3.fsf@fleche.redhat.com> In-Reply-To: <8761uzf5t3.fsf@fleche.redhat.com> Content-Type: text/plain; charset="us-ascii" Content-ID: <6FD9F1C299B6F548893F698CB7E70FB2@dell.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2013-08/txt/msg00595.txt.bz2 On Aug 21, 2013, at 10:59 AM, Tom Tromey wrote: > Phil> Strings in Python 3 are now always encoded and are encapsulated by = the > Phil> "str" class. >=20 > Phil> In Python 2 you had str() and unicode(), where unicode was encoded = and > Phil> str just represented bytes (IE just an unencoded string). >=20 > Phil> Reading around the suggestion seems to be to do this: >=20 > Phil> try: > Phil> # basestring catches both types of Python 2.x strings > Phil> if isinstance(sym, basestring) > Phil> return True > Phil> except NameError: > Phil> # If we are here, basestring does not exist, so Python 3.x > Phil> if isinstance(sym, str) > Phil> return True > Phil> # Continue to process objects that are not a string. >=20 > We can do this check once, at top-level: >=20 >=20 > try: > if isinstance('hi', basestring): > def is_string(x): > return isinstance(x, basestring) > except NameError: > def isinstance(x): > return isinstance(x, str) >=20 >=20 > Maybe duck typing is still preferable though. >=20 > Not sure if this needs a third def in case the 'if' fails without throwin= g. > Probably not. I would write it this way: try: basestring except NameError: basestring =3D str Similar techniques can be used for type "long" which isn't in Python 3 eith= er. --paul >From gdb-patches-return-104503-listarch-gdb-patches=sources.redhat.com@sourceware.org Wed Aug 21 15:42:46 2013 Return-Path: Delivered-To: listarch-gdb-patches@sources.redhat.com Received: (qmail 21619 invoked by alias); 21 Aug 2013 15:42:46 -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 Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 21605 invoked by uid 89); 21 Aug 2013 15:42:45 -0000 X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.2 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 21 Aug 2013 15:42:44 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1VCAYT-0004G7-8p from joseph_myers@mentor.com ; Wed, 21 Aug 2013 08:42:41 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 21 Aug 2013 08:42:41 -0700 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Wed, 21 Aug 2013 16:42:39 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.76) (envelope-from ) id 1VCAYQ-0000e0-Gq; Wed, 21 Aug 2013 15:42:38 +0000 Date: Wed, 21 Aug 2013 15:42:00 -0000 From: "Joseph S. Myers" To: Walfred Tedeschi CC: , , , Subject: Re: [PATCH 0/7] Intel(R) MPX registers support. In-Reply-To: <1377089148-11844-1-git-send-email-walfred.tedeschi@intel.com> Message-ID: References: <1377089148-11844-1-git-send-email-walfred.tedeschi@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2013-08/txt/msg00597.txt.bz2 Content-length: 374 If a user does a function call from GDB, or tells GDB to return from a function, and BNDPRESERVE is zero, will it act as a BND-prefixed branch that preserves the bounds registers or as a non-BND-prefixed branch that clears the bounds registers? (It's not obvious that there is one answer that's best in all circumstances.) -- Joseph S. Myers joseph@codesourcery.com