* 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

@ -1,3 +1,42 @@
2009-06-17 Ulrich Weigand <uweigand@de.ibm.com>
* 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.
2009-06-17 Ulrich Weigand <uweigand@de.ibm.com> 2009-06-17 Ulrich Weigand <uweigand@de.ibm.com>
* gdbtypes.h (struct language_defn): Add forward declaration. * gdbtypes.h (struct language_defn): Add forward declaration.

View file

@ -951,7 +951,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
if ((dest_type & C_CHAR) != 0) if ((dest_type & C_CHAR) != 0)
result = allocate_value (type); result = allocate_value (type);
else else
result = value_typed_string ("", 0, type); result = value_cstring ("", 0, type);
do_cleanups (cleanup); do_cleanups (cleanup);
return result; return result;
} }
@ -971,7 +971,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
/* Write the terminating character. */ /* Write the terminating character. */
for (i = 0; i < TYPE_LENGTH (type); ++i) for (i = 0; i < TYPE_LENGTH (type); ++i)
obstack_1grow (&output, 0); obstack_1grow (&output, 0);
result = value_typed_string (obstack_base (&output), result = value_cstring (obstack_base (&output),
obstack_object_size (&output), obstack_object_size (&output),
type); type);
} }

View file

@ -5165,6 +5165,7 @@ static struct type *
read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
{ {
struct objfile *objfile = cu->objfile; struct objfile *objfile = cu->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct type *type, *range_type, *index_type, *char_type; struct type *type, *range_type, *index_type, *char_type;
struct attribute *attr; struct attribute *attr;
unsigned int length; unsigned int length;
@ -5190,7 +5191,8 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
index_type = builtin_type_int32; index_type = builtin_type_int32;
range_type = create_range_type (NULL, index_type, 1, length); range_type = create_range_type (NULL, index_type, 1, length);
type = create_string_type (NULL, range_type); char_type = language_string_char_type (cu->language_defn, gdbarch);
type = create_string_type (NULL, char_type, range_type);
return set_die_type (die, type, cu); return set_die_type (die, type, cu);
} }

View file

