Libiberty demangling - new demangler - expected behaviour

Phil Lello phil.lello@homecall.co.uk
Sun Oct 1 15:59:00 GMT 2006


Hi,

I'm adding support from MSVC-style mangling to libiberty, mostly so that
objdump demangles imports/exports.

Before I go much further along this route, I just want to confirm that my
planned implementation works the way (most) people expect it to. Please let
me know if you disagree with my decisions.

The relevant options (from demangle.h) for cplus_demangle are:
#define DMGL_NO_OPTS     0              /* For readability... */
#define DMGL_PARAMS      (1 << 0)       /* Include function args */
#define DMGL_ANSI        (1 << 1)       /* Include const, volatile, etc */
#define DMGL_VERBOSE     (1 << 3)       /* Include implementation details.
*/
#define DMGL_TYPES       (1 << 4)       /* Also try to demangle type
encodings.  */
#define DMGL_RET_POSTFIX (1 << 5)       /* Print function return types (when
                                           present) after function signature
*/

Using the mangled symbol 
- ?CreateInstance@CTmProxyCore@@SGJPAPAV1@PAUIUnknown@@@Z
(from C:\WINDOWS\$hf_mig$\KB902400\SP2QFE\msdtcprx.dll)
the OS decoded version (UnDecorateSymbolName in DBGHLP.DLL) is
- public: static long __stdcall CTmProxyCore::CreateInstance(class
CTmProxyCore * *,struct IUnknown *)

So cplus_demangle output should be:

DMGL_NO_OPTS
 CTmProxyCore::CreateInstance
DMGL_PARAMS
 CTmProxyCore::CreateInstance(class CTmProxyCore * *,struct IUnknown *)
DMGL_ANSI
 static CTmProxyCore::CreateInstance
DMGL_VERBOSE
 public: static __stdcall CTmProxyCore::CreateInstance
DMGL_TYPES
 long CTmProxyCore::CreateInstance
DMGL_RET_POSTFIX
 CTmProxyCore::CreateInstance long

Thanks,

Phil Lello

P.S. I have returned my Copyright Assignment form, hopefully this should
arrive and be processed some time next week.



More information about the Binutils mailing list