From: ludo@gnu.org (Ludovic Courtès)
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [commit] Add support for guile 2.0.5.
Date: Sat, 07 Jun 2014 10:12:00 -0000 [thread overview]
Message-ID: <87r431gh9o.fsf@gnu.org> (raw)
In-Reply-To: <yjt2egz17ien.fsf@ruffy2.mtv.corp.google.com> (Doug Evans's message of "Fri, 06 Jun 2014 16:00:32 -0700")
Doug Evans <dje@google.com> 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.
>
> 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 >= 2.0.6, or 'error 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 used.
> 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 == SCM_BOOL_F)
> - errors = 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 = scm_port_conversion_strategy (SCM_BOOL_F);
> + else
> + errors = 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’.
prev parent reply other threads:[~2014-06-07 10:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-06 23:00 Doug Evans
2014-06-07 10:12 ` Ludovic Courtès [this message]
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=87r431gh9o.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=dje@google.com \
--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