[PATCH 2/2] msvcrt: Demangle a C++ mangled string that is only a
name with it's template argument list. Fixes bug 7885.
Michael Stefaniuc
mstefani at redhat.de
Thu Apr 5 17:50:06 CDT 2007
---
dlls/msvcrt/tests/cpp.c | 3 +++
dlls/msvcrt/undname.c | 9 +++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c
index 1d43502..370a348 100644
--- a/dlls/msvcrt/tests/cpp.c
+++ b/dlls/msvcrt/tests/cpp.c
@@ -975,6 +975,9 @@ static void test_demangle(void)
{"??0aa$_3a@@QAE at XZ", "public: __thiscall aa$_3a::aa$_3a(void)"},
{"??2?$aaa at AAUbbb@@AAUccc@@AAU2@@ddd at 1eee@2 at QAEHXZ", "public: int __thiscall eee::eee::ddd::ddd::aaa<struct bbb &,struct ccc &,struct ccc &>::operator new(void)"},
{"?pSW@@3P6GHKPAX0PAU_tagSTACKFRAME@@0P6GH0K0KPAK at ZP6GPAX0K@ZP6GK0K at ZP6GK00PAU_tagADDRESS@@@Z at ZA", "int (__stdcall* pSW)(unsigned long,void *,void *,struct _tagSTACKFRAME *,void *,int (__stdcall*)(void *,unsigned long,void *,unsigned long,unsigned long *),void * (__stdcall*)(void *,unsigned long),unsigned long (__stdcall*)(void *,unsigned long),unsigned long (__stdcall*)(void *,void *,struct _tagADDRESS *))"},
+{"?$_aaa at Vbbb@@", "_aaa<class bbb>"},
+{"??$_aaa at Vbbb@@", "??$_aaa at Vbbb@@"},
+{"?$aaa at Vbbb@ccc@@Vddd at 2@", "aaa<class ccc::bbb,class ccc::ddd>"},
};
int i, num_test = (sizeof(test)/sizeof(test[0]));
char* name;
diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c
index c266686..84423d9 100644
--- a/dlls/msvcrt/undname.c
+++ b/dlls/msvcrt/undname.c
@@ -1157,6 +1157,15 @@ static BOOL symbol_demangle(struct parsed_symbol* sym)
}
sym->stack.start = 1;
}
+ else if (*sym->current == '$')
+ {
+ /* Strange construct, it's a name with a template argument list
+ and that's all. */
+ sym->current++;
+ sym->result = get_template_name(sym);
+ ret = TRUE;
+ goto done;
+ }
/* Either a class name, or '@' if the symbol is not a class member */
if (*sym->current != '@')
--
1.5.0.6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070406/cf5d1664/attachment.pgp
More information about the wine-patches
mailing list