aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile/scm-math.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2021-07-15 10:47:56 +0100
committerPedro Alves <pedro@palves.net>2021-07-15 15:10:59 +0100
commit50991aaf22b03a9925ae37155f16bc8257f95242 (patch)
treedb0d641ebab1211d0f79c5dc00062c0708ad5b60 /gdb/guile/scm-math.c
parent67ea24cb99efcd50d8acb6ce3e3ffbd8c97f0829 (diff)
downloadbinutils-users/palves/value_string.zip
binutils-users/palves/value_string.tar.gz
binutils-users/palves/value_string.tar.bz2
Change-Id: I79ef914087dbf85e1cbc19263843a6034383afe7
Diffstat (limited to 'gdb/guile/scm-math.c')
-rw-r--r--gdb/guile/scm-math.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/guile/scm-math.c b/gdb/guile/scm-math.c
index 8b7fe9b..a88c805 100644
--- a/gdb/guile/scm-math.c
+++ b/gdb/guile/scm-math.c
@@ -776,6 +776,8 @@ vlscm_convert_typed_value_from_scheme (const char *func_name,
}
else if (scm_is_string (obj))
{
+ size_t len;
+
if (type != NULL)
{
except_scm = gdbscm_make_misc_error (func_name, type_arg_pos,
@@ -787,14 +789,12 @@ vlscm_convert_typed_value_from_scheme (const char *func_name,
{
/* TODO: Provide option to specify conversion strategy. */
gdb::unique_xmalloc_ptr<char> s
- = gdbscm_scm_to_string (obj, nullptr,
+ = gdbscm_scm_to_string (obj, &len,
target_charset (gdbarch),
0 /*non-strict*/,
&except_scm);
if (s != NULL)
- value = value_cstring (s.get (), strlen (s.get ()) + 1,
- language_string_char_type (language,
- gdbarch));
+ value = language->value_string (gdbarch, s.get (), len);
else
value = NULL;
}