Fix msvcrt symbol demangling for non MS symbols.

This commit is contained in:
Vijay Kiran Kamuju 2005-10-20 13:15:11 +00:00 committed by Alexandre Julliard
parent 3eb08c44e7
commit 9c6a15ce62
2 changed files with 16 additions and 3 deletions

View File

@ -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()
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)
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)
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);

View File

@ -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)
{ {