public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/18318] New: Printing an hexadecimal floating constant with negative exponent gives wrong result
@ 2015-04-24 13:38 olivier.gay at a3 dot epfl.ch
  2015-04-24 13:40 ` [Bug gdb/18318] " olivier.gay at a3 dot epfl.ch
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: olivier.gay at a3 dot epfl.ch @ 2015-04-24 13:38 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 18318
           Summary: Printing an hexadecimal floating constant with
                    negative exponent gives wrong result
           Product: gdb
           Version: 7.9
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: olivier.gay at a3 dot epfl.ch

Printing an hexadecimal floating constant with positive exponent is OK:

(gdb) p/f 0x00.1p0
$1 = 0.0625
(gdb) p/f 0x00.1p1
$2 = 0.125

but if the exponent is negative then the result is wrong:

(gdb) p/f 0x00.1p-1
$3 = -0.9375

The expected result is 0.031250.

Tested with gdb 7.9.

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


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

* [Bug gdb/18318] Printing an hexadecimal floating constant with negative exponent gives wrong result
  2015-04-24 13:38 [Bug gdb/18318] New: Printing an hexadecimal floating constant with negative exponent gives wrong result olivier.gay at a3 dot epfl.ch
@ 2015-04-24 13:40 ` olivier.gay at a3 dot epfl.ch
  2015-04-24 14:07 ` huguesdelassus at hotmail dot fr
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: olivier.gay at a3 dot epfl.ch @ 2015-04-24 13:40 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Olivier Gay <olivier.gay at a3 dot epfl.ch> ---
The question originally came from:
http://stackoverflow.com/questions/29846835/can-gdb-correcly-parse-c-style-hexadecimal-floating-point-numbers/29848357

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


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

* [Bug gdb/18318] Printing an hexadecimal floating constant with negative exponent gives wrong result
  2015-04-24 13:38 [Bug gdb/18318] New: Printing an hexadecimal floating constant with negative exponent gives wrong result olivier.gay at a3 dot epfl.ch
  2015-04-24 13:40 ` [Bug gdb/18318] " olivier.gay at a3 dot epfl.ch
@ 2015-04-24 14:07 ` huguesdelassus at hotmail dot fr
  2015-04-24 15:35 ` huguesdelassus at hotmail dot fr
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: huguesdelassus at hotmail dot fr @ 2015-04-24 14:07 UTC (permalink / raw)
  To: gdb-prs

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

Hugues de Lassus Saint-Geniès <huguesdelassus at hotmail dot fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |huguesdelassus at hotmail dot fr

-- 
You are receiving this mail because:
You are on the CC list for the bug.
>From gdb-prs-return-17941-listarch-gdb-prs=sources.redhat.com@sourceware.org Fri Apr 24 14:32:43 2015
Return-Path: <gdb-prs-return-17941-listarch-gdb-prs=sources.redhat.com@sourceware.org>
Delivered-To: listarch-gdb-prs@sources.redhat.com
Received: (qmail 113794 invoked by alias); 24 Apr 2015 14:32:42 -0000
Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id: <gdb-prs.sourceware.org>
List-Subscribe: <mailto:gdb-prs-subscribe@sourceware.org>
List-Archive: <http://sourceware.org/ml/gdb-prs/>
List-Post: <mailto:gdb-prs@sourceware.org>
List-Help: <mailto:gdb-prs-help@sourceware.org>, <http://sourceware.org/lists.html#faqs>
Sender: gdb-prs-owner@sourceware.org
Delivered-To: mailing list gdb-prs@sourceware.org
Received: (qmail 113771 invoked by uid 55); 24 Apr 2015 14:32:42 -0000
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug sim/18273] sim: various cppcheck warnings
Date: Fri, 24 Apr 2015 14:32:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gdb
X-Bugzilla-Component: sim
X-Bugzilla-Version: HEAD
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: cvs-commit at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: vapier at gentoo dot org
X-Bugzilla-Target-Milestone: 8.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-18273-4717-P5DDW8IG9s@http.sourceware.org/bugzilla/>
In-Reply-To: <bug-18273-4717@http.sourceware.org/bugzilla/>
References: <bug-18273-4717@http.sourceware.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://sourceware.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-q2/txt/msg00135.txt.bz2
Content-length: 670

