diff options
author | Tristan Gingold <gingold@adacore.com> | 2012-05-10 14:10:34 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2012-05-10 14:10:34 +0000 |
commit | 66e9d518c733e1f658104009f22ce76e38ca4150 (patch) | |
tree | 9571ac1ccfdedda5a51f35dfa70756b683b366cd | |
parent | b431cbf92f2f9b4890cde22a5deac3aa2c9bfd36 (diff) | |
download | gdb-66e9d518c733e1f658104009f22ce76e38ca4150.tar.gz |
2012-05-10 Tristan Gingold <gingold@adacore.com>
* printcmd.c (set_command): Add pre/post inc/dec.
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/printcmd.c | 20 |
2 files changed, 19 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index df3496dd64d..be59495b7c6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2012-05-10 Tristan Gingold <gingold@adacore.com> + + * printcmd.c (set_command): Add pre/post inc/dec. + 2012-05-09 Frank Ch. Eigler <fche@redhat.com> * gdb.1: Document -ex option. diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 79e38f21d57..fa7629630e6 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1080,11 +1080,21 @@ set_command (char *exp, int from_tty) struct cleanup *old_chain = make_cleanup (free_current_contents, &expr); - if (expr->nelts >= 1 - && expr->elts[0].opcode != BINOP_ASSIGN - && expr->elts[0].opcode != BINOP_ASSIGN_MODIFY - && expr->elts[0].opcode != BINOP_COMMA) - warning (_("Expression is not an assignment (and might have no effect)")); + if (expr->nelts >= 1) + switch (expr->elts[0].opcode) + { + case UNOP_PREINCREMENT: + case UNOP_POSTINCREMENT: + case UNOP_PREDECREMENT: + case UNOP_POSTDECREMENT: + case BINOP_ASSIGN: + case BINOP_ASSIGN_MODIFY: + case BINOP_COMMA: + break; + default: + warning + (_("Expression is not an assignment (and might have no effect)")); + } evaluate_expression (expr); do_cleanups (old_chain); |