aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:20:15 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:20:15 +0000
commitd4dbb9c7d4ddc39cb0affb783515944bdf8cce68 (patch)
tree482d6925ce4723f71f47c24477c7759f12491685 /gdb
parent8ca1c40ee1951a585d1fce1d78709979872acf81 (diff)
downloadgdb-d4dbb9c7d4ddc39cb0affb783515944bdf8cce68.zip
gdb-d4dbb9c7d4ddc39cb0affb783515944bdf8cce68.tar.gz
gdb-d4dbb9c7d4ddc39cb0affb783515944bdf8cce68.tar.bz2
* eval.c (evaluate_subexp_standard): Use exp->gdbarch types instead
of builtin_type_ macros when handling OP_OBJC_ operations. * objc-lang.c (print_object_command): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/eval.c26
-rw-r--r--gdb/objc-lang.c2
3 files changed, 22 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9fbca08..988a45a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2008-09-11 Ulrich Weigand <uweigand@de.ibm.com>
+ * eval.c (evaluate_subexp_standard): Use exp->gdbarch types instead
+ of builtin_type_ macros when handling OP_OBJC_ operations.
+ * objc-lang.c (print_object_command): Likewise.
+
+2008-09-11 Ulrich Weigand <uweigand@de.ibm.com>
+
* ada-valprint.c: Include "objfiles.h".
(ada_val_print_1): Use the gdbarch associated with the objfile whether
a System.Address type is defined to retrieve the proper pointer type
diff --git a/gdb/eval.c b/gdb/eval.c
index f4ae539..0cccc82 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -999,6 +999,7 @@ evaluate_subexp_standard (struct type *expect_type,
{ /* Objective C @selector operator. */
char *sel = &exp->elts[pc + 2].string;
int len = longest_to_int (exp->elts[pc + 1].longconst);
+ struct type *selector_type;
(*pos) += 3 + BYTES_TO_EXP_ELEM (len + 1);
if (noside == EVAL_SKIP)
@@ -1006,8 +1007,9 @@ evaluate_subexp_standard (struct type *expect_type,
if (sel[len] != 0)
sel[len] = 0; /* Make sure it's terminated. */
- return value_from_longest (lookup_pointer_type (builtin_type_void),
- lookup_child_selector (sel));
+
+ selector_type = builtin_type (exp->gdbarch)->builtin_data_ptr;
+ return value_from_longest (selector_type, lookup_child_selector (sel));
}
case OP_OBJC_MSGCALL:
@@ -1030,6 +1032,7 @@ evaluate_subexp_standard (struct type *expect_type,
struct value *called_method = NULL;
struct type *selector_type = NULL;
+ struct type *long_type;
struct value *ret = NULL;
CORE_ADDR addr = 0;
@@ -1041,7 +1044,9 @@ evaluate_subexp_standard (struct type *expect_type,
(*pos) += 3;
- selector_type = lookup_pointer_type (builtin_type_void);
+ long_type = builtin_type (exp->gdbarch)->builtin_long;
+ selector_type = builtin_type (exp->gdbarch)->builtin_data_ptr;
+
if (noside == EVAL_AVOID_SIDE_EFFECTS)
sub_no_side = EVAL_NORMAL;
else
@@ -1050,7 +1055,7 @@ evaluate_subexp_standard (struct type *expect_type,
target = evaluate_subexp (selector_type, exp, pos, sub_no_side);
if (value_as_long (target) == 0)
- return value_from_longest (builtin_type_long, 0);
+ return value_from_longest (long_type, 0);
if (lookup_minimal_symbol ("objc_msg_lookup", 0, 0))
gnu_runtime = 1;
@@ -1065,8 +1070,7 @@ evaluate_subexp_standard (struct type *expect_type,
only). */
if (gnu_runtime)
{
- struct type *type;
- type = lookup_pointer_type (builtin_type_void);
+ struct type *type = selector_type;
type = lookup_function_type (type);
type = lookup_pointer_type (type);
type = lookup_function_type (type);
@@ -1110,8 +1114,8 @@ evaluate_subexp_standard (struct type *expect_type,
argvec[0] = msg_send;
argvec[1] = target;
- argvec[2] = value_from_longest (builtin_type_long, responds_selector);
- argvec[3] = value_from_longest (builtin_type_long, selector);
+ argvec[2] = value_from_longest (long_type, responds_selector);
+ argvec[3] = value_from_longest (long_type, selector);
argvec[4] = 0;
ret = call_function_by_hand (argvec[0], 3, argvec + 1);
@@ -1132,8 +1136,8 @@ evaluate_subexp_standard (struct type *expect_type,
argvec[0] = msg_send;
argvec[1] = target;
- argvec[2] = value_from_longest (builtin_type_long, method_selector);
- argvec[3] = value_from_longest (builtin_type_long, selector);
+ argvec[2] = value_from_longest (long_type, method_selector);
+ argvec[3] = value_from_longest (long_type, selector);
argvec[4] = 0;
ret = call_function_by_hand (argvec[0], 3, argvec + 1);
@@ -1252,7 +1256,7 @@ evaluate_subexp_standard (struct type *expect_type,
argvec[0] = called_method;
argvec[1] = target;
- argvec[2] = value_from_longest (builtin_type_long, selector);
+ argvec[2] = value_from_longest (long_type, selector);
/* User-supplied arguments. */
for (tem = 0; tem < nargs; tem++)
argvec[tem + 3] = evaluate_subexp_with_coercion (exp, pos, noside);
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index 56871e3..4dadd4c 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -1378,7 +1378,7 @@ print_object_command (char *args, int from_tty)
int pc = 0;
object = expr->language_defn->la_exp_desc->evaluate_exp
- (builtin_type_void_data_ptr, expr, &pc, EVAL_NORMAL);
+ (builtin_type (expr->gdbarch)->builtin_data_ptr, expr, &pc, EVAL_NORMAL);
do_cleanups (old_chain);
}