@ -789,7 +789,8 @@ evaluate_subexp_standard (struct type *expect_type,
(*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1); (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
if (noside == EVAL_SKIP) if (noside == EVAL_SKIP)
goto nosideret; goto nosideret;
return value_string (&exp->elts[pc + 2].string, tem); type = language_string_char_type (exp->language_defn, exp->gdbarch);
return value_string (&exp->elts[pc + 2].string, tem, type);
case OP_OBJC_NSSTRING: /* Objective C Foundation Class NSString constant. */ case OP_OBJC_NSSTRING: /* Objective C Foundation Class NSString constant. */
tem = longest_to_int (exp->elts[pc + 1].longconst); tem = longest_to_int (exp->elts[pc + 1].longconst);
@ -798,7 +799,7 @@ evaluate_subexp_standard (struct type *expect_type,
{ {
goto nosideret; goto nosideret;
} }
return (struct value *) value_nsstring (&exp->elts[pc + 2].string, tem + 1); return value_nsstring (exp->gdbarch, &exp->elts[pc + 2].string, tem + 1);
case OP_BITSTRING: case OP_BITSTRING:
tem = longest_to_int (exp->elts[pc + 1].longconst); tem = longest_to_int (exp->elts[pc + 1].longconst);
@ -1010,7 +1011,8 @@ evaluate_subexp_standard (struct type *expect_type,
sel[len] = 0; /* Make sure it's terminated. */ sel[len] = 0; /* Make sure it's terminated. */
selector_type = builtin_type (exp->gdbarch)->builtin_data_ptr; selector_type = builtin_type (exp->gdbarch)->builtin_data_ptr;
return value_from_longest (selector_type, lookup_child_selector (sel)); return value_from_longest (selector_type,
lookup_child_selector (exp->gdbarch, sel));
} }
case OP_OBJC_MSGCALL: case OP_OBJC_MSGCALL:
@ -1098,16 +1100,20 @@ evaluate_subexp_standard (struct type *expect_type,
the verification method than the non-standard, but more the verification method than the non-standard, but more
often used, 'NSObject' class. Make sure we check for both. */ often used, 'NSObject' class. Make sure we check for both. */
responds_selector = lookup_child_selector ("respondsToSelector:"); responds_selector
= lookup_child_selector (exp->gdbarch, "respondsToSelector:");
if (responds_selector == 0) if (responds_selector == 0)
responds_selector = lookup_child_selector ("respondsTo:"); responds_selector
= lookup_child_selector (exp->gdbarch, "respondsTo:");
if (responds_selector == 0) if (responds_selector == 0)
error (_("no 'respondsTo:' or 'respondsToSelector:' method")); error (_("no 'respondsTo:' or 'respondsToSelector:' method"));
method_selector = lookup_child_selector ("methodForSelector:"); method_selector
= lookup_child_selector (exp->gdbarch, "methodForSelector:");
if (method_selector == 0) if (method_selector == 0)
method_selector = lookup_child_selector ("methodFor:"); method_selector
= lookup_child_selector (exp->gdbarch, "methodFor:");
if (method_selector == 0) if (method_selector == 0)
error (_("no 'methodFor:' or 'methodForSelector:' method")); error (_("no 'methodFor:' or 'methodForSelector:' method"));

View file

@ -847,12 +847,9 @@ create_array_type (struct type *result_type,
struct type * struct type *
create_string_type (struct type *result_type, create_string_type (struct type *result_type,
struct type *string_char_type,
struct type *range_type) struct type *range_type)
{ {
struct type *string_char_type;
string_char_type = language_string_char_type (current_language,
current_gdbarch);
result_type = create_array_type (result_type, result_type = create_array_type (result_type,
string_char_type, string_char_type,
range_type); range_type);

View file

@ -1177,7 +1177,8 @@ extern struct type *create_range_type (struct type *, struct type *, int,
extern struct type *create_array_type (struct type *, struct type *, extern struct type *create_array_type (struct type *, struct type *,
struct type *); struct type *);
extern struct type *create_string_type (struct type *, struct type *); extern struct type *create_string_type (struct type *, struct type *,
struct type *);
extern struct type *create_set_type (struct type *, struct type *); extern struct type *create_set_type (struct type *, struct type *);

View file

@ -333,7 +333,8 @@ exp : '[' TYPENAME
{ {
CORE_ADDR class; CORE_ADDR class;
class = lookup_objc_class (copy_name ($2.stoken)); class = lookup_objc_class (parse_gdbarch,
copy_name ($2.stoken));
if (class == 0) if (class == 0)
error ("%s is not an ObjC Class", error ("%s is not an ObjC Class",
copy_name ($2.stoken)); copy_name ($2.stoken));
@ -1748,7 +1749,7 @@ yylex ()
/* See if it's an ObjC classname. */ /* See if it's an ObjC classname. */
if (!sym) if (!sym)
{ {
CORE_ADDR Class = lookup_objc_class(tmp); CORE_ADDR Class = lookup_objc_class (parse_gdbarch, tmp);
if (Class) if (Class)
{ {
yylval.class.class = Class; yylval.class.class = Class;

View file

@ -108,8 +108,9 @@ lookup_struct_typedef (char *name, struct block *block, int noerr)
} }
CORE_ADDR CORE_ADDR
lookup_objc_class (char *classname) lookup_objc_class (struct gdbarch *gdbarch, char *classname)
{ {
struct type *char_type = builtin_type (gdbarch)->builtin_char;
struct value * function, *classval; struct value * function, *classval;
if (! target_has_execution) if (! target_has_execution)
@ -128,15 +129,16 @@ lookup_objc_class (char *classname)
return 0; return 0;
} }
classval = value_string (classname, strlen (classname) + 1); classval = value_string (classname, strlen (classname) + 1, char_type);
classval = value_coerce_array (classval); classval = value_coerce_array (classval);
return (CORE_ADDR) value_as_long (call_function_by_hand (function, return (CORE_ADDR) value_as_long (call_function_by_hand (function,
1, &classval)); 1, &classval));
} }
CORE_ADDR CORE_ADDR
lookup_child_selector (char *selname) lookup_child_selector (struct gdbarch *gdbarch, char *selname)
{ {
struct type *char_type = builtin_type (gdbarch)->builtin_char;
struct value * function, *selstring; struct value * function, *selstring;
if (! target_has_execution) if (! target_has_execution)
@ -156,53 +158,50 @@ lookup_child_selector (char *selname)
} }
selstring = value_coerce_array (value_string (selname, selstring = value_coerce_array (value_string (selname,
strlen (selname) + 1)); strlen (selname) + 1, char_type));
return value_as_long (call_function_by_hand (function, 1, &selstring)); return value_as_long (call_function_by_hand (function, 1, &selstring));
} }
struct value * struct value *
value_nsstring (char *ptr, int len) value_nsstring (struct gdbarch *gdbarch, char *ptr, int len)
{ {
struct type *char_type = builtin_type (gdbarch)->builtin_char;
struct value *stringValue[3]; struct value *stringValue[3];
struct value *function, *nsstringValue; struct value *function, *nsstringValue;
struct symbol *sym; struct symbol *sym;
struct type *type; struct type *type;
struct objfile *objf;
struct gdbarch *gdbarch;
if (!target_has_execution) if (!target_has_execution)
return 0; /* Can't call into inferior to create NSString. */ return 0; /* Can't call into inferior to create NSString. */
stringValue[2] = value_string(ptr, len); stringValue[2] = value_string(ptr, len, char_type);
stringValue[2] = value_coerce_array(stringValue[2]); stringValue[2] = value_coerce_array(stringValue[2]);
/* _NSNewStringFromCString replaces "istr" after Lantern2A. */ /* _NSNewStringFromCString replaces "istr" after Lantern2A. */
if (lookup_minimal_symbol("_NSNewStringFromCString", 0, 0)) if (lookup_minimal_symbol("_NSNewStringFromCString", 0, 0))
{ {
function = find_function_in_inferior("_NSNewStringFromCString", &objf); function = find_function_in_inferior("_NSNewStringFromCString", NULL);
nsstringValue = call_function_by_hand(function, 1, &stringValue[2]); nsstringValue = call_function_by_hand(function, 1, &stringValue[2]);
} }
else if (lookup_minimal_symbol("istr", 0, 0)) else if (lookup_minimal_symbol("istr", 0, 0))
{ {
function = find_function_in_inferior("istr", &objf); function = find_function_in_inferior("istr", NULL);
nsstringValue = call_function_by_hand(function, 1, &stringValue[2]); nsstringValue = call_function_by_hand(function, 1, &stringValue[2]);
} }
else if (lookup_minimal_symbol("+[NSString stringWithCString:]", 0, 0)) else if (lookup_minimal_symbol("+[NSString stringWithCString:]", 0, 0))
{ {
function function
= find_function_in_inferior("+[NSString stringWithCString:]", &objf); = find_function_in_inferior("+[NSString stringWithCString:]", NULL);
type = builtin_type (get_objfile_arch (objf))->builtin_long; type = builtin_type (gdbarch)->builtin_long;
stringValue[0] = value_from_longest stringValue[0] = value_from_longest
(type, lookup_objc_class ("NSString")); (type, lookup_objc_class (gdbarch, "NSString"));
stringValue[1] = value_from_longest stringValue[1] = value_from_longest
(type, lookup_child_selector ("stringWithCString:")); (type, lookup_child_selector (gdbarch, "stringWithCString:"));
nsstringValue = call_function_by_hand(function, 3, &stringValue[0]); nsstringValue = call_function_by_hand(function, 3, &stringValue[0]);
} }
else else
error (_("NSString: internal error -- no way to create new NSString")); error (_("NSString: internal error -- no way to create new NSString"));
gdbarch = get_objfile_arch (objf);
sym = lookup_struct_typedef("NSString", 0, 1); sym = lookup_struct_typedef("NSString", 0, 1);
if (sym == NULL) if (sym == NULL)
sym = lookup_struct_typedef("NXString", 0, 1); sym = lookup_struct_typedef("NXString", 0, 1);
@ -612,7 +611,7 @@ end_msglist(void)
selname_chain = sel->next; selname_chain = sel->next;
msglist_len = sel->msglist_len; msglist_len = sel->msglist_len;
msglist_sel = sel->msglist_sel; msglist_sel = sel->msglist_sel;
selid = lookup_child_selector(p); selid = lookup_child_selector (parse_gdbarch, p);
if (!selid) if (!selid)
error (_("Can't find selector \"%s\""), p); error (_("Can't find selector \"%s\""), p);
write_exp_elt_longcst (selid); write_exp_elt_longcst (selid);

View file

@ -29,8 +29,10 @@ extern int objc_parse (void); /* Defined in c-exp.y */
extern void objc_error (char *); /* Defined in c-exp.y */ extern void objc_error (char *); /* Defined in c-exp.y */
extern CORE_ADDR lookup_objc_class (char *classname); extern CORE_ADDR lookup_objc_class (struct gdbarch *gdbarch,
extern CORE_ADDR lookup_child_selector (char *methodname); char *classname);
extern CORE_ADDR lookup_child_selector (struct gdbarch *gdbarch,
char *methodname);
extern char *objc_demangle (const char *mangled, int options); extern char *objc_demangle (const char *mangled, int options);
@ -46,7 +48,8 @@ extern char *find_imps (struct symtab *symtab, struct block *block,
char *method, struct symbol **syms, char *method, struct symbol **syms,
unsigned int *nsym, unsigned int *ndebug); unsigned int *nsym, unsigned int *ndebug);
extern struct value *value_nsstring (char *ptr, int len); extern struct value *value_nsstring (struct gdbarch *gdbarch,
char *ptr, int len);
/* for parsing Objective C */ /* for parsing Objective C */
extern void start_msglist (void); extern void start_msglist (void);

View file

@ -55,6 +55,9 @@ struct value *values_in_python = NULL;
#define builtin_type_pybool \ #define builtin_type_pybool \
language_bool_type (current_language, current_gdbarch) language_bool_type (current_language, current_gdbarch)
#define builtin_type_pychar \
language_string_char_type (current_language, current_gdbarch)
typedef struct { typedef struct {
PyObject_HEAD PyObject_HEAD
struct value *value; struct value *value;
@ -867,7 +870,7 @@ convert_value_from_python (PyObject *obj)
if (s != NULL) if (s != NULL)
{ {
old = make_cleanup (xfree, s); old = make_cleanup (xfree, s);
value = value_from_string (s); value = value_cstring (s, strlen (s), builtin_type_pychar);
do_cleanups (old); do_cleanups (old);
} }
} }

View file

@ -624,6 +624,7 @@ value_concat (struct value *arg1, struct value *arg2)
char inchar; char inchar;
struct type *type1 = check_typedef (value_type (arg1)); struct type *type1 = check_typedef (value_type (arg1));
struct type *type2 = check_typedef (value_type (arg2)); 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 /* 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 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); ptr = (char *) alloca (count * inval2len);
if (TYPE_CODE (type2) == TYPE_CODE_CHAR) if (TYPE_CODE (type2) == TYPE_CODE_CHAR)
{ {
char_type = type2;
inchar = (char) unpack_long (type2, inchar = (char) unpack_long (type2,
value_contents (inval2)); value_contents (inval2));
for (idx = 0; idx < count; idx++) for (idx = 0; idx < count; idx++)
@ -668,13 +670,14 @@ value_concat (struct value *arg1, struct value *arg2)
} }
else else
{ {
char_type = TYPE_TARGET_TYPE (type2);
for (idx = 0; idx < count; idx++) for (idx = 0; idx < count; idx++)
{ {
memcpy (ptr + (idx * inval2len), value_contents (inval2), memcpy (ptr + (idx * inval2len), value_contents (inval2),
inval2len); inval2len);
} }
} }
outval = value_string (ptr, count * inval2len); outval = value_string (ptr, count * inval2len, char_type);
} }
else if (TYPE_CODE (type2) == TYPE_CODE_BITSTRING else if (TYPE_CODE (type2) == TYPE_CODE_BITSTRING
|| TYPE_CODE (type2) == TYPE_CODE_BOOL) || TYPE_CODE (type2) == TYPE_CODE_BOOL)
@ -700,10 +703,12 @@ value_concat (struct value *arg1, struct value *arg2)
ptr = (char *) alloca (inval1len + inval2len); ptr = (char *) alloca (inval1len + inval2len);
if (TYPE_CODE (type1) == TYPE_CODE_CHAR) if (TYPE_CODE (type1) == TYPE_CODE_CHAR)
{ {
char_type = type1;
*ptr = (char) unpack_long (type1, value_contents (inval1)); *ptr = (char) unpack_long (type1, value_contents (inval1));
} }
else else
{ {
char_type = TYPE_TARGET_TYPE (type1);
memcpy (ptr, value_contents (inval1), inval1len); memcpy (ptr, value_contents (inval1), inval1len);
} }
if (TYPE_CODE (type2) == TYPE_CODE_CHAR) 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); 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 else if (TYPE_CODE (type1) == TYPE_CODE_BITSTRING
|| TYPE_CODE (type1) == TYPE_CODE_BOOL) || TYPE_CODE (type1) == TYPE_CODE_BOOL)

View file

@ -1349,7 +1349,7 @@ value_array (int lowbound, int highbound, struct value **elemvec)
} }
struct value * struct value *
value_typed_string (char *ptr, int len, struct type *char_type) value_cstring (char *ptr, int len, struct type *char_type)
{ {
struct value *val; struct value *val;
int lowbound = current_language->string_lower_bound; int lowbound = current_language->string_lower_bound;
@ -1376,34 +1376,21 @@ value_typed_string (char *ptr, int len, struct type *char_type)
string may contain embedded null bytes. */ string may contain embedded null bytes. */
struct value * struct value *
value_string (char *ptr, int len) value_string (char *ptr, int len, struct type *char_type)
{ {
struct value *val; struct value *val;
int lowbound = current_language->string_lower_bound; int lowbound = current_language->string_lower_bound;
int highbound = len / TYPE_LENGTH (char_type);
struct type *rangetype = create_range_type ((struct type *) NULL, struct type *rangetype = create_range_type ((struct type *) NULL,
builtin_type_int32, builtin_type_int32,
lowbound, lowbound,
len + lowbound - 1); highbound + lowbound - 1);
struct type *stringtype struct type *stringtype
= create_string_type ((struct type *) NULL, rangetype); = create_string_type ((struct type *) NULL, char_type, rangetype);
CORE_ADDR addr;
if (current_language->c_style_arrays == 0)
{
val = allocate_value (stringtype); val = allocate_value (stringtype);
memcpy (value_contents_raw (val), ptr, len); memcpy (value_contents_raw (val), ptr, len);
return val; return val;
}
/* Allocate space to store the string in the inferior, and then copy
LEN bytes from PTR in gdb to that address in the inferior. */
addr = allocate_space_in_inferior (len);
write_memory (addr, (gdb_byte *) ptr, len);
val = value_at_lazy (stringtype, addr);
return (val);
} }
struct value * struct value *

View file

@ -2025,34 +2025,6 @@ value_from_pointer (struct type *type, CORE_ADDR addr)
} }
/* Create a value for a string constant to be stored locally
(not in the inferior's memory space, but in GDB memory).
This is analogous to value_from_longest, which also does not
use inferior memory. String shall NOT contain embedded nulls. */
struct value *
value_from_string (char *ptr)
{
struct value *val;
int len = strlen (ptr);
int lowbound = current_language->string_lower_bound;
struct type *string_char_type;
struct type *rangetype;
struct type *stringtype;
rangetype = create_range_type ((struct type *) NULL,
builtin_type_int32,
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;
}
/* Create a value of type TYPE whose contents come from VALADDR, if it /* Create a value of type TYPE whose contents come from VALADDR, if it
is non-null, and whose memory address (in the inferior) is is non-null, and whose memory address (in the inferior) is
ADDRESS. */ ADDRESS. */

View file

@ -339,7 +339,6 @@ extern struct value *value_from_pointer (struct type *type, CORE_ADDR addr);
extern struct value *value_from_double (struct type *type, DOUBLEST num); extern struct value *value_from_double (struct type *type, DOUBLEST num);
extern struct value *value_from_decfloat (struct type *type, extern struct value *value_from_decfloat (struct type *type,
const gdb_byte *decbytes); const gdb_byte *decbytes);
extern struct value *value_from_string (char *string);
extern struct value *value_at (struct type *type, CORE_ADDR addr); extern struct value *value_at (struct type *type, CORE_ADDR addr);
extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr); extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr);
@ -381,9 +380,10 @@ extern struct value *value_mark (void);
extern void value_free_to_mark (struct value *mark); extern void value_free_to_mark (struct value *mark);
extern struct value *value_typed_string (char *ptr, int len, extern struct value *value_cstring (char *ptr, int len,
struct type *char_type);
extern struct value *value_string (char *ptr, int len,
struct type *char_type); struct type *char_type);
extern struct value *value_string (char *ptr, int len);
extern struct value *value_bitstring (char *ptr, int len); extern struct value *value_bitstring (char *ptr, int len);
extern struct value *value_array (int lowbound, int highbound, extern struct value *value_array (int lowbound, int highbound,