* count_namespaces() did not work correctly when there were more than one but

less than 10 namespaces.
* 'const' object methods are now properly handled.
* Template classes are now ignored as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28383 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-10-30 17:38:03 +00:00
parent 6179ce7957
commit 61791eda0c

View File

@ -230,13 +230,15 @@ count_namespaces(const char** _mangled)
// more than one namespace
if (mangled[1] == '_') {
// more than 9 namespaces
namespaces = strtoul(mangled + 1, (char**)&mangled, 10);
namespaces = strtoul(mangled + 2, (char**)&mangled, 10);
if (mangled[0] != '_')
namespaces = 0;
} else
namespaces = mangled[1] - '0';
mangled++;
} else {
namespaces = mangled[1] - '0';
mangled += 2;
}
} else if (isdigit(mangled[0]))
namespaces = 1;
@ -396,6 +398,12 @@ demangle_symbol(const char* name, char* buffer, size_t bufferSize,
if (mangled == NULL)
return NULL;
if (mangled[0] == 'C') {
// ignore const method
type = TYPE_METHOD;
mangled++;
}
if (_isObjectMethod != NULL) {
// we can only guess with GCC2 mangling
*_isObjectMethod = type == TYPE_METHOD;
@ -407,6 +415,10 @@ demangle_symbol(const char* name, char* buffer, size_t bufferSize,
buffer[0] = '\0';
while (namespaces-- > 0) {
if (namespaceStart[0] == 't') {
// It's a template class after all
return NULL;
}
if (!isdigit(namespaceStart[0]))
break;