From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH v2 7/7] Fix value_literal_complex comment
Date: Fri, 20 Mar 2020 15:53:40 -0600 [thread overview]
Message-ID: <20200320215340.16749-8-tom@tromey.com> (raw)
In-Reply-To: <20200320215340.16749-1-tom@tromey.com>
Christian pointed out that the value_literal_complex was still a bit
weird; this patch rewrites it and moves it to value.h.
gdb/ChangeLog
2020-03-20 Tom Tromey <tom@tromey.com>
* value.h (value_literal_complex): Add comment.
* valops.c (value_literal_complex): Refer to value.h.
---
gdb/ChangeLog | 5 +++++
gdb/valops.c | 6 ++----
gdb/value.h | 4 ++++
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/gdb/valops.c b/gdb/valops.c
index 83fd2584b59..03c6482ee1e 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3854,12 +3854,10 @@ value_slice (struct value *array, int lowbound, int length)
return slice;
}
-/* Create a value for a FORTRAN complex number. Currently most of the
- time values are coerced to COMPLEX*16 (i.e. a complex number
- composed of 2 doubles. */
+/* See value.h. */
struct value *
-value_literal_complex (struct value *arg1,
+value_literal_complex (struct value *arg1,
struct value *arg2,
struct type *type)
{
diff --git a/gdb/value.h b/gdb/value.h
index 85fe6c297f5..247be13a0d9 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -1138,6 +1138,10 @@ extern struct value *varying_to_slice (struct value *);
extern struct value *value_slice (struct value *, int, int);
+/* Create a complex number. The type is the complex type; the values
+ are cast to the underlying scalar type before the complex number is
+ created. */
+
extern struct value *value_literal_complex (struct value *, struct value *,
struct type *);
--
2.17.2
next prev parent reply other threads:[~2020-03-20 21:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-20 21:53 [PATCH v2 0/7] Update complex number support Tom Tromey
2020-03-20 21:53 ` [PATCH v2 1/7] Change how complex types are created Tom Tromey
2020-04-02 14:59 ` Aktemur, Tankut Baris
2020-04-02 19:17 ` Tom Tromey
2020-03-20 21:53 ` [PATCH v2 2/7] Add accessors for members of complex numbers Tom Tromey
2020-03-20 21:53 ` [PATCH v2 3/7] Change how complex types are printed in C Tom Tromey
2020-04-02 6:42 ` [committed][gdb/testsuite] Accept new complex print style in mixed-lang-stack.exp Tom de Vries
2020-04-02 13:30 ` Tom Tromey
2020-03-20 21:53 ` [PATCH v2 4/7] Change the C parser to allow complex constants Tom Tromey
2020-03-20 21:53 ` [PATCH v2 5/7] Implement complex arithmetic Tom Tromey
2020-03-20 21:53 ` [PATCH v2 6/7] Add _Complex type support to C parser Tom Tromey
2020-03-20 21:53 ` Tom Tromey [this message]
2020-04-01 20:10 ` [PATCH v2 0/7] Update complex number support Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200320215340.16749-8-tom@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox