struct value *val;
(*pos) += 3 + BYTES_TO_EXP_ELEM (exp->elts[pc + 1].longconst + 1);
- regno = user_reg_map_name_to_regnum (current_gdbarch,
+ regno = user_reg_map_name_to_regnum (exp->gdbarch,
name, strlen (name));
if (regno == -1)
error (_("Register $%s not available."), name);
So for these registers, we fetch the register value regardless
of the evaluation mode. */
if (noside == EVAL_AVOID_SIDE_EFFECTS
- && regno < gdbarch_num_regs (current_gdbarch)
- + gdbarch_num_pseudo_regs (current_gdbarch))
- val = value_zero (register_type (current_gdbarch, regno), not_lval);
+ && regno < gdbarch_num_regs (exp->gdbarch)
+ + gdbarch_num_pseudo_regs (exp->gdbarch))
+ val = value_zero (register_type (exp->gdbarch, regno), not_lval);
else
val = value_of_register (regno, get_selected_frame (NULL));
if (val == NULL)
(*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);
{
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);
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:
{ /* Objective C message (method) call. */
- static CORE_ADDR responds_selector = 0;
- static CORE_ADDR method_selector = 0;
+ CORE_ADDR responds_selector = 0;
+ CORE_ADDR method_selector = 0;
CORE_ADDR selector = 0;
int struct_return = 0;
int sub_no_side = 0;
- static struct value *msg_send = NULL;
- static struct value *msg_send_stret = NULL;
- static int gnu_runtime = 0;
+ struct value *msg_send = NULL;
+ struct value *msg_send_stret = NULL;
+ int gnu_runtime = 0;
struct value *target = NULL;
struct value *method = NULL;
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"));
val_type = expect_type;
}
- struct_return = using_struct_return (value_type (method), val_type);
+ struct_return = using_struct_return (exp->gdbarch,
+ value_type (method), val_type);
}
else if (expect_type != NULL)
{
- struct_return = using_struct_return (NULL,
+ struct_return = using_struct_return (exp->gdbarch, NULL,
check_typedef (expect_type));
}
if (TYPE_CODE (value_type (method)) != TYPE_CODE_FUNC)
error (_("method address has symbol information with non-function type; skipping"));
if (struct_return)
- VALUE_ADDRESS (method) = value_as_address (msg_send_stret);
+ set_value_address (method, value_as_address (msg_send_stret));
else
- VALUE_ADDRESS (method) = value_as_address (msg_send);
+ set_value_address (method, value_as_address (msg_send));
called_method = method;
}
else
of the ``this'' pointer if necessary, so modify argvec[1] to
reflect any ``this'' changes. */
arg2 = value_from_longest (lookup_pointer_type(value_type (temp)),
- VALUE_ADDRESS (temp) + value_offset (temp)
+ value_address (temp)
+ value_embedded_offset (temp));
argvec[1] = arg2; /* the ``this'' pointer */
}