From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18122 invoked by alias); 27 Apr 2010 20:05:45 -0000 Received: (qmail 18103 invoked by uid 22791); 27 Apr 2010 20:05:44 -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; Tue, 27 Apr 2010 20:05:39 +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 o3RK5bXK007251 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 27 Apr 2010 16:05:37 -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 o3RK5aUr024120; Tue, 27 Apr 2010 16:05:36 -0400 Message-ID: <4BD7438F.8030508@redhat.com> Date: Tue, 27 Apr 2010 20:05: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> In-Reply-To: <83r5m0y9fp.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/msg00921.txt.bz2 On 04/27/2010 08:36 PM, Eli Zaretskii wrote: >>> I asked to say something about this translation, or provide an >>> example. >> >> I'm just not sure what to say other than GDB will translate and encode >> any escape sequences in the string. In fact, 'encoded' will probably >> just do here without the 'translated' verb - it seems redundant with >> the new encoded text. I think that is clearer. How about that with a >> cross-reference to encoding (pxref{Character Sets})? > > 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. So take this super simple string parameter: class TestStringParam (gdb.Parameter): show_doc = "Show some string" set_doc = "Set some string" def __init__ (self, name): super (TestStringParam, self).__init__ (name, gdb.COMMAND_DATA, gdb.PARAM_STRING) self.value = "foo" test_file_param = TestStringParam ('test-string-param') Invoke it in GDB via the python command: (gdb) python >class TestStringParam (gdb.Parameter): > show_doc = "Show some string" > set_doc = "Set some string" > def __init__ (self, name): > super (TestStringParam, self).__init__ (name, gdb.COMMAND_DATA, gdb.PARAM_STRING) > self.value = "foo" >test_file_param = TestStringParam ('test-string-param') >end Now test it: (gdb) set test-string-param plain old text (gdb) show test-string-para Some string is "plain old text". (gdb) set test-string-param \107\157\157\144\040\104\141\171 sir! (gdb) show test-string-para Some string is "Good Day sir!". Does that help? Cheers, Phil