aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-06-17 18:47:35 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-06-17 18:47:35 +0000
commit3b7538c0317072d430eca4e808b183dac5bd5e45 (patch)
tree5d181808a477c585f4840272098ebd6c8b9f8321 /gdb/eval.c
parente6c014f28ffa7d52bf7e9b599422f5ca910a17dd (diff)
downloadgdb-3b7538c0317072d430eca4e808b183dac5bd5e45.zip
gdb-3b7538c0317072d430eca4e808b183dac5bd5e45.tar.gz
gdb-3b7538c0317072d430eca4e808b183dac5bd5e45.tar.bz2
* 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.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index e64d4bf..df730057 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -789,7 +789,8 @@ evaluate_subexp_standard (struct type *expect_type,
(*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
if (noside == EVAL_SKIP)
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. */
tem = longest_to_int (exp->elts[pc + 1].longconst);
@@ -798,7 +799,7 @@ evaluate_subexp_standard (struct type *expect_type,
{
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:
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. */
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:
@@ -1098,16 +1100,20 @@ evaluate_subexp_standard (struct type *expect_type,
the verification method than the non-standard, but more
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)
- responds_selector = lookup_child_selector ("respondsTo:");
+ responds_selector
+ = lookup_child_selector (exp->gdbarch, "respondsTo:");
if (responds_selector == 0)
error (_("no 'respondsTo:' or 'respondsToSelector:' method"));
- method_selector = lookup_child_selector ("methodForSelector:");
+ method_selector
+ = lookup_child_selector (exp->gdbarch, "methodForSelector:");
if (method_selector == 0)
- method_selector = lookup_child_selector ("methodFor:");
+ method_selector
+ = lookup_child_selector (exp->gdbarch, "methodFor:");
if (method_selector == 0)
error (_("no 'methodFor:' or 'methodForSelector:' method"));