From: Tom Tromey <tromey@redhat.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] new python features: gdb.GdbError, gdb.string_to_argv
Date: Mon, 24 May 2010 16:27:00 -0000 [thread overview]
Message-ID: <m3zkzptir1.fsf@fleche.redhat.com> (raw)
In-Reply-To: <AANLkTinSbLNGmUMB01LFofTVz-p5nuka5k9rfCcExLkH@mail.gmail.com> (Doug Evans's message of "Sat, 22 May 2010 11:40:47 -0700")
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Tom> I think you can use the built-in shlex.split for this.
Doug> Depends I guess.
Doug> I remembered you saying we want to be able to write compatible
Doug> replacements for gdb commands in python, and some gdb commands use
Doug> libiberty's buildargv.
Doug> Ergo I wanted a 100% identical version of buildargv that I know I can
Doug> "just use" (e.g. without any needed extra, manual, error-prone setup),
Doug> and not worry about any differences between the behavior.
Yeah, I definitely think that would be useful for some commands.
When we talked about it on irc, I wasn't aware of the existence of the
shlex module.
There isn't really any setup to speak of:
import shlex
argv = shlex.split(arg)
Doug> So, setting aside the implementation (i.e. maybe gdb.string_to_argv
Doug> could be implemented with shlex, or anything else), I still think
Doug> having it is reasonable.
Doug> But whatever, it's not that important.
I think that in general we ought to provide gdb-specific facilities and
defer to the Python library when equivalent things already exist there.
That's one of the big benefits of picking a large popular language like
Python.
I did not check to see that shlex.split is completely compatible with
buildargv. I suspect it is. But if not, I suppose that would be an
argument for including a new function.
If shlex.split fits the bill, I think it would be worthwhile to mention
this in the "Commands In Python" node.
Tom
next prev parent reply other threads:[~2010-05-24 15:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-22 17:36 Doug Evans
2010-05-22 19:00 ` Tom Tromey
2010-05-22 21:19 ` Doug Evans
2010-05-24 16:27 ` Tom Tromey [this message]
2010-05-24 18:04 ` Doug Evans
2010-05-24 22:57 ` Tom Tromey
2010-05-25 3:05 ` Doug Evans
2010-05-23 18:55 ` Eli Zaretskii
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=m3zkzptir1.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
/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