Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Thiago Jung Bauermann <bauerman@br.ibm.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Fix python indented multi-line commands
Date: Wed, 13 Aug 2008 18:22:00 -0000	[thread overview]
Message-ID: <uy730g4ih.fsf@gnu.org> (raw)
In-Reply-To: <g7tvk3$lck$1@ger.gmane.org>

> From:  Thiago Jung Bauermann <bauerman@br.ibm.com>
> Date:  Wed, 13 Aug 2008 03:40:03 -0300
> 
> 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 "<string>", line 2
>     print 'hooray'
>         ^
> IndentationError: expected an indented block
> 
> The patch below, extracted from the python branch, fixes the problem.

Thanks!

>  /* Read one line from the input stream.  If the command is an "else" or
> -   "end", return such an indication to the caller.  */
> +   "end", return such an indication to the caller.  If SPECIAL_PROCESSING
> +   is true, strip leading and trailing whitespace in the line and attempt
> +   to recognize GDB control commands.  Otherwise, only "end" is
> +   recognized.  */
>  
>  static enum misc_command_type
> -read_next_line (struct command_line **command)
> +read_next_line (struct command_line **command, int special_processing)

Please don't call variables by mysterious names such as
"special_processing".  Please give that variable a meaningful name
that would explain the purpose of this flag even without reading the
code of the callers of this function.


  parent reply	other threads:[~2008-08-13 18:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-13  6:41 Thiago Jung Bauermann
2008-08-13 12:41 ` Daniel Jacobowitz
2008-08-13 18:22 ` Eli Zaretskii [this message]
2008-08-14  3:57   ` Thiago Jung Bauermann
2008-08-14 19:21     ` Eli Zaretskii
2008-08-14 19:42       ` Thiago Jung Bauermann
2008-08-15  4:13         ` Daniel Jacobowitz
2008-08-16 20:40           ` Thiago Jung Bauermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=uy730g4ih.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=bauerman@br.ibm.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox