aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-04-01 14:09:52 -0600
committerTom Tromey <tromey@adacore.com>2020-04-01 14:09:52 -0600
commit4c99290df04ba757b74a21ac5a6d16fe300e49ed (patch)
treeccb4fc81ef873b8bb729af596360c54817a3e824 /gdb/value.h
parent5b930b4538f70a9f09280e36164840e48fb1c042 (diff)
downloadbinutils-4c99290df04ba757b74a21ac5a6d16fe300e49ed.zip
binutils-4c99290df04ba757b74a21ac5a6d16fe300e49ed.tar.gz
binutils-4c99290df04ba757b74a21ac5a6d16fe300e49ed.tar.bz2
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.
Diffstat (limited to 'gdb/value.h')
-rw-r--r--gdb/value.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/value.h b/gdb/value.h
index e4fd258..85fe6c2 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -1141,6 +1141,14 @@ extern struct value *value_slice (struct value *, int, int);
extern struct value *value_literal_complex (struct value *, struct value *,
struct type *);
+/* Return the real part of a complex value. */
+
+extern struct value *value_real_part (struct value *value);
+
+/* Return the imaginary part of a complex value. */
+
+extern struct value *value_imaginary_part (struct value *value);
+
extern struct value *find_function_in_inferior (const char *,
struct objfile **);