#include "arch-utils.h"
#include "charset.h"
#include "cp-abi.h"
-#include "gdb_assert.h"
#include "infcall.h"
#include "symtab.h" /* Needed by language.h. */
#include "language.h"
v_smob->next->prev = v_smob->prev;
}
-/* The smob "mark" function for <gdb:value>. */
-
-static SCM
-vlscm_mark_value_smob (SCM self)
-{
- value_smob *v_smob = (value_smob *) SCM_SMOB_DATA (self);
-
- scm_gc_mark (v_smob->address);
- scm_gc_mark (v_smob->type);
- return v_smob->dynamic_type;
-}
-
/* The smob "free" function for <gdb:value>. */
static size_t
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 "?".
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;
+ }
/* We don't assume anything about the result of scm_port_conversion_strategy.
From this point on, if errors is not 'errors, use 'substitute. */
{
int res_index = -1;
struct value *v;
+ value_smob *v_smob;
volatile struct gdb_exception except;
- v = vlscm_scm_to_value (value);
+ v_smob = vlscm_get_value_smob_arg_unsafe (value, SCM_ARG1, FUNC_NAME);
+ v = v_smob->value;
TRY_CATCH (except, RETURN_MASK_ALL)
{
{
value_smob_tag = gdbscm_make_smob_type (value_smob_name,
sizeof (value_smob));
- scm_set_smob_mark (value_smob_tag, vlscm_mark_value_smob);
scm_set_smob_free (value_smob_tag, vlscm_free_value_smob);
scm_set_smob_print (value_smob_tag, vlscm_print_value_smob);
scm_set_smob_equalp (value_smob_tag, vlscm_equal_p_value_smob);