diff options
author | obrien <obrien@FreeBSD.org> | 2002-02-22 04:18:42 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2002-02-22 04:18:42 +0000 |
commit | 670387a18a22cf299c750186efe8ca24cebb7e05 (patch) | |
tree | 70c0d6a941b83c97839ec1237622c20ea8beb870 /contrib/binutils/libiberty | |
parent | fc89183cdc6be5afa8deb7250fd15a20832ab528 (diff) | |
download | FreeBSD-src-670387a18a22cf299c750186efe8ca24cebb7e05.zip FreeBSD-src-670387a18a22cf299c750186efe8ca24cebb7e05.tar.gz |
Import of Binutils from the FSF 2.12 branch (pre-.0 release).
These bits are taken from the FSF anoncvs repo on 21-Feburary-2002 20:15 PST.
Diffstat (limited to 'contrib/binutils/libiberty')
-rw-r--r-- | contrib/binutils/libiberty/ChangeLog | 48 | ||||
-rwxr-xr-x | contrib/binutils/libiberty/configure | 2 | ||||
-rw-r--r-- | contrib/binutils/libiberty/configure.in | 2 | ||||
-rw-r--r-- | contrib/binutils/libiberty/cp-demangle.c | 31 | ||||
-rw-r--r-- | contrib/binutils/libiberty/cplus-dem.c | 7 |
5 files changed, 76 insertions, 14 deletions
diff --git a/contrib/binutils/libiberty/ChangeLog b/contrib/binutils/libiberty/ChangeLog index 59f48d45..08cf00d 100644 --- a/contrib/binutils/libiberty/ChangeLog +++ b/contrib/binutils/libiberty/ChangeLog @@ -1,3 +1,51 @@ +2002-02-05 Jason Merrill <jason@redhat.com> + + * cplus-dem.c (flags): Add DMGL_VERBOSE + (cplus_demangle_v3_p): Remove. + (demangle_it): Add DMGL_TYPES to passed flags. + * cp-demangle.c (cplus_demangle_v3_all): Remove. + (cplus_demangle_v3_type): Remove. + (cplus_demangle_v3): Add options parm. + +2002-02-02 H.J. Lu (hjl@gnu.org) + + * cp-demangle.c (cp_demangle_type): Do not protect with + IN_LIBGCC2. + (cplus_demangle_v3_all): New. + (cplus_demangle_v3): Call cplus_demangle_v3_all. + (cplus_demangle_v3_type): Call cplus_demangle_v3_all. + + * cplus-dem.c (cplus_demangle_v3_p): New function pointer. + Initialized to cplus_demangle_v3. + (cplus_demangle_with_style): Call cplus_demangle_v3_p instead + of cplus_demangle_v3. + (main): Set cplus_demangle_v3_p to cplus_demangle_v3_type for + command line symbol. + + * testsuite/regress-demangle: Pass the mangled name at the + command line. + +2002-02-01 H.J. Lu <hjl@gnu.org> + + * cp-demangle.c (cp_demangle_type): Call demangling_new with + DMGL_GNU_V3. + +2002-01-31 Phil Edwards <pme@gcc.gnu.org> + + * cp-demangle.c: Revert yesterday's change. + +2002-01-31 Adam Megacz <adam@xwt.org> + + * gcc/libiberty/configure.in: Treat mingw the same as cywin + wrt HAVE_SYS_ERRLIST. + +2002-01-30 Phil Edwards <pme@gcc.gnu.org> + + * cp-demangle.c (cp_demangle_type): Do not protect with IN_LIBGCC2. + (cplus_demangle_v3): Mimic __cxa_demangle and fall back on + cp_demangle_type. + * testsuite/demangle-expected: New gnu-v3 test. + 2002-01-22 Momchil Velikov <velco@fadata.bg> * configure.in (variable detection): Use arrays of unspecified diff --git a/contrib/binutils/libiberty/configure b/contrib/binutils/libiberty/configure index a406d28..84c10ad 100755 --- a/contrib/binutils/libiberty/configure +++ b/contrib/binutils/libiberty/configure @@ -2082,7 +2082,7 @@ fi case "${host}" in - *-*-cygwin*) + *-*-cygwin* | *-*-mingw*) cat >> confdefs.h <<\EOF #define HAVE_SYS_ERRLIST 1 EOF diff --git a/contrib/binutils/libiberty/configure.in b/contrib/binutils/libiberty/configure.in index eed222d..fb930e4 100644 --- a/contrib/binutils/libiberty/configure.in +++ b/contrib/binutils/libiberty/configure.in @@ -249,7 +249,7 @@ fi AC_SUBST(CHECK) case "${host}" in - *-*-cygwin*) + *-*-cygwin* | *-*-mingw*) AC_DEFINE_NOAUTOHEADER(HAVE_SYS_ERRLIST) AC_DEFINE_NOAUTOHEADER(HAVE_SYS_NERR) ;; diff --git a/contrib/binutils/libiberty/cp-demangle.c b/contrib/binutils/libiberty/cp-demangle.c index 457a09f..136dc72 100644 --- a/contrib/binutils/libiberty/cp-demangle.c +++ b/contrib/binutils/libiberty/cp-demangle.c @@ -938,10 +938,8 @@ static status_t demangle_discriminator PARAMS ((demangling_t, int)); static status_t cp_demangle PARAMS ((const char *, dyn_string_t, int)); -#ifdef IN_LIBGCC2 static status_t cp_demangle_type PARAMS ((const char*, dyn_string_t)); -#endif /* When passed to demangle_bare_function_type, indicates that the function's return type is not encoded before its parameter types. */ @@ -3533,14 +3531,13 @@ cp_demangle (name, result, style) dyn_string_t. On success, returns STATUS_OK. On failiure, returns an error message, and the contents of RESULT are unchanged. */ -#ifdef IN_LIBGCC2 static status_t cp_demangle_type (type_name, result) const char* type_name; dyn_string_t result; { status_t status; - demangling_t dm = demangling_new (type_name); + demangling_t dm = demangling_new (type_name, DMGL_GNU_V3); if (dm == NULL) return STATUS_ALLOCATION_FAILED; @@ -3571,6 +3568,7 @@ cp_demangle_type (type_name, result) return status; } +#ifdef IN_LIBGCC2 extern char *__cxa_demangle PARAMS ((const char *, char *, size_t *, int *)); /* ia64 ABI-mandated entry point in the C++ runtime library for performing @@ -3687,20 +3685,35 @@ __cxa_demangle (mangled_name, output_buffer, length, status) If the demangling failes, returns NULL. */ char * -cplus_demangle_v3 (mangled) +cplus_demangle_v3 (mangled, options) const char* mangled; + int options; { dyn_string_t demangled; status_t status; + int type = !!(options & DMGL_TYPES); - /* If this isn't a mangled name, don't pretend to demangle it. */ - if (strncmp (mangled, "_Z", 2) != 0) - return NULL; + if (mangled[0] == '_' && mangled[1] == 'Z') + /* It is not a type. */ + type = 0; + else + { + /* It is a type. Stop if we don't want to demangle types. */ + if (!type) + return NULL; + } + + flag_verbose = !!(options & DMGL_VERBOSE); /* Create a dyn_string to hold the demangled name. */ demangled = dyn_string_new (0); /* Attempt the demangling. */ - status = cp_demangle ((char *) mangled, demangled, 0); + if (!type) + /* Appears to be a function or variable name. */ + status = cp_demangle (mangled, demangled, 0); + else + /* Try to demangle it as the name of a type. */ + status = cp_demangle_type (mangled, demangled); if (STATUS_NO_ERROR (status)) /* Demangling succeeded. */ diff --git a/contrib/binutils/libiberty/cplus-dem.c b/contrib/binutils/libiberty/cplus-dem.c index 5af8826..4e60b2c 100644 --- a/contrib/binutils/libiberty/cplus-dem.c +++ b/contrib/binutils/libiberty/cplus-dem.c @@ -911,7 +911,7 @@ cplus_demangle (mangled, options) /* The V3 ABI demangling is implemented elsewhere. */ if (GNU_V3_DEMANGLING || AUTO_DEMANGLING) { - ret = cplus_demangle_v3 (mangled); + ret = cplus_demangle_v3 (mangled, work->options); if (ret || GNU_V3_DEMANGLING) return ret; } @@ -4874,7 +4874,7 @@ string_append_template_idx (s, idx) static const char *program_name; static const char *program_version = VERSION; -static int flags = DMGL_PARAMS | DMGL_ANSI; +static int flags = DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE; static void demangle_it PARAMS ((char *)); static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN; @@ -4887,7 +4887,8 @@ demangle_it (mangled_name) { char *result; - result = cplus_demangle (mangled_name, flags); + /* For command line args, also try to demangle type encodings. */ + result = cplus_demangle (mangled_name, flags | DMGL_TYPES); if (result == NULL) { printf ("%s\n", mangled_name); |