aboutsummaryrefslogtreecommitdiff
path: root/gdb/values.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/values.c')
-rw-r--r--gdb/values.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/gdb/values.c b/gdb/values.c
index a42e53a..eaf3765 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -1170,15 +1170,18 @@ value_from_string (char *ptr)
struct value *val;
int len = strlen (ptr);
int lowbound = current_language->string_lower_bound;
- struct type *rangetype =
- create_range_type ((struct type *) NULL,
- builtin_type_int,
- lowbound, len + lowbound - 1);
- struct type *stringtype =
- create_array_type ((struct type *) NULL,
- *current_language->string_char_type,
- rangetype);
-
+ struct type *string_char_type;
+ struct type *rangetype;
+ struct type *stringtype;
+
+ rangetype = create_range_type ((struct type *) NULL,
+ builtin_type_int,
+ lowbound, len + lowbound - 1);
+ string_char_type = language_string_char_type (current_language,
+ current_gdbarch);
+ stringtype = create_array_type ((struct type *) NULL,
+ string_char_type,
+ rangetype);
val = allocate_value (stringtype);
memcpy (VALUE_CONTENTS_RAW (val), ptr, len);
return val;