public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Rewrite ada_value_print_1 floating point case
Date: Sat, 14 Mar 2020 00:08:29 +0000 (GMT)	[thread overview]
Message-ID: <20200314000829.22E8E394B02F@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b9fa6e07980f901f2a3f99b7eed4356d3209a3c4

commit b9fa6e07980f901f2a3f99b7eed4356d3209a3c4
Author: Tom Tromey <tom@tromey.com>
Date:   Fri Mar 13 17:39:52 2020 -0600

    Rewrite ada_value_print_1 floating point case
    
    This rewrites the TYPE_CODE_FLT case in ada_value_print_1 to be purely
    value-based.
    
    gdb/ChangeLog
    2020-03-13  Tom Tromey  <tom@tromey.com>
    
            * ada-valprint.c (ada_value_print_1) <TYPE_CODE_FLT>: Rewrite.

Diff:
---
 gdb/ChangeLog      |  4 ++++
 gdb/ada-valprint.c | 11 ++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c5c060f3613..ebeedb598e6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2020-03-13  Tom Tromey  <tom@tromey.com>
+
+	* ada-valprint.c (ada_value_print_1) <TYPE_CODE_FLT>: Rewrite.
+
 2020-03-13  Tom Tromey  <tom@tromey.com>
 
 	* ada-valprint.c (ada_value_print_ptr): New function.
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index 2cb7334b4ec..e0ef410bf0d 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -1294,9 +1294,14 @@ ada_value_print_1 (struct value *val, struct ui_file *stream, int recurse,
       break;
 
     case TYPE_CODE_FLT:
-      ada_val_print_flt (type, valaddr, 0, 0,
-			 address, stream, recurse, val,
-			 options);
+      if (options->format)
+	{
+	  common_val_print (val, stream, recurse, options,
+			    language_def (language_c));
+	  break;
+	}
+
+      ada_print_floating (valaddr, type, stream);
       break;
 
     case TYPE_CODE_UNION:


                 reply	other threads:[~2020-03-14  0:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200314000829.22E8E394B02F@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).