https://sourceware.org/bugzilla/show_bug.cgi?id\x18273

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nick Clifton <nickc@sourceware.org>:

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

commit 63c72d1ae497cdf43db5347464a97164e720b83f
Author: Nick Clifton <nickc@redhat.com>
Date:   Fri Apr 24 15:31:36 2015 +0100

    Fix typo in check for valid register number in RX sim.

        PR sim/18273
        * reg.c (put_reg): Fix check for valid register number.

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


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

* [Bug gdb/18318] Printing an hexadecimal floating constant with negative exponent gives wrong result
  2015-04-24 13:38 [Bug gdb/18318] New: Printing an hexadecimal floating constant with negative exponent gives wrong result olivier.gay at a3 dot epfl.ch
  2015-04-24 13:40 ` [Bug gdb/18318] " olivier.gay at a3 dot epfl.ch
  2015-04-24 14:07 ` huguesdelassus at hotmail dot fr
@ 2015-04-24 15:35 ` huguesdelassus at hotmail dot fr
  2020-06-06 15:35 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: huguesdelassus at hotmail dot fr @ 2015-04-24 15:35 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Hugues de Lassus Saint-Geniès <huguesdelassus at hotmail dot fr> ---
I have encountered the same bug with explicitly positive exponents:

(gdb) p 0x1.8480000000000p+6
$1 = 7.517578125
(gdb) p 0x1.8480000000000p6
$2 = 97.125

-- 
You are receiving this mail because:
You are on the CC list for the bug.
>From gdb-prs-return-17947-listarch-gdb-prs=sources.redhat.com@sourceware.org Fri Apr 24 15:48:08 2015
Return-Path: <gdb-prs-return-17947-listarch-gdb-prs=sources.redhat.com@sourceware.org>
Delivered-To: listarch-gdb-prs@sources.redhat.com
Received: (qmail 78948 invoked by alias); 24 Apr 2015 15:48:08 -0000
Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id: <gdb-prs.sourceware.org>
List-Subscribe: <mailto:gdb-prs-subscribe@sourceware.org>
List-Archive: <http://sourceware.org/ml/gdb-prs/>
List-Post: <mailto:gdb-prs@sourceware.org>
List-Help: <mailto:gdb-prs-help@sourceware.org>, <http://sourceware.org/lists.html#faqs>
Sender: gdb-prs-owner@sourceware.org
Delivered-To: mailing list gdb-prs@sourceware.org
Received: (qmail 78921 invoked by uid 48); 24 Apr 2015 15:48:08 -0000
From: "qiyao at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug breakpoints/17768] GDB for ARM does not allow breakpoints on
 some addresses
Date: Fri, 24 Apr 2015 15:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gdb
X-Bugzilla-Component: breakpoints
X-Bugzilla-Version: 7.8
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: qiyao at gcc dot gnu.org
X-Bugzilla-Status: WAITING
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at sourceware dot org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cc
Message-ID: <bug-17768-4717-7MCm47eosq@http.sourceware.org/bugzilla/>
In-Reply-To: <bug-17768-4717@http.sourceware.org/bugzilla/>
References: <bug-17768-4717@http.sourceware.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://sourceware.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-q2/txt/msg00141.txt.bz2
Content-length: 1064

https://sourceware.org/bugzilla/show_bug.cgi?id\x17768

Yao Qi <qiyao at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING
                 CC|                            |qiyao at gcc dot gnu.org

--- Comment #6 from Yao Qi <qiyao at gcc dot gnu.org> ---
(In reply to Mark Manning from comment #5)
> Created attachment 8034 [details]
> attachment-28523-0.html
>
> actually, there is still something wrong, i set a breakpoint on address
> 0xnnnn and the breakpoint gets inserted somewhere else close by but within
> a few opcodes, not at the specified location.  I can not supply you with
> anything other than my executable and a description of how to reproduce the
> problem.

Can you show us the gdb session, including the gdb commands you typed and the
output.  Please point out which part isn't what you expected.

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


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

* [Bug gdb/18318] Printing an hexadecimal floating constant with negative exponent gives wrong result
  2015-04-24 13:38 [Bug gdb/18318] New: Printing an hexadecimal floating constant with negative exponent gives wrong result olivier.gay at a3 dot epfl.ch
                   ` (2 preceding siblings ...)
  2015-04-24 15:35 ` huguesdelassus at hotmail dot fr
@ 2020-06-06 15:35 ` tromey at sourceware dot org
  2020-06-11 16:35 ` cvs-commit at gcc dot gnu.org
  2020-06-11 16:37 ` tromey at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2020-06-06 15:35 UTC (permalink / raw)
  To: gdb-prs

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

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 #3 from Tom Tromey <tromey at sourceware dot org> ---
I have a patch.  It was a bug in the C lexer.

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

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

