Commit 9c6a15ce authored by Vijay Kiran Kamuju's avatar Vijay Kiran Kamuju Committed by Alexandre Julliard

Fix msvcrt symbol demangling for non MS symbols.

parent 3eb08c44
...@@ -117,6 +117,10 @@ static type_info* (*p__RTtypeid)(void*); ...@@ -117,6 +117,10 @@ static type_info* (*p__RTtypeid)(void*);
static void* (*p__RTCastToVoid)(void*); static void* (*p__RTCastToVoid)(void*);
static void* (*p__RTDynamicCast)(void*,int,void*,void*,int); static void* (*p__RTDynamicCast)(void*,int,void*,void*,int);
/*Demangle*/
static char* (*p__unDName)(char*,const char*,int,void*,void*,unsigned short int);
/* _very_ early native versions have serious RTTI bugs, so we check */ /* _very_ early native versions have serious RTTI bugs, so we check */
static void* bAncientVersion; static void* bAncientVersion;
...@@ -247,6 +251,8 @@ static void InitFunctionPtrs() ...@@ -247,6 +251,8 @@ static void InitFunctionPtrs()
SET(p__RTCastToVoid, "__RTCastToVoid"); SET(p__RTCastToVoid, "__RTCastToVoid");
SET(p__RTDynamicCast, "__RTDynamicCast"); SET(p__RTDynamicCast, "__RTDynamicCast");
SET(p__unDName,"__unDName");
/* Extremely early versions export logic_error, and crash in RTTI */ /* Extremely early versions export logic_error, and crash in RTTI */
SETNOFAIL(bAncientVersion, "??0logic_error@@QAE@ABQBD@Z"); SETNOFAIL(bAncientVersion, "??0logic_error@@QAE@ABQBD@Z");
} }
...@@ -812,6 +818,15 @@ static void test_rtti(void) ...@@ -812,6 +818,15 @@ static void test_rtti(void)
ok (casted == NULL, "Cast succeeded\n"); ok (casted == NULL, "Cast succeeded\n");
} }
static void test_demangle(void)
{
char * name = NULL;
static const char * mangled = ".ABVVec4@ref2@dice@@";
static const char * result = "class dice::ref2::Vec4 const &";
name = p__unDName(0, mangled + 1, 0,pmalloc,pfree,0x2800);
ok(name != NULL && !strcmp(name,result),"Got name %s \n",name);
}
START_TEST(cpp) START_TEST(cpp)
{ {
InitFunctionPtrs(); InitFunctionPtrs();
...@@ -822,6 +837,7 @@ START_TEST(cpp) ...@@ -822,6 +837,7 @@ START_TEST(cpp)
test___non_rtti_object(); test___non_rtti_object();
test_type_info(); test_type_info();
test_rtti(); test_rtti();
test_demangle();
if (hMsvcrt) if (hMsvcrt)
FreeLibrary(hMsvcrt); FreeLibrary(hMsvcrt);
......
...@@ -966,9 +966,6 @@ static BOOL symbol_demangle(struct parsed_symbol* sym) ...@@ -966,9 +966,6 @@ static BOOL symbol_demangle(struct parsed_symbol* sym)
BOOL ret = FALSE; BOOL ret = FALSE;
unsigned do_after = 0; unsigned do_after = 0;
/* MS mangled names always begin with '?' */
if (*sym->current != '?') return FALSE;
/* FIXME seems wrong as name, as it demangles a simple data type */ /* FIXME seems wrong as name, as it demangles a simple data type */
if (sym->flags & UNDNAME_NO_ARGUMENTS) if (sym->flags & UNDNAME_NO_ARGUMENTS)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment