Commit graph

58 commits

Author SHA1 Message Date
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
Andrew Burgess
173373c6f6 Delete temporary string within demangler even in failure cases.
A call to demangle_template might allocate storage within a temporary
string even if the call to demangle_template eventually returns
failure.

This will never cause the demangler to crash, but does leak memory, as
a result I've not added any tests for this.

Calling string_delete is safe, even if nothing is allocated into the
string, the string is initialised with string_init, so we know the
internal pointers are NULL.

libiberty/ChangeLog

	* cplus-dem.c (do_type): Call string_delete even if the call to
	demangle_template fails.
2014-06-11 11:41:51 +01:00
Andrew Burgess
0aaa9a3aa1 cplus-demangler, free resource after a failed call to gnu_special.
libiberty/
2014-05-14  Andrew Burgess  <aburgess@broadcom.com>

	* cplus-dmem.c (internal_cplus_demangle): Free any resources
	allocated by possible previous call to gnu_special.
	(squangle_mop_up): Reset pointers to NULL after calling free.
	* testsuite/demangle-expected: New test case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210425 138bc75d-0d04-0410-961f-82ee72b054a4
2014-05-28 23:06:43 +01:00
DJ Delorie
4ff224cb8d merge from gcc 2011-04-20 19:06:46 +00:00
DJ Delorie
d0f0b69d10 merge from gcc 2011-03-25 16:38:27 +00:00
Michael Snyder
12f23c24fa 2011-03-04 Michael Snyder <msnyder@vmware.com>
* cplus-dem.c (ada_demangle): Stop memory leak.
	Also fix a one line indent problem.
2011-03-04 18:25:32 +00:00
DJ Delorie
59e11e1703 merge from gcc 2011-01-03 21:05:58 +00:00
DJ Delorie
6a44904e97 merge from gcc 2010-09-27 21:01:18 +00:00
DJ Delorie
6d390a9ef0 merge from gcc 2010-01-11 19:12:47 +00:00
DJ Delorie
572771db36 merge from gcc 2009-09-23 17:59:27 +00:00
DJ Delorie
6b357a9d2d merge from gcc 2008-03-13 19:13:36 +00:00
Ben Elliston
b4b41ceb4a 2008-01-23 Thiago Jung Bauermann <bauerman@br.ibm.com>
* cplus-dem.c (demangle_function_name): Changed to return value
	indicating if a name was correctly demangled.
	(iterate_demangle_function): Use demangle_function_name return
	value.
2008-01-23 05:12:47 +00:00
DJ Delorie
f6b66e9075 merge from gcc 2006-05-12 20:00:37 +00:00
DJ Delorie
abf6a75b42 merge from gcc 2005-05-24 21:01:33 +00:00
Nick Clifton
979c05d324 Update the address and phone number of the FSF organization. 2005-05-10 15:33:34 +00:00
DJ Delorie
9334f9c6cd merge from gcc 2005-03-27 05:28:42 +00:00
DJ Delorie
eb129e357a merge from gcc 2004-11-24 03:00:34 +00:00
DJ Delorie
820542c970 merge from gcc 2004-01-02 21:11:34 +00:00
Joel Brobecker
eec65ede89 * cplus-dem.c (demangle_template): Register a new Btype only
when needed.
	* testsuite/demangle-expected: Add a new test.
2003-10-20 23:50:37 +00:00
DJ Delorie
d8cbbf95b2 merge from gcc 2003-03-11 20:18:26 +00:00
DJ Delorie
a01fefebab merge from gcc 2003-03-04 03:02:50 +00:00
DJ Delorie
25dfe0ac20 merge from gcc 2003-02-20 21:05:37 +00:00
DJ Delorie
fcd7c7c9fd merge from gcc 2003-02-13 18:52:46 +00:00
DJ Delorie
0d3deb8deb merge from gcc 2002-10-06 20:21:01 +00:00
DJ Delorie
585cc78f65 merge from gcc 2002-09-20 13:45:20 +00:00
DJ Delorie
a54ba43fe9 merge from gcc 2002-09-12 01:11:29 +00:00
DJ Delorie
1e3f0be004 merge from gcc 2002-07-29 18:01:19 +00:00
DJ Delorie
59ea9fe7b6 merge from gcc 2002-02-19 21:01:40 +00:00
DJ Delorie
6f84855018 merge from gcc 2002-02-18 23:01:39 +00:00
DJ Delorie
44354ae183 merge from gcc 2002-02-05 17:53:17 +00:00
DJ Delorie
42da15d6b3 merge from gcc 2002-02-03 13:12:45 +00:00
DJ Delorie
c23795e245 merge from gcc 2002-01-03 00:25:57 +00:00
DJ Delorie
20d54542b9 merge from gcc 2002-01-02 18:01:38 +00:00
DJ Delorie
ae53364610 merge from gcc 2001-12-13 00:05:32 +00:00
Richard Henderson
2da4c07f1c * demangle.h (no_demangling): New.
(NO_DEMANGLING_STYLE_STRING): New.

        * cplus-dem.c (libiberty_demanglers): Add no_demangling case.
        (cplus_demangle): Support no_demangling.
