Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Arjun Roy <roy.arjun@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Python Scripting Question
Date: Mon, 09 Nov 2009 18:12:00 -0000	[thread overview]
Message-ID: <m3skcnk3yh.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20091109171958.GA24542@caradoc.them.org> (Daniel Jacobowitz's 	message of "Mon, 9 Nov 2009 12:19:58 -0500")

>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:

Daniel> On Mon, Nov 09, 2009 at 09:41:54AM -0700, Tom Tromey wrote:
>> It isn't clear to me that gdb commands are allowed to overwrite their
>> argument strings, though.  Are they?  disassemble_command does do this,
>> but it seems wrong to me -- won't it permanently modify the command
>> stored in a command script?

Daniel> Is it this bit?
Daniel>       /* Two arguments.  */
Daniel>       *space_index = '\0';

Yeah.

Daniel> I don't think we should let commands modify their argument string.

Me neither.  For the Python case I think we still have to be defensive,
because it seems that a command might temporarily modify its argument (I
am pretty sure this happens but I don't know how often), but even this
sort of modification could cause problems, if the command itself can
cause Python code to be called.

Tom


  reply	other threads:[~2009-11-09 17:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-08 15:08 Arjun Roy
2009-11-09 17:16 ` Tom Tromey
2009-11-09 17:23   ` Tom Tromey
2009-11-09 17:44     ` Daniel Jacobowitz
2009-11-09 18:12       ` Tom Tromey [this message]
2009-11-09 20:22   ` Arjun Roy
2009-11-09 21:12     ` Tom Tromey
2009-11-13 14:36       ` scott snyder
2009-11-13 23:06         ` Arjun Roy
2009-11-18 20:43         ` Tom Tromey

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=m3skcnk3yh.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=roy.arjun@gmail.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