From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27829 invoked by alias); 10 Nov 2009 17:03:07 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 27628 invoked by uid 22791); 10 Nov 2009 17:03:06 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: References: <20091110021158.C3C2576D70@ppluzhnikov.mtv.corp.google.com> <58596C4646708B4BB990C44839973330013A61DE@usplmvpbe001.ent.rt.verigy.net> <8ac60eac0911100006yc31e2acmba7bf9fde33ddfa@mail.gmail.com> <8ac60eac0911100744t5335a44fn7175e2d5c512e450@mail.gmail.com> Date: Tue, 10 Nov 2009 17:03:00 -0000 Message-ID: <8ac60eac0911100902t6619b0a3p57186ac3411f2c8b@mail.gmail.com> Subject: Re: [python] Pretty-printers and addressprint From: Paul Pluzhnikov To: tromey@redhat.com Cc: Paul Koning , "Elmenthaler, Jens" , gdb@sourceware.org, archer@sourceware.org, dje@google.com Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-SW-Source: 2009-q4/txt/msg00055.txt.bz2 On Tue, Nov 10, 2009 at 8:53 AM, Tom Tromey wrote: > What you want instead is repr(value.string()), at least if you want to > try this route. That of course can't work, since it's the value.string() which raises exception. Here is the output: $4 = Traceback (most recent call last): File "../../../src/gdb/testsuite/gdb.python/py-prettyprint.py", line 27, in to_string return repr(self.val['whybother']['contents'].string()) UnicodeDecodeError: 'ascii' codec can't decode byte 0x81 in position 9: ordinal not in range(128) It also changes other output in the way I didn't expect: print cstring $5 = u'const string' print c $6 = container u'container' with 2 elements = { [0] = 23, [1] = 72 } Thanks, -- Paul Pluzhnikov