From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17972 invoked by alias); 12 Jun 2013 14:59:23 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 17936 invoked by uid 89); 12 Jun 2013 14:59:20 -0000 X-Spam-SWARE-Status: No, score=-5.4 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.1 Received: from ausc60pc101.us.dell.com (HELO ausc60pc101.us.dell.com) (143.166.85.206) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 12 Jun 2013 14:59:14 +0000 X-LoopCount0: from 10.170.28.41 From: To: CC: , , Subject: Re: gdb pretty printers and python3.x Date: Wed, 12 Jun 2013 14:59:00 -0000 Message-ID: References: <51B8394A.9040407@ubuntu.com> In-Reply-To: <51B8394A.9040407@ubuntu.com> Content-Type: text/plain; charset="us-ascii" Content-ID: <9837D78CA4E7B94996BC62DB9C6BCDC8@dell.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2013-06/txt/msg00039.txt.bz2 On Jun 12, 2013, at 5:03 AM, Matthias Klose wrote: > Starting with gdb-7.6, gdb supports embedding a Python3 interpreter inste= ad of > Python2. However most pretty printers are still using Python2 code, and = when > shipping a gdb using Python3, you have to fix all pretty printers at once= (and > keep building it with Python2, nobody will port to Python3). So some que= stions: >=20 > - Is there a list of known pretty printers? So far I know about > libstdc++, python, gtk, libreoffice. >=20 > - Is there a minimal python version supported by gdb? If e.g. it is 2.6, > then probably most pretty printers could be converted to code which can > be used by both 2.x and 3.x. If not, then it would be up to 2to3 runs > to do the conversion when needed. The documented minimum is 2.4, I believe. It's not hard to write code that works both with 2.4 and above, and with 3.= x. The python code that's included with gdb is done that way, including th= e python section of the test suite. About the only areas that are a hassle= are byte strings (since b"foo" is a syntax error in V2.x) and except claus= es that use "except MyException as e". That second one was discussed on th= is list yesterday, the answer is simple, it's just not all that elegant. paul