* gdbtypes.c (create_string_type): Receive character type as argument.

* gdbtypes.h (create_string_type): Add character type argument.
        * dwarf2read.c (read_tag_string_type): Pass character type to
	create_string_type.

	* value.h (value_string): Add character type argument.
	* valops.c (value_string): Add character type argument.  Pass it to
	create_string_type.  Do not allocate space in inferior.
	* valarith.c (value_concat): Pass character type to value_string.

	* value.h (value_typed_string): Rename to ...
	(value_cstring): ... this.
	* valops.c (value_typed_string): Rename to ...
	(value_cstring): ... this.
	* c-lang.c (evaluate_subexp_c): Update.

	* python/python-value.c (builtin_type_pychar): New define.
	(convert_value_from_python): Call value_cstring instead
	of value_from_string.
	* value.c (value_from_string): Remove.
	* value.h (value_from_string): Remove.

	* eval.c (evaluate_subexp_standard): Pass character type to
	value_string.  Pass expression architecture to value_nsstring
	and lookup_child_selector.
	* objc-lang.h (lookup_objc_class): Add GDBARCH parameter.
	(lookup_child_selector): Likewise.
	(value_nsstring): Likewise.
	* objc-lang.c (lookup_objc_class): Add GDBARCH parameter.
	Pass character type to value_string..
	(lookup_child_selector): Likewise.
	(value_nsstring): Add GDBARCH parameter, use it instead of
	objfile architecture.  Pass architecture to lookup_objc_class
	and lookup_child_selector. Pass character type to value_string.
	(end_msglist): Pass architecture to lookup_objc_class.
	* objc-exp.y: Pass architecture to lookup_objc_class.
This commit is contained in:
Ulrich Weigand
2009-06-17 18:47:35 +00:00
parent e6c014f28f
commit 3b7538c031
14 changed files with 111 additions and 96 deletions

View File

@ -624,6 +624,7 @@ value_concat (struct value *arg1, struct value *arg2)
char inchar;
struct type *type1 = check_typedef (value_type (arg1));
struct type *type2 = check_typedef (value_type (arg2));
struct type *char_type;
/* First figure out if we are dealing with two values to be concatenated
or a repeat count and a value to be repeated. INVAL1 is set to the
@ -659,6 +660,7 @@ value_concat (struct value *arg1, struct value *arg2)
ptr = (char *) alloca (count * inval2len);
if (TYPE_CODE (type2) == TYPE_CODE_CHAR)
{
char_type = type2;
inchar = (char) unpack_long (type2,
value_contents (inval2));
for (idx = 0; idx < count; idx++)
@ -668,13 +670,14 @@ value_concat (struct value *arg1, struct value *arg2)
}
else
{
char_type = TYPE_TARGET_TYPE (type2);
for (idx = 0; idx < count; idx++)
{
memcpy (ptr + (idx * inval2len), value_contents (inval2),
inval2len);
}
}
outval = value_string (ptr, count * inval2len);
outval = value_string (ptr, count * inval2len, char_type);
}
else if (TYPE_CODE (type2) == TYPE_CODE_BITSTRING
|| TYPE_CODE (type2) == TYPE_CODE_BOOL)
@ -700,10 +703,12 @@ value_concat (struct value *arg1, struct value *arg2)
ptr = (char *) alloca (inval1len + inval2len);
if (TYPE_CODE (type1) == TYPE_CODE_CHAR)
{
char_type = type1;
*ptr = (char) unpack_long (type1, value_contents (inval1));
}
else
{
char_type = TYPE_TARGET_TYPE (type1);
memcpy (ptr, value_contents (inval1), inval1len);
}
if (TYPE_CODE (type2) == TYPE_CODE_CHAR)
@ -715,7 +720,7 @@ value_concat (struct value *arg1, struct value *arg2)
{
memcpy (ptr + inval1len, value_contents (inval2), inval2len);
}
outval = value_string (ptr, inval1len + inval2len);
outval = value_string (ptr, inval1len + inval2len, char_type);
}
else if (TYPE_CODE (type1) == TYPE_CODE_BITSTRING
|| TYPE_CODE (type1) == TYPE_CODE_BOOL)