This is the mail archive of the gdb-prs@sourceware.org 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]

server/2134: failed in type convert from double to float


>Number:         2134
>Category:       server
>Synopsis:       failed in type convert from double to float
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 12 04:48:01 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Dongmin Zhang
>Release:        gdb 6.4
>Organization:
>Environment:
Linux zpc26.corp.google.com 2.6.12.2-gg1_64smp #1 SMP Thu Jul 14 11:17:10 PDT 2005 x86_64 x86_64 x86_64 GNU/Linux
>Description:
gdbserver failed to convert the return value of strtod to float. If I assign the return value of strtod to a float, I got -nan(0x400000).
>How-To-Repeat:
1) Compile test.cc to a 64-bit executable, tt. 
2) On the server side, run: gdbserver foo:1234 tt
3) On client side, run: x86_64-unknown-linux-gnu-gdb ./tt
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=x86_64-unknown-linux-gnu"...
(gdb) target remote HOSTIP:1234
Remote debugging using HOSTIP:1234
0x0000000000018160 in _start ()
(gdb) break main
(gdb) cont
(gdb) break test.cc:12
(gdb) c
(gdb)12        float b = strtod(s.c_str(), &end);
(gdb) n
13        cout << b << endl;
(gdb) print b
$2 = -nan(0x400000)


Also the server sice print out 
100
nan

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.cc"

I2luY2x1ZGUgPHN0ZGxpYi5oPg0KI2luY2x1ZGUgPGlvc3RyZWFtPg0KDQp1c2luZyBuYW1lc3Bh
Y2Ugc3RkOw0KDQppbnQgbWFpbigpIHsNCiAgc3RyaW5nIHMoIjEwMCIpOw0KICBjaGFyICplbmQ7
DQogIGRvdWJsZSBhID0gc3RydG9kKHMuY19zdHIoKSwgJmVuZCk7DQogIGNvdXQgPDwgYSA8PCBl
bmRsOw0KDQogIGZsb2F0IGIgPSBzdHJ0b2Qocy5jX3N0cigpLCAmZW5kKTsNCiAgY291dCA8PCBi
IDw8IGVuZGw7DQoNCiAgZmxvYXQgYjEgPSBzdHJ0b2Qocy5jX3N0cigpLCAmZW5kKTsNCiAgY291
dCA8PCBiMSA8PCBlbmRsOw0KDQogIGZsb2F0IGMgPSBzdHJ0b2Yocy5jX3N0cigpLCAmZW5kKTsN
CiAgY291dCA8PCBjIDw8IGVuZGw7DQoNCiAgcmV0dXJuIDA7DQp9DQo=


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