From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31065 invoked by alias); 11 Jan 2012 21:30:41 -0000 Received: (qmail 31056 invoked by uid 22791); 11 Jan 2012 21:30:40 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_PD,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Jan 2012 21:30:27 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0BLUOhh018604 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 11 Jan 2012 16:30:24 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q0BLUOqF008878; Wed, 11 Jan 2012 16:30:24 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id q0BLUNLQ013673; Wed, 11 Jan 2012 16:30:23 -0500 From: Tom Tromey To: Khoo Yit Phang Cc: Kevin Pouget , gdb-patches@sourceware.org Subject: Re: Make the "python" command resemble the standard Python interpreter References: <94906C8E-C23D-4DA3-989D-DDCCFA20FC35@cs.umd.edu> <48619020-0550-4888-9F05-158DB065252B@cs.umd.edu> <19AA588F-ED95-47C6-A562-6FF30AF22A38@cs.umd.edu> Date: Wed, 11 Jan 2012 21:33:00 -0000 In-Reply-To: <19AA588F-ED95-47C6-A562-6FF30AF22A38@cs.umd.edu> (Khoo Yit Phang's message of "Wed, 11 Jan 2012 16:05:59 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 X-SW-Source: 2012-01/txt/msg00378.txt.bz2 >>>>> "Yit" == Khoo Yit Phang writes: Yit> Attached is a new patch that uses another way to disable the readline Yit> module, which works with pdb.set_trace(). However, readline support Yit> still doesn't work with pdb. The reason is because pdb uses raw_input, Yit> which in turn uses sys.stdin/sys.stdout to determine whether to use Yit> readline, but GDB replaces sys.stdin/sys.stdout with it's own Yit> file-like objects that isn't recognized as a tty by Python. This sounds like http://sourceware.org/bugzilla/show_bug.cgi?id=12150 Maybe we should try to fix that instead? Yit> Making Python's readline module work under GDB is not possible, since Yit> it re-initializes libreadline and generally assumes that libreadline Yit> is completely under Python's control (and libreadline itself has no Yit> support for nesting/reentrancy). The initialization shouldn't be a problem. Calling rl_initialize multiple times is ok -- readline() itself calls it. I don't know about the reentrancy though. Also, IIRC, gdb uses the unusual async interface. Maybe that raises some issues. Tom