public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/30161] New: x/f does not print values of _Float16
@ 2023-02-24  0:06 markjstock at gmail dot com
  2023-02-24  0:07 ` [Bug gdb/30161] " markjstock at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: markjstock at gmail dot com @ 2023-02-24  0:06 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30161

            Bug ID: 30161
           Summary: x/f does not print values of _Float16
           Product: gdb
           Version: 13.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: markjstock at gmail dot com
  Target Milestone: ---

Created attachment 14717
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14717&action=edit
A simple dot product program that uses float and _Float16

'p'rint will successfully print the value of fp16 variables
x/hf or x/f will not, it will print decimal instead

(gdb) p x32[0]
$1 = (__gnu_cxx::__alloc_traits<std::allocator<float>, float>::value_type &)
@0x155554eed010: 0.100000001
(gdb) x/wf 0x155554eed010 
0x155554eed010: 0.100000001

(gdb) p x16[0]
$2 = (__gnu_cxx::__alloc_traits<std::allocator<_Float16>, _Float16>::value_type
&) @0x1555552c6010: 0.099976
(gdb) x/hf 0x1555552c6010 
0x1555552c6010: 11878

This is relevant to debugging rocm programs (AMD GPUs) as the "print" command
under rocgdb does not not show __shared__ memory elements, and we must use 'x'
to view the values of __half variables because we only have their addresses.
(But that bug is AMD's.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug gdb/30161] x/f does not print values of _Float16
  2023-02-24  0:06 [Bug gdb/30161] New: x/f does not print values of _Float16 markjstock at gmail dot com
@ 2023-02-24  0:07 ` markjstock at gmail dot com
  2023-02-24 16:37 ` tromey at sourceware dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: markjstock at gmail dot com @ 2023-02-24  0:07 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30161

Mark Stock <markjstock at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markjstock at gmail dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug gdb/30161] x/f does not print values of _Float16
  2023-02-24  0:06 [Bug gdb/30161] New: x/f does not print values of _Float16 markjstock at gmail dot com
  2023-02-24  0:07 ` [Bug gdb/30161] " markjstock at gmail dot com
@ 2023-02-24 16:37 ` tromey at sourceware dot org
  2023-02-24 16:39 ` tromey at sourceware dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at sourceware dot org @ 2023-02-24 16:37 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30161

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
I have a fix.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug gdb/30161] x/f does not print values of _Float16
  2023-02-24  0:06 [Bug gdb/30161] New: x/f does not print values of _Float16 markjstock at gmail dot com
  2023-02-24  0:07 ` [Bug gdb/30161] " markjstock at gmail dot com
  2023-02-24 16:37 ` tromey at sourceware dot org
@ 2023-02-24 16:39 ` tromey at sourceware dot org
  2023-02-27 23:05 ` markjstock at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at sourceware dot org @ 2023-02-24 16:39 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30161

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-02-24

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
https://sourceware.org/pipermail/gdb-patches/2023-February/197367.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug gdb/30161] x/f does not print values of _Float16
  2023-02-24  0:06 [Bug gdb/30161] New: x/f does not print values of _Float16 markjstock at gmail dot com
                   ` (2 preceding siblings ...)
  2023-02-24 16:39 ` tromey at sourceware dot org
@ 2023-02-27 23:05 ` markjstock at gmail dot com
  2023-02-27 23:16 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: markjstock at gmail dot com @ 2023-02-27 23:05 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30161

--- Comment #3 from Mark Stock <markjstock at gmail dot com> ---
Works perfectly! Thanks for the quick action.

(gdb) p x32[0]
$1 = (__gnu_cxx::__alloc_traits<std::allocator<float>, float>::value_type &)
@0x155554eed010: 0.100000001
(gdb) x/wf 0x155554eed010
0x155554eed010: 0.100000001
(gdb) p x16[0]           
$2 = (__gnu_cxx::__alloc_traits<std::allocator<_Float16>, _Float16>::value_type
&) @0x1555552c6010: 0.099976
(gdb) x/hf 0x1555552c6010
0x1555552c6010: 0.099976

Is there anything else I can do to help this get into the next release so
everyone can enjoy it?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug gdb/30161] x/f does not print values of _Float16
  2023-02-24  0:06 [Bug gdb/30161] New: x/f does not print values of _Float16 markjstock at gmail dot com
                   ` (3 preceding siblings ...)
  2023-02-27 23:05 ` markjstock at gmail dot com
@ 2023-02-27 23:16 ` tromey at sourceware dot org
  2023-03-02 15:55 ` cvs-commit at gcc dot gnu.org
  2023-03-02 15:55 ` tromey at sourceware dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at sourceware dot org @ 2023-02-27 23:16 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30161

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
It'll land relatively soon and then show up in 14.1.
We probably won't put in on the gdb-13 branch, normally we
don't do a lot in the point releases

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug gdb/30161] x/f does not print values of _Float16
  2023-02-24  0:06 [Bug gdb/30161] New: x/f does not print values of _Float16 markjstock at gmail dot com
                   ` (4 preceding siblings ...)
  2023-02-27 23:16 ` tromey at sourceware dot org
@ 2023-03-02 15:55 ` cvs-commit at gcc dot gnu.org
  2023-03-02 15:55 ` tromey at sourceware dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-02 15:55 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30161

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

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

commit 70728e1d396475e8e630bfdd3fb8e8c8211bdbbd
Author: Tom Tromey <tromey@adacore.com>
Date:   Fri Feb 24 09:19:32 2023 -0700

    Handle half-float in 'x' command

    Using 'x/hf' should print bytes as float16, but instead it currently
    prints as an integer.  I tracked this down to a missing case in
    float_type_from_length.

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30161
    Approved-By: Simon Marchi <simon.marchi@efficios.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug gdb/30161] x/f does not print values of _Float16
  2023-02-24  0:06 [Bug gdb/30161] New: x/f does not print values of _Float16 markjstock at gmail dot com
                   ` (5 preceding siblings ...)
  2023-03-02 15:55 ` cvs-commit at gcc dot gnu.org
@ 2023-03-02 15:55 ` tromey at sourceware dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at sourceware dot org @ 2023-03-02 15:55 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30161

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |14.1
             Status|NEW                         |RESOLVED

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-02 15:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-24  0:06 [Bug gdb/30161] New: x/f does not print values of _Float16 markjstock at gmail dot com
2023-02-24  0:07 ` [Bug gdb/30161] " markjstock at gmail dot com
2023-02-24 16:37 ` tromey at sourceware dot org
2023-02-24 16:39 ` tromey at sourceware dot org
2023-02-27 23:05 ` markjstock at gmail dot com
2023-02-27 23:16 ` tromey at sourceware dot org
2023-03-02 15:55 ` cvs-commit at gcc dot gnu.org
2023-03-02 15:55 ` tromey at sourceware dot org

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).