From: Andreas Schwab <schwab@linux-m68k.org>
To: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>
Cc: Andrew Burgess <aburgess@redhat.com>, Tom Tromey <tromey@adacore.com>
Subject: Re: [PATCH] Change how "print/x" displays floating-point value
Date: Fri, 18 Feb 2022 18:41:14 +0100 [thread overview]
Message-ID: <87zgmovzr9.fsf@igel.home> (raw)
In-Reply-To: <87k0dsqg47.fsf@tromey.com> (Tom Tromey via Gdb-patches's message of "Fri, 18 Feb 2022 09:44:24 -0700")
On Feb 18 2022, Tom Tromey via Gdb-patches wrote:
> diff --git a/gdb/NEWS b/gdb/NEWS
> index 9da74e71796..544efa3fe74 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -97,6 +97,12 @@ show style disassembler enabled
>
> * Changed commands
>
> +print
> + Printing of floating-point values with base-modifying formats like
> + /x has been changed to display the underlying bytes of the value in
> + the desired base. This was GDB's documented behavior, but was never
> + implemented correctly.
How does that handle padding?
> diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
> index 37632985a07..78a2147017d 100644
> --- a/gdb/testsuite/gdb.base/printcmds.exp
> +++ b/gdb/testsuite/gdb.base/printcmds.exp
> @@ -158,8 +158,14 @@ proc test_float_rejected {} {
> # Regression test for PR gdb/21675
> proc test_radices {} {
> gdb_test "print/o 16777211" " = 077777773"
> - gdb_test "print/d 1.5" " = 1"
> - gdb_test "print/u 1.5" " = 1"
> +
> + # See PR gdb/16242 for this.
> + gdb_test "print/d 1.5f" " = 1069547520"
> + gdb_test "print/u 1.5f" " = 1069547520"
> + gdb_test "print/x 1.5f" " = 0x3fc00000"
> + gdb_test "print/t 1.5f" " = 111111110000000000000000000000"
> + gdb_test "print/o 1.5f" " = 07760000000"
That assumes a particular representation of the float type that depends
on the target.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
next prev parent reply other threads:[~2022-02-18 17:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 21:29 Tom Tromey via Gdb-patches
2022-02-17 23:17 ` Andrew Burgess via Gdb-patches
2022-02-18 16:44 ` Tom Tromey via Gdb-patches
2022-02-18 17:02 ` Eli Zaretskii via Gdb-patches
2022-03-10 17:27 ` Tom Tromey via Gdb-patches
2022-03-10 17:54 ` Eli Zaretskii via Gdb-patches
2022-03-10 19:19 ` Tom Tromey via Gdb-patches
2022-02-18 17:41 ` Andreas Schwab [this message]
2022-02-19 10:05 ` Andrew Burgess via Gdb-patches
2022-03-10 17:30 ` Tom Tromey via Gdb-patches
2022-03-10 17:30 ` Tom Tromey via Gdb-patches
2022-03-10 18:23 ` Andreas Schwab
2022-03-10 20:39 ` Tom Tromey via Gdb-patches
2022-03-10 20:53 ` Andreas Schwab
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=87zgmovzr9.fsf@igel.home \
--to=schwab@linux-m68k.org \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.com \
/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