* fork-child.c (fork_inferior): Only reset the thread list if this
[deliverable/binutils-gdb.git] / gdb / valops.c
index 9810f2b84a9a0fae02de25b1f5d8277e11cf3d36..a5bef37b338dfd5939747402fdec348892e7b8bb 100644 (file)
@@ -1352,6 +1352,24 @@ value_array (int lowbound, int highbound, struct value **elemvec)
   return val;
 }
 
+struct value *
+value_typed_string (char *ptr, int len, struct type *char_type)
+{
+  struct value *val;
+  int lowbound = current_language->string_lower_bound;
+  int highbound = len / TYPE_LENGTH (char_type);
+  struct type *rangetype = create_range_type ((struct type *) NULL,
+                                             builtin_type_int32,
+                                             lowbound, 
+                                             highbound + lowbound - 1);
+  struct type *stringtype
+    = create_array_type ((struct type *) NULL, char_type, rangetype);
+
+  val = allocate_value (stringtype);
+  memcpy (value_contents_raw (val), ptr, len);
+  return val;
+}
+
 /* Create a value for a string constant by allocating space in the
    inferior, copying the data into that space, and returning the
    address with type TYPE_CODE_STRING.  PTR points to the string
This page took 0.024379 seconds and 4 git commands to generate.