From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5697 invoked by alias); 13 Aug 2008 12:41:59 -0000 Received: (qmail 5688 invoked by uid 22791); 13 Aug 2008 12:41:58 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 13 Aug 2008 12:41:19 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 05A02983B4; Wed, 13 Aug 2008 12:41:18 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id E3EC998100; Wed, 13 Aug 2008 12:41:17 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KTFfB-0005W1-AH; Wed, 13 Aug 2008 08:41:17 -0400 Date: Wed, 13 Aug 2008 12:41:00 -0000 From: Daniel Jacobowitz To: Thiago Jung Bauermann Cc: gdb-patches@sources.redhat.com Subject: Re: Fix python indented multi-line commands Message-ID: <20080813124117.GB20573@caradoc.them.org> Mail-Followup-To: Thiago Jung Bauermann , gdb-patches@sources.redhat.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes 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: 2008-08/txt/msg00344.txt.bz2 On Wed, Aug 13, 2008 at 03:40:03AM -0300, Thiago Jung Bauermann wrote: > Hi, > > Today, if you try to use indentation in Python code within GDB you will > get this error: > > (gdb) python > >def foo (): > > print 'hooray' > >end > File "", line 2 > print 'hooray' > ^ > IndentationError: expected an indented block > > The patch below, extracted from the python branch, fixes the problem. > It changes GDB to not trim whitespace from the beginning of the line > when storing multi-line commands internally. Tested with no regressions > on x86_64-linux. Ok? > > :ADDPATCH cli: :REVIEWMAIL: This is OK. Could you add a second test for this bit? > @@ -1386,7 +1404,7 @@ document_command (char *comname, int fro > error (_("Command \"%s\" is built-in."), comname); > > sprintf (tmpbuf, "Type documentation for \"%s\".", comname); > - doclines = read_command_lines (tmpbuf, from_tty); > + doclines = read_command_lines (tmpbuf, from_tty, 0); > > if (c->doc) > xfree (c->doc); -- Daniel Jacobowitz CodeSourcery