From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18798 invoked by alias); 23 Aug 2012 17:32:11 -0000 Received: (qmail 18786 invoked by uid 22791); 23 Aug 2012 17:32:09 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from server-nat-6.cs.umd.edu (HELO bacon.cs.umd.edu) (128.8.127.149) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Aug 2012 17:31:56 +0000 Received: from wireless-206-196-166-174.umd.edu (wireless-206-196-166-174.umd.edu [206.196.166.174]) (Authenticated sender: khooyp) by bacon.cs.umd.edu (Postfix) with ESMTPSA id 32460B40DF2; Thu, 23 Aug 2012 13:31:44 -0400 (EDT) Subject: Re: python-interactive, and quitting gdb pagination Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Khoo Yit Phang In-Reply-To: <5036634E.6060202@redhat.com> Date: Thu, 23 Aug 2012 17:32:00 -0000 Cc: Khoo Yit Phang , GDB Patches Content-Transfer-Encoding: quoted-printable Message-Id: References: <5036634E.6060202@redhat.com> To: Pedro Alves X-CSD-MailScanner-ID: 32460B40DF2.A5CB6 X-CSD-MailScanner: Found to be clean X-CSD-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-50, required 5, autolearn=not spam, ALL_TRUSTED -50.00) X-CSD-MailScanner-From: khooyp@cs.umd.edu X-CSD-MailScanner-Watermark: 1346347904.74344@N+9uUeCMBcskR6x+kAkVNQ 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-08/txt/msg00681.txt.bz2 Hi, On Aug 23, 2012, at 1:07 PM, Pedro Alves wrote: > FYI, I just tried playing with this a little, and stumbled on: >=20 > (gdb) python-interactive >>>> help (gdb) > Help on package gdb: > ... > ... > ... > TypeIterator > Value > exceptions.Exception(exceptions.BaseException) > GdbError > ---Type to continue, or q to quit---q > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib64/python2.7/site.py", line 471, in __call__ > return pydoc.help(*args, **kwds) > File "/usr/lib64/python2.7/pydoc.py", line 1744, in __call__ > self.help(request) > File "/usr/lib64/python2.7/pydoc.py", line 1791, in help > else: doc(request, 'Help on %s:') > File "/usr/lib64/python2.7/pydoc.py", line 1528, in doc > pager(render_doc(thing, title, forceload)) > File "/usr/lib64/python2.7/pydoc.py", line 1432, in plainpager > sys.stdout.write(plain(text)) > File "", line 13, in write > KeyboardInterrupt: Quit >=20 > That traceback surprised me, but maybe it's expected. Hmm, this happens because quitting from GDB's pager happens to raise the sa= me error reason, RETURN_QUIT, as typing Ctrl-C, i.e., quitting from the pag= er looks exactly like Ctrl-C. I'm not quite sure what the best way to fix t= his is; perhaps disable the pager while in Python? Python's "help" runs a p= ager too, but I think it's disabled because stdin/stdout is redirected thro= ugh GDB. Or alternatively, perhaps somehow differentiate quitting from the = pager or quitting from Ctrl-C, e.g., with a different error.message? Yit August 23, 2012