Implement complex arithmetic
This adds support for complex arithmetic to gdb. Now something like
"print 23 + 7i" will work.
Addition, subtraction, multiplication, division, and equality testing
are supported binary operations.
Unary +, negation, and complement are supported. Following GCC, the ~
operator computes the complex conjugate.
gdb/ChangeLog
2020-04-01 Tom Tromey <tom@tromey.com>
PR exp/25299:
* valarith.c (promotion_type, complex_binop): New functions.
(scalar_binop): Handle complex numbers. Use promotion_type.
(value_pos, value_neg, value_complement): Handle complex numbers.
gdb/testsuite/ChangeLog
2020-04-01 Tom Tromey <tom@tromey.com>
* gdb.base/complex-parts.exp: Add arithmetic tests.