Public bug reported: Trying to print a hexadecimal floating-point number evaluates to a wrong double. This makes fp-based programs harder to debug. In the example below, the parser seems to recognize 0xa.op as (double)10 and 4 as an int, and a subtraction '-', thus the result '6'.
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) print /f 0xa.0p-4 $1 = 6 ProblemType: Bug DistroRelease: Ubuntu 14.04 Package: gdb 7.7.1-0ubuntu5~14.04.2 ProcVersionSignature: Ubuntu 3.13.0-49.83-generic 3.13.11-ckt17 Uname: Linux 3.13.0-49-generic x86_64 NonfreeKernelModules: wl ApportVersion: 2.14.1-0ubuntu3.10 Architecture: amd64 CurrentDesktop: Unity Date: Fri Apr 24 15:43:39 2015 InstallationDate: Installed on 2014-11-06 (168 days ago) InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2) SourcePackage: gdb UpgradeStatus: No upgrade log present (probably fresh install) ** Affects: gdb (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-bug trusty -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1448146 Title: GDB cannot evaluate hexadecimal floating-point numbers with negative exponent To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1448146/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs