From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17430 invoked by alias); 7 Jun 2014 10:12:42 -0000 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 Received: (qmail 17419 invoked by uid 89); 7 Jun 2014 10:12:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: hera.aquilenet.fr Received: from hera.aquilenet.fr (HELO hera.aquilenet.fr) (141.255.128.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 07 Jun 2014 10:12:40 +0000 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 7F82C2BE4; Sat, 7 Jun 2014 12:12:36 +0200 (CEST) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G5tLGRzp7L3h; Sat, 7 Jun 2014 12:12:36 +0200 (CEST) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 240032061; Sat, 7 Jun 2014 12:12:35 +0200 (CEST) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Doug Evans Cc: gdb-patches@sourceware.org Subject: Re: [commit] Add support for guile 2.0.5. References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 19 Prairial an 222 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Sat, 07 Jun 2014 10:12:00 -0000 In-Reply-To: (Doug Evans's message of "Fri, 06 Jun 2014 16:00:32 -0700") Message-ID: <87r431gh9o.fsf@gnu.org> User-Agent: Gnus/5.130009 (Ma Gnus v0.9) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-06/txt/msg00344.txt.bz2 Doug Evans skribis: > --- a/gdb/guile/scm-value.c > +++ b/gdb/guile/scm-value.c > @@ -1016,9 +1016,11 @@ gdbscm_value_to_real (SCM self) > the target's charset. >=20=20 > ERRORS is one of #f, 'error or 'substitute. > - An error setting of #f means use the default, which is > - Guile's %default-port-conversion-strategy. If the default is not one > - of 'error or 'substitute, 'substitute is used. > + An error setting of #f means use the default, which is Guile's > + %default-port-conversion-strategy when using Guile >=3D 2.0.6, or 'er= ror if > + using an earlier version of Guile. Earlier versions do not properly > + support obtaining the default port conversion strategy. > + If the default is not one of 'error or 'substitute, 'substitute is us= ed. > An error setting of "error" causes an exception to be thrown if there= 's > a decoding error. An error setting of "substitute" causes invalid > characters to be replaced with "?". > @@ -1069,7 +1071,14 @@ gdbscm_value_to_string (SCM self, SCM rest) > gdbscm_throw (excp); > } > if (errors =3D=3D SCM_BOOL_F) > - errors =3D scm_port_conversion_strategy (SCM_BOOL_F); > + { > + /* N.B. scm_port_conversion_strategy in Guile versions prior to 2.= 0.6 > + will throw a Scheme error when passed #f. */ > + if (gdbscm_guile_version_is_at_least (2, 0, 6)) > + errors =3D scm_port_conversion_strategy (SCM_BOOL_F); > + else > + errors =3D error_symbol; > + } I wonder if this could have been a feature test (catching the exception and falling back to ERROR_SYMBOL) rather than checking the version number. Otherwise looks good to me, thanks for doing that. Ludo=E2=80=99.