2001-12-06 21:57:28 +00:00
DJ Delorie
5d852400e9 merge from gcc 2001-10-17 22:35:28 +00:00
DJ Delorie
e6450fe561 merge from gcc 2001-10-07 17:24:36 +00:00
DJ Delorie
a9cbbe6d3e merge from gcc 2001-03-20 17:09:17 +00:00
DJ Delorie
5810f3948f merge from gcc 2001-03-05 19:42:04 +00:00
DJ Delorie
a9db032a7a merge from gcc 2001-02-17 00:11:29 +00:00
DJ Delorie
bc9bf2596e merge from gcc 2001-02-02 18:58:51 +00:00
DJ Delorie
ac424eb32c * safe-ctype.c: New file.
* Makefile.in (CFILES): Add safe-ctype.c.
(REQUIRED_OFILES): Add safe-ctype.o.

* argv.c: Define ISBLANK and use it, not isspace.
* basename.c, cplus-dem.c, fnmatch.c, pexecute.c, strtod.c,
strtol.c, strtoul.c: Include safe-ctype.h, not ctype.h.  Use
uppercase ctype macros.  Don't test ISUPPER(c)/ISLOWER(c)
before calling TOLOWER(c)/TOUPPER(c).
2000-12-08 16:37:01 +00:00
DJ Delorie
e49a569c10 * cp-demangle.c: s/new_abi/v3/.
* cplus-dem.c: Likewise.
(current_demangling_style): Now auto_demangling.
(cplus_demangle): Try v3 demangling if AUTO_DEMANGLING.
(main): Use standard symbol chars for auto_demangling.
2000-12-05 16:51:29 +00:00
Hans-Peter Nilsson
9c26dc82b6 * cplus-dem.c (main): Handle gnat_demangling. 2000-11-23 00:08:38 +00:00
Hans-Peter Nilsson
f17755262c * cplus-dem.c (cplus_demangle): Fix formatting.
(grow_vect): Ditto.
	(ada_demangle): Ditto.
	(internal_cplus_demangle): Ditto.
	(mop_up): Ditto.

	* cplus-dem.c (main): Handle java_demangling.

	* cplus-dem.c (grow_vect): Prototype.
	(ada_demangle): Cast the arg of ctype macros to unsigned char.
2000-11-21 10:54:08 +00:00
Hans-Peter Nilsson
5dd42ef455 * cplus-dem.c (ada_demangle): Add back ATTRIBUTE_UNUSED for
parameter `option'.
Do s/cplus_dem.c/cplus-dem.c/g on ChangeLog.
2000-11-16 09:07:59 +00:00
DJ Delorie
296731c177 [merge]
* cplus_dem.c: Eliminate use of DEFUN, it is obsolete and cannot
be used in GCC.
2000-11-15 19:10:20 +00:00
Hans-Peter Nilsson
16e857458e * cplus_dem.c: Add gnat demangler. Add java to demangle style
list.
2000-11-15 11:50:21 +00:00
DJ Delorie
74bcd5294f merge from gcc repository 2000-10-12 02:16:48 +00:00
Hans-Peter Nilsson
d3e8500506 * testsuite/demangle-expected: Add two tests for anonymous
namespaces.
	* cplus-dem.c (gnu_special): Handle anonymous namespaces.
2000-09-13 22:59:40 +00:00