public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/12134] New: long double precision lost
Date: Mon, 18 Oct 2010 21:08:00 -0000 [thread overview]
Message-ID: <bug-12134-4717@http.sourceware.org/bugzilla/> (raw)
http://sourceware.org/bugzilla/show_bug.cgi?id=12134
Summary: long double precision lost
Product: gdb
Version: unknown
Status: NEW
Severity: normal
Priority: P2
Component: gdb
AssignedTo: unassigned@sourceware.org
ReportedBy: jakub@redhat.com
Target: x86_64-linux
double d = __DBL_DENORM_MIN__;
long double l1 = (long double) __DBL_DENORM_MIN__;
long double l2 = __LDBL_MIN__;
long double l3 = __LDBL_MIN__ * 0x1p200L;
int
main (void)
{
return 0;
}
gcc -g -o tt tt.c
gdb ./tt
b main
r
(gdb) p d
$1 = 4.9406564584124654e-324
(gdb) p l1
$2 = 4.9406564584124654417656879286822137e-324
(gdb) p l2
$3 = 0
(gdb) p l3
$4 = 0
(gdb) x/2gx &l2
0x600830 <l2>: 0x8000000000000000 0x0000000000000001
(gdb) x/2gx &l3
0x600840 <l3>: 0x8000000000000000 0x00000000000000c9
>From the above it seems that the long double value read from the vars is
somewhere in gdb internally cast to double, then probably cast back to long
double and printed (or goes through text representation or whatever), because
l2 and l3 definitely are not zero.
Also, it would be nice if p/x {d,l1,l2,l3} printed the double/long double vars
using ISO C99 hexadecimal notation (%a/%La for printf) and if hex float
literals could be used in gdb expressions.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
next reply other threads:[~2010-10-18 21:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-18 21:08 jakub at redhat dot com [this message]
2023-12-30 20:36 ` [Bug gdb/12134] " ssbssa at sourceware dot org
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=bug-12134-4717@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=gdb-prs@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).