diff options
author | Tom Tromey <tom@tromey.com> | 2021-03-08 07:27:57 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-03-08 07:28:36 -0700 |
commit | b0f9164cc6d738db3a71c1ea83aa6567f0387bca (patch) | |
tree | a5223772e2ce0c8c8ddeb616ce2c57e6d01a6f7d /gdb | |
parent | a88c43542dfa0eb5606613cb8ac249bdb1d61b13 (diff) | |
download | gdb-b0f9164cc6d738db3a71c1ea83aa6567f0387bca.zip gdb-b0f9164cc6d738db3a71c1ea83aa6567f0387bca.tar.gz gdb-b0f9164cc6d738db3a71c1ea83aa6567f0387bca.tar.bz2 |
Remove use of op_string
After switching to the new expression implementation, there will no
need for op_string. Before deleting it, the one call outside of the
expression-printing code must be removed. That is what this patch
does.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* ada-lang.c (ada_value_binop): Do not use op_string.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/ada-lang.c | 15 |
2 files changed, 18 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 93fdabd..fe4f560 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2021-03-08 Tom Tromey <tom@tromey.com> + * ada-lang.c (ada_value_binop): Do not use op_string. + +2021-03-08 Tom Tromey <tom@tromey.com> + * expprint.c (dump_for_expression): New overload. * expop.h (check_objfile, dump_for_expression): Declare new overloads. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index a62cfb9..2c2ceee 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -9321,7 +9321,20 @@ ada_value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) v2 = value_as_long (arg2); if (v2 == 0) - error (_("second operand of %s must not be zero."), op_string (op)); + { + const char *name; + if (op == BINOP_MOD) + name = "mod"; + else if (op == BINOP_DIV) + name = "/"; + else + { + gdb_assert (op == BINOP_REM); + name = "rem"; + } + + error (_("second operand of %s must not be zero."), name); + } if (type1->is_unsigned () || op == BINOP_MOD) return value_binop (arg1, arg2, op); |