* [Bug gdb/18318] Printing an hexadecimal floating constant with negative exponent gives wrong result
  2015-04-24 13:38 [Bug gdb/18318] New: Printing an hexadecimal floating constant with negative exponent gives wrong result olivier.gay at a3 dot epfl.ch
                   ` (3 preceding siblings ...)
  2020-06-06 15:35 ` tromey at sourceware dot org
@ 2020-06-11 16:35 ` cvs-commit at gcc dot gnu.org
  2020-06-11 16:37 ` tromey at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-11 16:35 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 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=2b4e6a3f4b66284556254f548716c7b21b93524a

commit 2b4e6a3f4b66284556254f548716c7b21b93524a
Author: Tom Tromey <tom@tromey.com>
Date:   Thu Jun 11 10:34:31 2020 -0600

    Fix hex floating point lexing

    PR gdb/18318 notes that gdb will sometimes incorrectly handle hex
    floating point input.  This turns out to be a bug in the C lexer; the
    'p' was not being correctly recognized, and so the exponent was not
    always passed to the floating point "from_string" method.

    Tested by the buildbot "Fedora-x86_64-m64" builder.

    gdb/ChangeLog
    2020-06-11  Tom Tromey  <tom@tromey.com>

            PR gdb/18318:
            * c-exp.y (lex_one_token): Handle 'p' like 'e'.

    gdb/testsuite/ChangeLog
    2020-06-11  Tom Tromey  <tom@tromey.com>

            PR gdb/18318:
            * gdb.base/printcmds.exp (test_float_accepted): Add more hex
            floating point tests.

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

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

* [Bug gdb/18318] Printing an hexadecimal floating constant with negative exponent gives wrong result
  2015-04-24 13:38 [Bug gdb/18318] New: Printing an hexadecimal floating constant with negative exponent gives wrong result olivier.gay at a3 dot epfl.ch
                   ` (4 preceding siblings ...)
  2020-06-11 16:35 ` cvs-commit at gcc dot gnu.org
@ 2020-06-11 16:37 ` tromey at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2020-06-11 16:37 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #5 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] 7+ messages in thread

end of thread, other threads:[~2020-06-11 16:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-24 13:38 [Bug gdb/18318] New: Printing an hexadecimal floating constant with negative exponent gives wrong result olivier.gay at a3 dot epfl.ch
2015-04-24 13:40 ` [Bug gdb/18318] " olivier.gay at a3 dot epfl.ch
2015-04-24 14:07 ` huguesdelassus at hotmail dot fr
2015-04-24 15:35 ` huguesdelassus at hotmail dot fr
2020-06-06 15:35 ` tromey at sourceware dot org
2020-06-11 16:35 ` cvs-commit at gcc dot gnu.org
2020-06-11 16:37 ` 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).