* valops.c (value_of_local): Complain if NAME is NULL.

* std-operator.def (OP_OBJC_SELF): Remove.
	* parse.c (operator_length_standard) <OP_OBJC_SELF>: Remove.
	* objc-exp.y (name_not_typename): Use OP_THIS.
	* expprint.c (print_subexp_standard) <OP_THIS>: Print language's
	name for "this".
	<OP_OBJC_SELF>: Remove.
	* eval.c (evaluate_subexp_standard) <OP_OBJC_SELF>: Remove.
This commit is contained in:
Tom Tromey 2011-06-17 20:24:22 +00:00
parent 563002680c
commit aee28ec61a
7 changed files with 26 additions and 21 deletions

View File

@ -1,3 +1,14 @@
2011-06-17 Tom Tromey <tromey@redhat.com>
* valops.c (value_of_local): Complain if NAME is NULL.
* std-operator.def (OP_OBJC_SELF): Remove.
* parse.c (operator_length_standard) <OP_OBJC_SELF>: Remove.
* objc-exp.y (name_not_typename): Use OP_THIS.
* expprint.c (print_subexp_standard) <OP_THIS>: Print language's
name for "this".
<OP_OBJC_SELF>: Remove.
* eval.c (evaluate_subexp_standard) <OP_OBJC_SELF>: Remove.
2011-06-16 Tristan Gingold <gingold@adacore.com> 2011-06-16 Tristan Gingold <gingold@adacore.com>
* python/py-events.h (gdb_py_events): Make it extern. * python/py-events.h (gdb_py_events): Make it extern.

View File

@ -2830,11 +2830,7 @@ evaluate_subexp_standard (struct type *expect_type,
case OP_THIS: case OP_THIS:
(*pos) += 1; (*pos) += 1;
return value_of_this (1); return value_of_local (exp->language_defn->la_name_of_this, 1);
case OP_OBJC_SELF:
(*pos) += 1;
return value_of_local ("self", 1);
case OP_TYPE: case OP_TYPE:
/* The value is not supposed to be used. This is here to make it /* The value is not supposed to be used. This is here to make it

View File

@ -499,14 +499,11 @@ print_subexp_standard (struct expression *exp, int *pos,
case OP_THIS: case OP_THIS:
++(*pos); ++(*pos);
fputs_filtered ("this", stream); if (exp->language_defn->la_name_of_this)
return; fputs_filtered (exp->language_defn->la_name_of_this, stream);
else
/* Objective-C ops */ fprintf_filtered (stream, _("<language %s has no 'this'>"),
exp->language_defn->la_name);
case OP_OBJC_SELF:
++(*pos);
fputs_filtered ("self", stream); /* The ObjC equivalent of "this". */
return; return;
/* Modula-2 ops */ /* Modula-2 ops */

View File

@ -755,8 +755,8 @@ variable: name_not_typename
if (innermost_block == 0 || if (innermost_block == 0 ||
contained_in (block_found, innermost_block)) contained_in (block_found, innermost_block))
innermost_block = block_found; innermost_block = block_found;
write_exp_elt_opcode (OP_OBJC_SELF); write_exp_elt_opcode (OP_THIS);
write_exp_elt_opcode (OP_OBJC_SELF); write_exp_elt_opcode (OP_THIS);
write_exp_elt_opcode (STRUCTOP_PTR); write_exp_elt_opcode (STRUCTOP_PTR);
write_exp_string ($1.stoken); write_exp_string ($1.stoken);
write_exp_elt_opcode (STRUCTOP_PTR); write_exp_elt_opcode (STRUCTOP_PTR);

View File

@ -963,7 +963,6 @@ operator_length_standard (const struct expression *expr, int endpos,
/* C++ */ /* C++ */
case OP_THIS: case OP_THIS:
case OP_OBJC_SELF:
oplen = 2; oplen = 2;
break; break;

View File

@ -277,11 +277,6 @@ OP (STRUCTOP_PTR)
It just comes in a tight (OP_THIS, OP_THIS) pair. */ It just comes in a tight (OP_THIS, OP_THIS) pair. */
OP (OP_THIS) OP (OP_THIS)
/* Objective-C: OP_OBJC_SELF is just a placeholder for the class
instance variable. It just comes in a tight (OP_OBJC_SELF,
OP_OBJC_SELF) pair. */
OP (OP_OBJC_SELF)
/* Objective C: "@selector" pseudo-operator. */ /* Objective C: "@selector" pseudo-operator. */
OP (OP_OBJC_SELECTOR) OP (OP_OBJC_SELECTOR)

View File

@ -3608,6 +3608,13 @@ value_of_local (const char *name, int complain)
struct value * ret; struct value * ret;
struct frame_info *frame; struct frame_info *frame;
if (!name)
{
if (complain)
error (_("no `this' in current language"));
return 0;
}
if (complain) if (complain)
frame = get_selected_frame (_("no frame selected")); frame = get_selected_frame (_("no frame selected"));
else else