Boost logo

Boost :

From: Florian Grafenberg (florian-grafenberg_at_[hidden])
Date: 2004-08-04 09:41:58


I don't really understand, MSVC also returns human readable strings from
type_info::name(), this string is then parsed by a boost::spirit parser
and is split up to have the ability to mangle it correctly. But as I
said I have problems in mangling template parameters, I don't get the
algorithm which is used to mangle that. Maybe someday I have much
inspiration and get behind the scheme ;-) . (the corrosponding symbol
for std::string is
"V?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@", I
don't know where the 2 comes from...)
What I meant to say is that the type_info string does not always
represent the type you've given in typeid(...), e.g. typeid(int const
&).name() returns "int", which is wrong (typeid(int const *) instead
returns "int *", somewhat strange).

The loader currently only works for MSVC and WIN32, but if gcc returns
mangled names from typeid the loading should be much easier to implement
for gcc compilers.

nico

>>I developed a fairly simple prototype of a dll loader which mangles
>>functions names automatically. But there are limitiations: you cannot
>>call function which have template class parameters or return value, e.g.
>>void test(std::string const &str) will not work. I do not get the
>>mangling scheme used to decorate such a type, maybe someone knows a good
>>source where I can look that up?!
>>For class mangling I use the string returned by type_info::name(), but
>>that seems very hacky. Microsoft Visual C++ does not always return
>>correct strings (e.g. typeid(int &).name() returns "int").
>>
>>
>
>Actually I think more compilers return "human readable" names from this that
>return mangled names - gcc is the only compiler I know of that does this.
>And of course nearly every C++ compiler uses it's own incompatible name
>mangling scheme as well...
>
>John.
>
>_______________________________________________
>Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
>
>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk