fix for eval.c
Per Bothner
bothner@cygnus.com
Sat May 15 12:20:00 GMT 1999
This too has been sitting in my devo/gdb for a bit.
It is basically a minor cleanup.
--Per
Sat May 15 12:16:09 1999 Per Bothner <bothner@deneb.cygnus.com>
* eval.c (evaluate_subexp_standard): Remove Gilmore rant.
(Of course C has "expected types", at least if you allow
brace-initializer expressions - as in Gcc.)
Remove NULLing out expect_type. Do pass NULL_TYPE in place
the incoming expect_type where appropriate.
Index: eval.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/eval.c,v
retrieving revision 1.98
diff -u -p -r1.98 eval.c
--- eval.c 1998/10/14 01:14:47 1.98
+++ eval.c 1999/05/15 19:15:12
@@ -384,19 +384,6 @@ evaluate_subexp_standard (expect_type, e
int upper, lower, retcode;
int code;
- /* This expect_type crap should not be used for C. C expressions do
- not have any notion of expected types, never has and (goddess
- willing) never will. The C++ code uses it for some twisted
- purpose (I haven't investigated but I suspect it just the usual
- combination of Stroustrup figuring out some crazy language
- feature and Tiemann figuring out some crazier way to try to
- implement it). CHILL has the tuple stuff; I don't know enough
- about CHILL to know whether expected types is the way to do it.
- FORTRAN I don't know. */
- if (exp->language_defn->la_language != language_cplus
- && exp->language_defn->la_language != language_chill)
- expect_type = NULL_TYPE;
-
pc = (*pos)++;
op = exp->elts[pc].opcode;
@@ -409,7 +396,7 @@ evaluate_subexp_standard (expect_type, e
0,
exp->elts[pc + 1].type,
&exp->elts[pc + 3].string,
- expect_type);
+ NULL_TYPE);
if (arg1 == NULL)
error ("There is no field named %s", &exp->elts[pc + 3].string);
return arg1;
@@ -1495,7 +1482,7 @@ evaluate_subexp_standard (expect_type, e
(*pos) += 3 + BYTES_TO_EXP_ELEM (temm + 1);
}
else
- evaluate_subexp (expect_type, exp, pos, EVAL_SKIP);
+ evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
goto nosideret;
}
More information about the Gdb-patches
mailing list