Commit Graph

5 Commits

Author SHA1 Message Date
Iain Buclaw 9d98de835c Sync libiberty with GCC.
libiberty/ChangeLog:
	* d-demangle.c (dlang_call_convention): Handle extern Objective-C
	function calling convention.
	(dlang_call_convention_p): Likewise.
	(dlang_type): Likewise.
	* testsuite/d-demangle-expected: Add coverage tests.

	* d-demangle.c (dlang_function_args): Append ',' for variadic functions
	only if parameters were seen before the elipsis symbol.
	* testsuite/d-demangle-expected: Add coverage test for parameter-less
	variadic functions.

	* d-demangle.c (dlang_type): Handle function types only in the context
	of seeing a pointer type symbol.
	* testsuite/d-demangle-expected: Update function pointer tests.
2016-01-28 21:44:42 +01:00
Iain Buclaw 3037929188 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.
2015-08-11 09:14:12 +02:00
Iain Buclaw f91ca6bc00 Sync libiberty from GCC, replaying updates to configure scripts 2015-06-24 21:43:02 +02:00
Joel Brobecker 5af04e20f6 Use strtod instead of strtold in libiberty/d-demangle.c
strtold is currently used to decode templates which have a floating-point
value encoded inside; but this routine is not available on some systems,
such as Solaris 2.9 for instance.

This patch fixes the issue by replace the use of strtold by strtod.
It reduces a bit the precision, but it should still remain acceptable
in most cases.

libiberty/ChangeLog:

        * d-demangle.c: Replace strtold with strtod in global comment.
        (strtold): Remove declaration.
        (strtod): New declaration.
        (dlang_parse_real): Declare value as double instead of long
        double.  Replace call to strtold by call to strtod.
        Update format in call to snprintf.
2014-10-16 14:52:17 -07:00
Iain Buclaw b55f967878 Sync libiberty with upstream GCC.
include/ChangeLog
	* libiberty.h (PEX_STDOUT_APPEND): New flag.
	(PEX_STDERR_APPEND): Likewise.

	* demangle.h (DMGL_DLANG): New macro.
	(DMGL_STYLE_MASK): Add DMGL_DLANG.
	(demangling_styles): Add dlang_demangling.
	(DLANG_DEMANGLING_STYLE_STRING): New macro.
	(DLANG_DEMANGLING): New macro.
	(dlang_demangle): New prototype.

	* longlong.h: Add __udiv_w_sdiv prototype.

libiberty/ChangeLog
	* cp-demangle.c (d_substitution): Handle abi tags on abbreviation.

	* pex-common.h (struct pex_funcs): Add new parameter for open_write field.
	* pex-unix.c (pex_unix_open_write): Add support for new parameter.
	* pex-djgpp.c (pex_djgpp_open_write): Likewise.
	* pex-win32.c (pex_win32_open_write): Likewise.
	* pex-common.c (pex_run_in_environment): Likewise.

	* Makefile.in (CFILES): Add d-demangle.c.
	(REQUIRED_OFILES): Add d-demangle.o.
	* cplus-dem.c (libiberty_demanglers): Add dlang_demangling case.
	(cplus_demangle): Likewise.
	* d-demangle.c: New file.
	* testsuite/Makefile.in (really-check): Add check-d-demangle.
	* testsuite/d-demangle-expected: New file.

	* simple-object-elf.c (simple_object_elf_write_ehdr): Correctly
	handle objects with more than SHN_LORESERVE sections.
	(simple_object_elf_write_shdr): Add sh_link parameter.
	(simple_object_elf_write_to_file): Correctly handle objects with
	more than SHN_LORESERVE sections.

	* cp-demangle.c (d_dump): Only access field from s_fixed part of
	the union for DEMANGLE_COMPONENT_FIXED_TYPE.
	(d_count_templates_scopes): Likewise.

	* testsuite/demangler-fuzzer.c: New file.
	* testsuite/Makefile.in (fuzz-demangler): New rule.
	(demangler-fuzzer): Likewise.
	(mostlyclean): Clean up demangler fuzzer.
2014-10-11 10:29:10 +01:00