diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2015-08-11 08:51:05 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2015-08-11 09:14:12 +0200 |
commit | 30379291886a171e6dc202122bc1c583318c2e17 (patch) | |
tree | 49b7398e2b12604f106f2407003db769236e4bbc /libiberty | |
parent | 125453567f4a0abc68cfc67a3df46be1aa9bb904 (diff) | |
download | gdb-30379291886a171e6dc202122bc1c583318c2e17.zip gdb-30379291886a171e6dc202122bc1c583318c2e17.tar.gz gdb-30379291886a171e6dc202122bc1c583318c2e17.tar.bz2 |
PR gdb/18669 libiberty demangle.test failure: strtod() on sparc-sun-solaris2.9
Test symbols did not demangle as per the d-demangle-expected tests because
strtod() on Solaris 9 does not accept hexadecimal numbers.
This has now been fixed up so that no attempt at formatting/converting the
demangled hexadecimal literals are done.
libiberty/ChangeLog:
2015-08-11 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_parse_real): Remove call to strtod.
(strtod): Remove declaration.
* testsuite/d-demangle-expected: Update float and complex literal
tests to check correct hexadecimal demangling.
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 7 | ||||
-rw-r--r-- | libiberty/d-demangle.c | 15 | ||||
-rw-r--r-- | libiberty/testsuite/d-demangle-expected | 22 |
3 files changed, 22 insertions, 22 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 99b20da..f2abfc9 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,10 @@ +2015-08-11 Iain Buclaw <ibuclaw@gdcproject.org> + + * d-demangle.c (dlang_parse_real): Remove call to strtod. + (strtod): Remove declaration. + * testsuite/d-demangle-expected: Update float and complex literal + tests to check correct hexadecimal demangling. + 2015-07-14 H.J. Lu <hongjiu.lu@intel.com> * configure: Regenerated. diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c index a2a3b32..3d7ccf6 100644 --- a/libiberty/d-demangle.c +++ b/libiberty/d-demangle.c @@ -28,7 +28,7 @@ If not, see <http://www.gnu.org/licenses/>. */ /* This file exports one function; dlang_demangle. - This file imports strtol and strtod for decoding mangled literals. */ + This file imports strtol for decoding mangled literals. */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -44,7 +44,6 @@ If not, see <http://www.gnu.org/licenses/>. */ #include <stdlib.h> #else extern long strtol (const char *nptr, char **endptr, int base); -extern double strtod (const char *nptr, char **endptr); #endif #include <demangle.h> @@ -970,8 +969,6 @@ dlang_parse_real (string *decl, const char *mangled) { char buffer[64]; int len = 0; - double value; - char *endptr; /* Handle NAN and +-INF. */ if (strncmp (mangled, "NAN", 3) == 0) @@ -1035,14 +1032,10 @@ dlang_parse_real (string *decl, const char *mangled) mangled++; } - /* Convert buffer from hexadecimal to floating-point. */ + /* Write out the demangled hexadecimal, rather than trying to + convert the buffer into a floating-point value. */ buffer[len] = '\0'; - value = strtod (buffer, &endptr); - - if (endptr == NULL || endptr != (buffer + len)) - return NULL; - - len = snprintf (buffer, sizeof(buffer), "%#g", value); + len = strlen (buffer); string_appendn (decl, buffer, len); return mangled; } diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected index 6c8ccdf..2b1cc4f 100644 --- a/libiberty/testsuite/d-demangle-expected +++ b/libiberty/testsuite/d-demangle-expected @@ -719,19 +719,19 @@ demangle.test!('\U000186a0') # --format=dlang _D8demangle17__T4testVde0A8P6Zv -demangle.test!(42.0000) +demangle.test!(0x0.A8p6) # --format=dlang _D8demangle16__T4testVdeA8P2Zv -demangle.test!(42.0000) +demangle.test!(0xA.8p2) # --format=dlang _D8demangle18__T4testVdeN0A8P6Zv -demangle.test!(-42.0000) +demangle.test!(-0x0.A8p6) # --format=dlang _D8demangle31__T4testVde0F6E978D4FDF3B646P7Zv -demangle.test!(123.456) +demangle.test!(0x0.F6E978D4FDF3B646p7) # --format=dlang _D8demangle15__T4testVdeNANZv @@ -747,27 +747,27 @@ demangle.test!(-Inf) # --format=dlang _D8demangle23__T4testVfe0FFFFFFP128Zv -demangle.test!(3.40282e+38) +demangle.test!(0x0.FFFFFFp128) # --format=dlang _D8demangle32__T4testVde0FFFFFFFFFFFFF8P1024Zv -demangle.test!(1.79769e+308) +demangle.test!(0x0.FFFFFFFFFFFFF8p1024) # --format=dlang _D8demangle19__T4testVfe08PN125Zv -demangle.test!(1.17549e-38) +demangle.test!(0x0.8p-125) # --format=dlang _D8demangle20__T4testVde08PN1021Zv -demangle.test!(2.22507e-308) +demangle.test!(0x0.8p-1021) # --format=dlang _D8demangle51__T4testVrc0C4CCCCCCCCCCCCCDP4c0B666666666666666P6Zv -demangle.test!(12.3000+45.6000i) +demangle.test!(0x0.C4CCCCCCCCCCCCCDp4+0x0.B666666666666666p6i) # --format=dlang _D8demangle52__T4testVrcN0C4CCCCCCCCCCCCCDP4c0B666666666666666P6Zv -demangle.test!(-12.3000+45.6000i) +demangle.test!(-0x0.C4CCCCCCCCCCCCCDp4+0x0.B666666666666666p6i) # --format=dlang _D8demangle22__T4testVG3ua3_616263Zv @@ -787,7 +787,7 @@ demangle.test!([1, 2, 3, 4]) # --format=dlang _D8demangle25__T4testVAdA2e08P1eN08P1Zv -demangle.test!([1.00000, -1.00000]) +demangle.test!([0x0.8p1, -0x0.8p1]) # --format=dlang _D8demangle23__T4testVHiiA2i1i2i3i4Zv |