[Dcmlib] [Fwd: [Insight-users] itk::LightObject::PrintSelf and name demangling

Mathieu Malaterre mathieu.malaterre at kitware.com
Wed Dec 22 16:14:26 CET 2004


Yo,

   Ce mail est pour moi pour plus tard. J'ai virer le name demangling de gdcm vu qu'il petait d'une version de gcc a l'autre visiblement ce lien devrait m'aider a ecrire une version cross-gcc :p

Mathieu


> Hello list,
> When using type_info::name and g++, the names of the objects are not
> correctly demangled (see [1] for examples). In version 3.1 of gcc, a new
> ABI function was exposed, which allows to demangle the names. 
> I think it would be nice to use this kind of demangling in
> itk::LightObject::PrintSelf, so that the RTTI information is human
> readable. 
> In [2], you'll find a small function that returns the demangled name if
> (1) we're using gcc > 3.1 and (2) the demangling succeeds. Otherwise,
> the raw result of std::type_info::name is used. This function can easily
> be put inside itk::LightObject::PrintSelf (actually, I've done it on my
> version) and does not seem to have any drawback. Should it be submitted
> on ITK's CVS, and if so, how can I do it ?
> 
> It has been tested with gcc versions 2.95.4, 3.3.4 and 3.4.2 on a
> Linux/i386.
> 
> [1] http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#5
> [2] https://dpt-info.u-strasbg.fr/~lamy/demangle.html
> -- 
> Julien Lamy <julien.lamy at ircad.u-strasbg.fr>
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 





More information about the Dcmlib mailing list