Add accessors for members of complex numbers
authorTom Tromey <tom@tromey.com>
Wed, 1 Apr 2020 20:09:52 +0000 (14:09 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 1 Apr 2020 20:09:52 +0000 (14:09 -0600)
commit4c99290df04ba757b74a21ac5a6d16fe300e49ed
treeccb4fc81ef873b8bb729af596360c54817a3e824
parent5b930b4538f70a9f09280e36164840e48fb1c042
Add accessors for members of complex numbers

This introduces two new functions that make it simpler to access the
components of a complex number.

gdb/ChangeLog
2020-04-01  Tom Tromey  <tom@tromey.com>

* valprint.c (generic_value_print_complex): Use accessors.
* value.h (value_real_part, value_imaginary_part): Declare.
* valops.c (value_real_part, value_imaginary_part): New
functions.
* value.c (creal_internal_fn, cimag_internal_fn): Use accessors.
gdb/ChangeLog
gdb/valops.c
gdb/valprint.c
gdb/value.c
gdb/value.h