This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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]

Re: RFA: strip stdcall suffixes under Cygwin


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


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