From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21426 invoked by alias); 28 Apr 2010 06:28:41 -0000 Received: (qmail 21415 invoked by uid 22791); 28 Apr 2010 06:28:39 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Apr 2010 06:28:32 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3S6STLo008279 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Apr 2010 02:28:29 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3S6SScR016542; Wed, 28 Apr 2010 02:28:28 -0400 Message-ID: <4BD7D58B.9020007@redhat.com> Date: Wed, 28 Apr 2010 06:28:00 -0000 From: Phil Muldoon User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.4 MIME-Version: 1.0 To: Eli Zaretskii CC: gdb-patches@sourceware.org Subject: Re: [python][patch] Add GDB Parameters functionality References: <4BD592D9.1070801@redhat.com> <838w8ayu7a.fsf@gnu.org> <4BD6D7C7.9040804@redhat.com> <83wrvsyelz.fsf@gnu.org> <4BD73A07.7020706@redhat.com> <83r5m0y9fp.fsf@gnu.org> <4BD7438F.8030508@redhat.com> <83pr1kxoyn.fsf@gnu.org> In-Reply-To: <83pr1kxoyn.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00937.txt.bz2 On 04/28/2010 03:58 AM, Eli Zaretskii wrote: >> Date: Tue, 27 Apr 2010 21:05:35 +0100 >> From: Phil Muldoon >> 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