This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cli/1934: Valid floating point numbers are printed as NaN


>Number:         1934
>Category:       cli
>Synopsis:       Valid floating point numbers are printed as NaN
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon May 02 16:18:01 UTC 2005
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Greenberg
>Release:        GNU gdb 6.1 (arm-elf-gdb)
>Organization:
>Environment:
arm-elf-gdb GNU gdb 6.1 (This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-elf".)
Both tools from current (2005/05/02) build of the "GNU ARM toolsuite" from http://www.gnuarm.org/.
Running on Debian Linux 2.6.8-2-686 ("testing").
>Description:
Running the command "p (exp)" in gdb where (exp) is a double floating point number is sometimes incorrectly displayed as "NaN".

For example:

  (gdb) p 1.19209289550781e-7
  $2 = -nan(0xfffed3e7fffff)
  (gdb) p 1.13686837721616e-13
  $3 = -nan(0xffffd3d3fffff)
  (gdb) p 1.16415321826935E-10
  $4 = 1.16415321826935e-10

The first two examples show gdb displaying "NaN", but the hexadecimal values in the parentheses are valid IEEE 751 values with the value specified in the "p" comment. Note that it's ARM, so the bytes are little endian (could this be the problem?).

In the last example, you can see that it does sometimes work - in fact, it usually works, and only some doubles have this problem.

Thanks for all your work! Couldn't do a thing without gdb :)
Andrew
>How-To-Repeat:
1. "arm-elf-gdb".
2. "p 4.65661287307739e-10".
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]