Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [python][patch] Add GDB Parameters functionality
Date: Wed, 28 Apr 2010 06:28:00 -0000	[thread overview]
Message-ID: <4BD7D58B.9020007@redhat.com> (raw)
In-Reply-To: <83pr1kxoyn.fsf@gnu.org>

On 04/28/2010 03:58 AM, Eli Zaretskii wrote:
>> Date: Tue, 27 Apr 2010 21:05:35 +0100
>> From: Phil Muldoon <pmuldoon@redhat.com>
>> CC: gdb-patches@sourceware.org
>>
>>> Can you give me a couple of examples of this "translation"?  Then I
>>> could suggest some simple explanation.
>>
>> The simplest example I can think of is escaping octal to print
>> characters.
> 
> Thanks, but I'm sure this feature was not introduced for such trivial
> uses.  Can you give a slightly more useful example?  Is this similar
> to C escapes in strings, such as \f, \n, etc., for example?

It does not do anything beyond what GDB does normally to strings that
have escape sequences, (that is, the Parameter functionality is
decoupled from the escape translation itself, this is GDB's encoding
mechanism).

A simple print command:

(gdb) print "\107\157\157\144\040\104\141\171"
$1 = "Good Day"

This is the same behaviour as the PARAM_STRING sequence in the
previous email.

This is different to PARAM_STRING_NOESCAPE. This just takes escape
sequences as literal, I.E.:

(gdb) set test-nestring-param \107\157\157\144\040\104\141\171
(gdb) show test-nestring-param 
Some string is "\107\157\157\144\040\104\141\171".

I've no idea  what escapes are allowed in the print/set/show
output commands, over what is allowed in say the echo command (for
example /t /n are just literals in the print command above, but have
meaning in the echo command).  I suspect this is just a mechanism to
allow multi-byte characters to be passed to a Parameter, but that is
just a guess. I've looked and looked into the manual for a node
explaining this, but cannot find it.  From the point of view of
parameters the difference is clear, PARAM_STRING will allow escapes to
be translated (or encoded or whatever verb we apply here), whereas
PARAM_STRING_NOESCAPE will not.  I'm not sure what node to point to
too explain this or what example to give.

Cheers,

Phil



  reply	other threads:[~2010-04-28  6:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-26 13:19 Phil Muldoon
2010-04-26 17:56 ` Eli Zaretskii
2010-04-27 12:26   ` Phil Muldoon
2010-04-27 17:45     ` Eli Zaretskii
2010-04-27 19:25       ` Phil Muldoon
2010-04-27 19:36         ` Eli Zaretskii
2010-04-27 20:05           ` Phil Muldoon
2010-04-28  2:59             ` Eli Zaretskii
2010-04-28  6:28               ` Phil Muldoon [this message]
2010-04-28  9:18                 ` Phil Muldoon
2010-04-28 17:15                   ` Eli Zaretskii
2010-04-28 20:31                     ` Phil Muldoon
2010-04-29  3:06                       ` Eli Zaretskii
2010-04-29 16:13                         ` Phil Muldoon
2010-04-26 21:45 ` Tom Tromey
2010-04-26 21:52   ` Phil Muldoon
2010-04-27  3:09     ` 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=4BD7D58B.9020007@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=eliz@gnu.org \
    --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