summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-06-17 20:35:09 +0000
committerTom Tromey <tromey@redhat.com>2011-06-17 20:35:09 +0000
commita03c034dadca211c0c179497907a776a84b024f7 (patch)
tree0d7b70a9b1ffe939af59835e315661efefa3f18e /gdb
parent5c9cffe047056e7934e1f40779fffb8d525576d2 (diff)
downloadgdb-a03c034dadca211c0c179497907a776a84b024f7.tar.gz
* value.h (value_of_this): Update.
(value_of_local): Remove. * valops.c (value_of_this): Rename from value_of_local. Change parameters. * p-exp.y (exp): Update. (variable): Likewise. * eval.c (evaluate_subexp_standard) <OP_THIS>: Use value_of_this.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/eval.c2
-rw-r--r--gdb/p-exp.y4
-rw-r--r--gdb/valops.c15
-rw-r--r--gdb/value.h5
5 files changed, 17 insertions, 19 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 418e1d15786..4c8c65837e9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,15 @@
2011-06-17 Tom Tromey <tromey@redhat.com>
+ * value.h (value_of_this): Update.
+ (value_of_local): Remove.
+ * valops.c (value_of_this): Rename from value_of_local. Change
+ parameters.
+ * p-exp.y (exp): Update.
+ (variable): Likewise.
+ * eval.c (evaluate_subexp_standard) <OP_THIS>: Use value_of_this.
+
+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.
diff --git a/gdb/eval.c b/gdb/eval.c
index 22ca8819f34..57a871f11f9 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -2830,7 +2830,7 @@ evaluate_subexp_standard (struct type *expect_type,
case OP_THIS:
(*pos) += 1;
- return value_of_local (exp->language_defn->la_name_of_this, 1);
+ return value_of_this (exp->language_defn, 1);
case OP_TYPE:
/* The value is not supposed to be used. This is here to make it
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index 32c7aca657b..0a384e146dd 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -612,7 +612,7 @@ exp : THIS
write_exp_elt_opcode (OP_THIS);
write_exp_elt_opcode (OP_THIS);
/* We need type of this. */
- this_val = value_of_this (0);
+ this_val = value_of_this (parse_language, 0);
if (this_val)
this_type = value_type (this_val);
else
@@ -760,7 +760,7 @@ variable: name_not_typename
write_exp_string ($1.stoken);
write_exp_elt_opcode (STRUCTOP_PTR);
/* We need type of this. */
- this_val = value_of_this (0);
+ this_val = value_of_this (parse_language, 0);
if (this_val)
this_type = value_type (this_val);
else
diff --git a/gdb/valops.c b/gdb/valops.c
index 6129bfef4c0..9b3b90a7506 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3601,12 +3601,13 @@ value_full_object (struct value *argp,
inappropriate context. */
struct value *
-value_of_local (const char *name, int complain)
+value_of_this (const struct language_defn *lang, int complain)
{
struct symbol *func, *sym;
struct block *b;
struct value * ret;
struct frame_info *frame;
+ const char *name = lang->la_name_of_this;
if (!name)
{
@@ -3660,18 +3661,6 @@ value_of_local (const char *name, int complain)
return ret;
}
-/* C++/Objective-C: return the value of the class instance variable,
- if one exists. Flag COMPLAIN signals an error if the request is
- made in an inappropriate context. */
-
-struct value *
-value_of_this (int complain)
-{
- if (!current_language->la_name_of_this)
- return 0;
- return value_of_local (current_language->la_name_of_this, complain);
-}
-
/* Create a slice (sub-string, sub-array) of ARRAY, that is LENGTH
elements long, starting at LOWBOUND. The result has the same lower
bound as the original ARRAY. */
diff --git a/gdb/value.h b/gdb/value.h
index 65d0a0249a0..03ca36bb5c1 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -715,7 +715,8 @@ extern int value_logical_not (struct value *arg1);
/* C++ */
-extern struct value *value_of_this (int complain);
+extern struct value *value_of_this (const struct language_defn *lang,
+ int complain);
extern struct value *value_x_binop (struct value *arg1, struct value *arg2,
enum exp_opcode op,
@@ -835,8 +836,6 @@ extern struct value *find_function_in_inferior (const char *,
extern struct value *value_allocate_space_in_inferior (int);
-extern struct value *value_of_local (const char *name, int complain);
-
extern struct value *value_subscripted_rvalue (struct value *array,
LONGEST index, int lowerbound);