This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

PING: PATCH: PR other/42602: demangler doesn't completely demangle a global constructors symbol


Ping.

H.J.
----
On Sat, Jan 9, 2010 at 10:42 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Hi,
>
> demangler doesn't completely demangle a global constructor/distructor
> symbol. ?This patch fixes it. ?OK for trunk?
>
> Thanks.
>
>
> H.J.
> ---
> 2010-01-09 ?H.J. Lu ?<hongjiu.lu@intel.com>
>
> ? ? ? ?PR other/42602
> ? ? ? ?* cp-demangle.c (d_make_demangle_mangled_name): New.
> ? ? ? ?(d_demangle_callback): Use it on DCT_GLOBAL_XTORS.
>
> ? ? ? ?* testsuite/demangle-expected: Updated.
>
> diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
> index 43cf34a..878aeae 100644
> --- a/libiberty/cp-demangle.c
> +++ b/libiberty/cp-demangle.c
> @@ -320,6 +320,9 @@ static struct demangle_component *
> ?d_make_name (struct d_info *, const char *, int);
>
> ?static struct demangle_component *
> +d_make_demangle_mangled_name (struct d_info *, const char *, int);
> +
> +static struct demangle_component *
> ?d_make_builtin_type (struct d_info *,
> ? ? ? ? ? ? ? ? ? ? ?const struct demangle_builtin_type_info *);
>
> @@ -864,6 +867,17 @@ d_make_comp (struct d_info *di, enum demangle_component_type type,
> ? return p;
> ?}
>
> +/* Add a new demangle mangled name component. ?*/
> +
> +static struct demangle_component *
> +d_make_demangle_mangled_name (struct d_info *di, const char *s, int len)
> +{
> + ?if (d_peek_char (di) != '_' || d_peek_next_char (di) != 'Z')
> + ? ?return d_make_name (di, s, len);
> + ?d_advance (di, 2);
> + ?return d_encoding (di, 0);
> +}
> +
> ?/* Add a new name component. ?*/
>
> ?static struct demangle_component *
> @@ -4728,7 +4742,8 @@ d_demangle_callback (const char *mangled, int options,
> ? ? ? ? ? ? ? ? ? ? ? ? ?(type == DCT_GLOBAL_CTORS
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS
> ? ? ? ? ? ? ? ? ? ? ? ? ? : DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS),
> - ? ? ? ? ? ? ? ? ? ? ? ? d_make_name (&di, d_str (&di), strlen (d_str (&di))),
> + ? ? ? ? ? ? ? ? ? ? ? ? d_make_demangle_mangled_name (&di, d_str (&di),
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? strlen (d_str (&di))),
> ? ? ? ? ? ? ? ? ? ? ? ? ?NULL);
> ? ? ? ?d_advance (&di, strlen (d_str (&di)));
> ? ? ? ?break;
> diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
> index 6798154..578da62 100644
> --- a/libiberty/testsuite/demangle-expected
> +++ b/libiberty/testsuite/demangle-expected
> @@ -3595,8 +3595,8 @@ std::_Alloc_traits<std::basic_string<char, std::string_char_traits<char>, libcw:
> ?#
> ?--format=gnu-v3 --no-params
> ?_GLOBAL__I__Z2fnv
> -global constructors keyed to _Z2fnv
> -global constructors keyed to _Z2fnv
> +global constructors keyed to fn()
> +global constructors keyed to fn()
> ?#
> ?--format=gnu-v3 --no-params
> ?_Z1rM1GFivEMS_KFivES_M1HFivES1_4whatIKS_E5what2IS8_ES3_
>



-- 
H.J.


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