Alexandre Julliard : msvcrt: Add support for template operators in symbol demangling.
Alexandre Julliard
julliard at winehq.org
Mon May 16 11:36:45 CDT 2011
Module: wine
Branch: master
Commit: 5d12e970ff640a2c92a0fb31324ccc565e97f306
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5d12e970ff640a2c92a0fb31324ccc565e97f306
Author: Alexandre Julliard <julliard at winehq.org>
Date: Sat May 14 16:19:33 2011 +0200
msvcrt: Add support for template operators in symbol demangling.
---
dlls/msvcrt/tests/cpp.c | 3 +++
dlls/msvcrt/undname.c | 19 ++++++++++++++++++-
2 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c
index b4eb515..8d0dbd4 100644
--- a/dlls/msvcrt/tests/cpp.c
+++ b/dlls/msvcrt/tests/cpp.c
@@ -1053,6 +1053,9 @@ static void test_demangle(void)
/* 118 */ {"?swprintf@@YAHPA_WIPB_WZZ", "int __cdecl swprintf(wchar_t *,unsigned int,wchar_t const *,...)"},
/* 119 */ {"??Xstd@@YAAEAV?$complex at M@0 at AEAV10@AEBV10@@Z", "class std::complex<float> & __ptr64 __cdecl std::operator*=(class std::complex<float> & __ptr64,class std::complex<float> const & __ptr64)"},
/* 120 */ {"?_Doraise at bad_cast@std@@MEBAXXZ", "protected: virtual void __cdecl std::bad_cast::_Doraise(void)const __ptr64"},
+/* 121 */ {"??$?DM at std@@YA?AV?$complex at M@0 at ABMABV10@@Z",
+ "class std::complex<float> __cdecl std::operator*<float>(float const &,class std::complex<float> const &)",
+ "??$?DM at std@@YA?AV?$complex at M@0 at ABMABV10@@Z"},
};
int i, num_test = (sizeof(test)/sizeof(test[0]));
diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c
index 8ed0757..9c24f4a 100644
--- a/dlls/msvcrt/undname.c
+++ b/dlls/msvcrt/undname.c
@@ -1238,10 +1238,16 @@ static BOOL symbol_demangle(struct parsed_symbol* sym)
sym->current++;
/* Then function name or operator code */
- if (*sym->current == '?' && sym->current[1] != '$')
+ if (*sym->current == '?' && (sym->current[1] != '$' || sym->current[2] == '?'))
{
const char* function_name = NULL;
+ if (sym->current[1] == '$')
+ {
+ do_after = 6;
+ sym->current += 2;
+ }
+
/* C++ operator code (one character, or two if the first is '_') */
switch (*++sym->current)
{
@@ -1374,6 +1380,17 @@ static BOOL symbol_demangle(struct parsed_symbol* sym)
sym->result = (char*)function_name;
ret = TRUE;
goto done;
+ case 6:
+ {
+ char *args;
+ struct array array_pmt;
+
+ str_array_init(&array_pmt);
+ args = get_args(sym, &array_pmt, FALSE, '<', '>');
+ if (args != NULL) function_name = str_printf(sym, "%s%s", function_name, args);
+ sym->names.num = 0;
+ }
+ /* fall through */
default:
if (!str_array_push(sym, function_name, -1, &sym->stack))
return FALSE;
More information about the wine-cvs
mailing list