* valops.c (value_of_local): Complain if NAME is NULL.
authorTom Tromey <tromey@redhat.com>
Fri, 17 Jun 2011 20:24:22 +0000 (20:24 +0000)
committerTom Tromey <tromey@redhat.com>
Fri, 17 Jun 2011 20:24:22 +0000 (20:24 +0000)
* 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.

gdb/ChangeLog
gdb/eval.c
gdb/expprint.c
gdb/objc-exp.y
gdb/parse.c
gdb/std-operator.def
gdb/valops.c

index 8db242a048e25363a28d00167aedd34ddca58093..418e1d1578634a51823af31691817f23eb32c7c9 100644 (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>
 
        * python/py-events.h (gdb_py_events): Make it extern.
index bbc7b8a71f80661438d9a4d6a1c9cd3e7e1fedb2..22ca8819f341b36a25e68f4fe3471c7948561593 100644 (file)
@@ -2830,11 +2830,7 @@ evaluate_subexp_standard (struct type *expect_type,
 
     case OP_THIS:
       (*pos) += 1;
-      return value_of_this (1);
-
-    case OP_OBJC_SELF:
-      (*pos) += 1;
-      return value_of_local ("self", 1);
+      return value_of_local (exp->language_defn->la_name_of_this, 1);
 
     case OP_TYPE:
       /* The value is not supposed to be used.  This is here to make it
index a52dee3a91cb6b5763a9c88e92366dcf8f62d17c..2b6e4160676f9a0c89e86b76633557d372504327 100644 (file)
@@ -499,14 +499,11 @@ print_subexp_standard (struct expression *exp, int *pos,
 
     case OP_THIS:
       ++(*pos);
-      fputs_filtered ("this", stream);
-      return;
-
-      /* Objective-C ops */
-
-    case OP_OBJC_SELF:
-      ++(*pos);
-      fputs_filtered ("self", stream); /* The ObjC equivalent of "this".  */
+      if (exp->language_defn->la_name_of_this)
+       fputs_filtered (exp->language_defn->la_name_of_this, stream);
+      else
+       fprintf_filtered (stream, _("<language %s has no 'this'>"),
+                         exp->language_defn->la_name);
       return;
 
       /* Modula-2 ops */
index 852adff6428c4340d73f1090c24a2ff2f2e64705..881542fccaddedd3cb68d365da3d6fc9a6e5b556 100644 (file)
@@ -755,8 +755,8 @@ variable:   name_not_typename
                              if (innermost_block == 0 || 
                                  contained_in (block_found, innermost_block))
                                innermost_block = block_found;
-                             write_exp_elt_opcode (OP_OBJC_SELF);
-                             write_exp_elt_opcode (OP_OBJC_SELF);
+                             write_exp_elt_opcode (OP_THIS);
+                             write_exp_elt_opcode (OP_THIS);
                              write_exp_elt_opcode (STRUCTOP_PTR);
                              write_exp_string ($1.stoken);
                              write_exp_elt_opcode (STRUCTOP_PTR);
index 4815854c83105cedc92a8f6b6e688e2c4455be24..a8523e62055a152fd74a68065cc45a1726199990 100644 (file)
@@ -963,7 +963,6 @@ operator_length_standard (const struct expression *expr, int endpos,
 
       /* C++ */
     case OP_THIS:
-    case OP_OBJC_SELF:
       oplen = 2;
       break;
 
index 267215c8e8b40f7039a655db0c8717e3a20af0e5..2c771415b787e6c563152afdcbde53b5f5c672c0 100644 (file)
@@ -277,11 +277,6 @@ OP (STRUCTOP_PTR)
    It just comes in a tight (OP_THIS, OP_THIS) pair.  */
 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.  */
 OP (OP_OBJC_SELECTOR)
 
index 36761039c21ff3380ac0d322c3bcd58b023e14ef..6129bfef4c01664d506a8c2c2b6e356eedf6b187 100644 (file)
@@ -3608,6 +3608,13 @@ value_of_local (const char *name, int complain)
   struct value * ret;
   struct frame_info *frame;
 
+  if (!name)
+    {
+      if (complain)
+       error (_("no `this' in current language"));
+      return 0;
+    }
+
   if (complain)
     frame = get_selected_frame (_("no frame selected"));
   else
This page took 0.041954 seconds and 4 git commands to generate.