aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>2006-02-18 20:47:54 +0000
committerFred Fish <fnf@specifix.com>2006-02-18 20:47:54 +0000
commitd843c49cbf3970abc659c9ab96f845859ce28377 (patch)
treeb57cf6c8b4ae33600462a0b8cfaf4df6eeec9f10 /gdb/eval.c
parent62f3a2ba52dfda0e6166bb4670fce9b90b3bf218 (diff)
downloadgdb-d843c49cbf3970abc659c9ab96f845859ce28377.zip
gdb-d843c49cbf3970abc659c9ab96f845859ce28377.tar.gz
gdb-d843c49cbf3970abc659c9ab96f845859ce28377.tar.bz2
2006-02-16 Fred Fish <fnf@specifix.com>
* eval.c (evaluate_subexp_standard): For OP_TYPE, return a non lval value zero, of the appropriate type, when avoiding side effects. * typeprint.c (ptype_eval): Remove function and declaration. (ptype_command): Simplify to just a call to whatis_exp.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 961b89e..66776ea 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -2086,7 +2086,15 @@ evaluate_subexp_standard (struct type *expect_type,
return value_of_local ("self", 1);
case OP_TYPE:
- error (_("Attempt to use a type name as an expression"));
+ /* The value is not supposed to be used. This is here to make it
+ easier to accommodate expressions that contain types. */
+ (*pos) += 2;
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+ else if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ return allocate_value (exp->elts[pc + 1].type);
+ else
+ error (_("Attempt to use a type name as an expression"));
default:
/* Removing this case and compiling with gcc -Wall reveals that