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 17:23:00 -0000 [thread overview]
Message-ID: <m3ws1zk5v1.fsf@fleche.redhat.com> (raw)
In-Reply-To: <m31vk7ll74.fsf@fleche.redhat.com> (Tom Tromey's message of "Mon, 09 Nov 2009 09:25:19 -0700")
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Arjun> Traceback (most recent call last):
Arjun> File "<string>", line 2, in <module>
Arjun> TypeError: argument 1 must be string without null bytes, not str
Arjun> Error while executing Python code.
Arjun> Is this a bug, am I misunderstanding the right way to do it, or what?
Tom> It is a bug.
I looked into this a little.
The fix is to make python.c:execute_gdb_command copy the command string
before passing it to execute_command. This avoids gdb commands trashing
Python-owned strings.
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?
I'll check in the python fix after testing.
Tom
next prev parent reply other threads:[~2009-11-09 16:42 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 [this message]
2009-11-09 17:44 ` Daniel Jacobowitz
2009-11-09 18:12 ` Tom Tromey
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=m3ws1zk5v1.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