Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Stan Shebs <stanshebs@earthlink.net>,
	Tom Tromey <tromey@redhat.com>,
	 	Stan Shebs <stan@codesourcery.com>,
	Michael Snyder <msnyder@vmware.com>,
	 	gdb-patches ml <gdb-patches@sourceware.org>,
	Eli Zaretskii <eliz@gnu.org>
Subject: Re: [RFC] Let "gcore" command accept a suffix argument
Date: Sat, 09 Jan 2010 15:18:00 -0000	[thread overview]
Message-ID: <daef60381001090717j4a658548g114950986df6279b@mail.gmail.com> (raw)
In-Reply-To: <20100109105557.GA2007@adacore.com>

Sorry Joel, I didn't write anything about the doc in prev mail because
I want write a special mail for it.

The current eval doesn't like shell.  It just use " point out the simple string.
And if the string is outside out ", eval will try to convert it to val.
The special chat is " and \
If want add " in string.  Use \"
If we want add \ in  string.  Use \\
For example:
eval "echo \""$a++"\""

"echo \"" and "\"" is simple string.
$a++ is val.

I know you want eval more like a language, but we already have python
support.  So  I suggest we use a simple eval.


On Sat, Jan 9, 2010 at 18:55, Joel Brobecker <brobecker@adacore.com> wrote:
>> This value will be convert to string and  execute_command (cmd,
>> from_tty); will use it.
>
> Which parts of the argument will be expanded. To take another language
> as an example, let's have a look at what a POSIX shell does:
>
>        echo "1 $foo 2"
>
> In double-quoted strings, the dollar sign has a the usual special
> meaning introducing parameter expansion. As a result, if our
> parameter "foo" was set to "bar",  the final value for the string above
> would be "1 bar 2".
>
> What I would like from you is a formal description of what your
> command does. "This value will be convert to string" is too vague.
> How will the conversion be done, and which parts of the string will
> be evaluated, and which parts won't?
>
> Intuitively, I think that you want to do the same as posix shells.
> In other words, if I borrow and adjust part of the POSIX shell language
> standard from the opengroup:
>
> | Enclosing characters in double-quotes ( "" ) shall preserve the literal
> | value of all characters within the double-quotes, with the exception of
> | the characters dollar sign, and backslash, as follows:
> |
> | $   The dollar sign shall retain its special meaning introducing
> |     parameter expansion
> |
> | \   The backslash shall retain its special meaning as an escape character
> |     only when followed by one of the following characters:
> |
> |         $   "   \   <newline>
>
> The issue I'm having, which is leading to this discussion about
> the semantics of your command, is that I do not think that the
> implementation that you chose follows the semantics above.
>
>> value_print print the value VAL in C-ish syntax on stream STREAM
>> according to OPTIONS.
>> But cannot find a example how to do it, could you help me with it?
>
> In fact, it will print the value in the syntax of the current language.
> I will fix the comment.
>
> What you need to do, in order to convert your value into a string,
> is create a memory ui_file, call value_print with your value and
> the memory ui_file, and then extract the contents of your ui_file
> as a string. See mem_fileopen and ui_file_xstrdup.
>

I got it.  Thanks.

Best regards,
Hui


  reply	other threads:[~2010-01-09 15:18 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4B11DA3C.3000203@vmware.com>
     [not found] ` <daef60380911300437o4c616eb2v5ad7bfe99bd3c5e9@mail.gmail.com>
     [not found]   ` <20091130162246.GE4034@adacore.com>
     [not found]     ` <4B141157.3070709@vmware.com>
     [not found]       ` <20091130185341.GI4034@adacore.com>
     [not found]         ` <4B141469.5030402@vmware.com>
     [not found]           ` <20091130190619.GJ4034@adacore.com>
     [not found]             ` <4B1428F0.7090608@vmware.com>
     [not found]               ` <daef60380912091827u6ff7127bp1d03998a40932914@mail.gmail.com>
2009-12-10  2:32                 ` Hui Zhu
2009-12-10 17:08                   ` Tom Tromey
2009-12-11 10:06                     ` Joel Brobecker
2009-12-11 18:25                       ` Tom Tromey
2009-12-12  8:33                         ` Hui Zhu
2009-12-13  4:05                           ` Hui Zhu
2009-12-14 17:09                           ` Tom Tromey
2009-12-15  1:57                             ` Hui Zhu
2009-12-15 19:21                               ` Tom Tromey
2009-12-16  3:58                                 ` Hui Zhu
2009-12-16 15:49                                   ` Stan Shebs
2009-12-17  2:45                                     ` Hui Zhu
2009-12-17  4:26                                       ` Joel Brobecker
2009-12-17  4:29                                         ` Michael Snyder
2009-12-17  9:32                                           ` Andreas Schwab
2009-12-21 20:15                                     ` Tom Tromey
2009-12-31  0:18                                       ` Stan Shebs
2010-01-04 14:42                                         ` Hui Zhu
2010-01-06  6:57                                           ` Hui Zhu
2010-01-06  7:58                                             ` Joel Brobecker
2010-01-09  9:55                                               ` Hui Zhu
2010-01-09 10:56                                                 ` Joel Brobecker
2010-01-09 15:18                                                   ` Hui Zhu [this message]
2010-01-10  5:43                                                     ` Joel Brobecker
2010-01-10 13:30                                                       ` Hui Zhu
2010-01-10 14:00                                                         ` Joel Brobecker
2010-01-10 14:16                                                           ` Hui Zhu
2010-06-21 15:05                                                           ` Hui Zhu
2010-06-21 16:57                                                             ` Joel Brobecker
2010-06-21 21:34                                                               ` Joel Brobecker
2010-06-21 21:40                                                             ` Tom Tromey
2010-06-22  7:29                                                               ` Hui Zhu
2010-06-22  9:50                                                                 ` Pedro Alves
2010-06-22 15:21                                                                 ` Joel Brobecker
2010-06-22 18:05                                                                 ` Eli Zaretskii
2010-06-23  2:03                                                                   ` Hui Zhu
2010-06-23 16:59                                                                     ` Joel Brobecker
2010-06-24  6:13                                                                       ` Hui Zhu
2010-01-06 10:13                                             ` 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=daef60381001090717j4a658548g114950986df6279b@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.com \
    --cc=stan@codesourcery.com \
    --cc=stanshebs@earthlink.net \
    --cc=tromey@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