summaryrefslogtreecommitdiff
path: root/gdb/ax-gdb.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2005-03-08 14:35:20 +0000
committerNathan Sidwell <nathan@codesourcery.com>2005-03-08 14:35:20 +0000
commitbdfc42ff1d498685109533048732356c8637129b (patch)
tree9234be33284efb08a2d62bb1376d7d76235e121f /gdb/ax-gdb.c
parentaa69a4b6504d84ef657bed25bf89e0066b66c33e (diff)
downloadgdb-bdfc42ff1d498685109533048732356c8637129b.tar.gz
* ax-gdb.c (gen_expr): Add UNOP_PLUS case.
* c-exp.y (exp): Add unary plus. * eval.c (evaluate_subexp_standard): Add UNOP_PLUS case. * valarith.c (value_x_unop): Add UNOP_PLUS case. (value_pos): New. * value.h (value_pos): Declare. * gdb.cp/userdef.cc (A1::operator+): New unary plus. (A2): New class. (main): Test operator+. * gdb.cp/userdef.exp: Test unary plus. Use A2::operator+ for breakpoint test.
Diffstat (limited to 'gdb/ax-gdb.c')
-rw-r--r--gdb/ax-gdb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 98d9ef59d51..1b0097ff957 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -1642,6 +1642,13 @@ gen_expr (union exp_element **pc, struct agent_expr *ax,
}
break;
+ case UNOP_PLUS:
+ (*pc)++;
+ /* + FOO is equivalent to 0 + FOO, which can be optimized. */
+ gen_expr (pc, ax, value);
+ gen_usual_unary (ax, value);
+ break;
+
case UNOP_NEG:
(*pc)++;
/* -FOO is equivalent to 0 - FOO. */