This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: strip stdcall suffixes under Cygwin
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Jim Blandy <jimb at redhat dot com>
- Cc: Chris Faylor <cgf at redhat dot com>, gdb-patches at sources dot redhat dot com
- Date: Wed, 27 Mar 2002 18:49:04 -0500
- Subject: Re: RFA: strip stdcall suffixes under Cygwin
- References: <20020327233525.1164E5EA11@zwingli.cygnus.com>
On Wed, Mar 27, 2002 at 06:35:25PM -0500, Jim Blandy wrote:
>
> Chris, I think I need your approval for this.
>
> 2002-03-27 Jim Blandy <jimb@redhat.com>
>
> * config/i386/tm-cygwin.h: #define
> LINKER_SYMBOLS_HAVE_WIN32_STDCALL_ARG_SIZES.
> * symtab.c (LINKER_SYMBOLS_HAVE_WIN32_STDCALL_ARG_SIZES): Provide
> default #definition here, if tm-*.h file doesn't have one.
> (symbol_init_mangled_name): If the above is #defined, strip off
> the stdcall arg size, if present, from linker symbol names before
> trying to demangle them.
> + if (LINKER_SYMBOLS_HAVE_WIN32_STDCALL_ARG_SIZES)
> + {
> + char *arg_byte_suffix = strchr (mangled, '@');
> + if (arg_byte_suffix)
> + {
> + int prefix_len = arg_byte_suffix - mangled;
> + char *mangled_sans_suffix = alloca (prefix_len + 1);
> + memcpy (mangled_sans_suffix, mangled, prefix_len);
> + mangled_sans_suffix[prefix_len] = '\0';
> +
> + mangled = mangled_sans_suffix;
> + }
> + }
> +
Perhaps verify that you are stripping off a number?
(ELF uses @ for representing symbol versions also.)
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer