Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Denis PILAT <denis.pilat@st.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [Fwd: Re: Patch to support spaces in filenames & paths]
Date: Mon, 27 Apr 2009 21:39:00 -0000	[thread overview]
Message-ID: <m33abtkc87.fsf@fleche.redhat.com> (raw)
In-Reply-To: <4981BA17.2090501@st.com> (Denis PILAT's message of "Thu\, 29 Jan 2009 15\:15\:51 +0100")

>>>>> "Denis" == Denis PILAT <denis.pilat@st.com> writes:

Oops, I mistyped and sent a draft before I had finished.
This is the same note with one minor addition at the end.

Denis> Ping !

Sorry for the delay on this.

I read both the patches for this issue, plus the thread on the mailing
list.

Denis> I read your comments and produce a new patch that uses gdb_buildargv
Denis> (as Pedro suggested), inspired from add_symbol_file_command as well.

I don't like this approach.

With the current patch, we will accept a quoted expression.  This
seems very ugly to me.  I wouldn't be surprised if completion failed
in this case.  And, given that I would not support a new command using
a quoting scheme like this, it seems odd to allow one via refactoring.

I think this problem can be addressed to some degree by more carefully
parsing the address arguments.

Second, concatenating the final arguments using a space is not
completely correct, because it does not preserve the meaning of all
possible expressions.  This is a pedantic point, since such
expressions are unlikely to be used here.


In the long term, I would like to see gdb move toward a more uniform
approach to parsing its arguments, and to allowing full expressions in
more places.  I don't think gdb_buildargv can be the foundation for
that, though.


Since there only seems to be a single argument that has a problem
here, how about what Daniel suggested: a function that uses the same
quoting rules as gdb_buildargv, but which only peels off a single
argument?

A few notes on the patch itself follow.

Denis> I also removed lot of dead code in cli/cli-dump.c and
Denis> fopen_with_cleanup is now used only locally, so removed from
Denis> cli-dump.h.

In this case, make the function static as well.

Denis> Dump restore and append commands are impacted by this patch.

I think this may need a documentation update.

Denis> @@ -559,8 +515,14 @@ restore_command (char *args, int from_tt

[...]

Denis> +  argv = gdb_buildargv (args);
Denis> +  make_cleanup_freeargv (argv);
 
You have to save the first cleanup in a function and then either "do"
or "discard" it before any return.

Tom


      parent reply	other threads:[~2009-04-27 21:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-29 19:32 Denis PILAT
2009-04-27 21:38 ` Tom Tromey
2009-04-27 21:39 ` Tom Tromey [this message]

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=m33abtkc87.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=denis.pilat@st.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