Better stack trace parser for OSX.
This commit is contained in:
parent
f2d90ee844
commit
e46f48f0a3
@ -205,7 +205,7 @@ namespace nv
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Qt like push operator.
|
/// Qt like push operator.
|
||||||
NV_FORCEINLINE Array<T> & operator<< ( T & t )
|
NV_FORCEINLINE Array<T> & operator<< ( const T & t )
|
||||||
{
|
{
|
||||||
push_back(t);
|
push_back(t);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -294,20 +294,38 @@ namespace
|
|||||||
nvDebug( "\nDumping stacktrace:\n" );
|
nvDebug( "\nDumping stacktrace:\n" );
|
||||||
for(int i = start; i < size-1; i++ ) {
|
for(int i = start; i < size-1; i++ ) {
|
||||||
# if NV_CC_GNUC // defined(HAVE_CXXABI_H)
|
# if NV_CC_GNUC // defined(HAVE_CXXABI_H)
|
||||||
|
// @@ Write a better parser for the possible formats.
|
||||||
char * begin = strchr(string_array[i], '(');
|
char * begin = strchr(string_array[i], '(');
|
||||||
char * end = strchr(string_array[i], '+');
|
char * end = strrchr(string_array[i], '+');
|
||||||
|
char * module = string_array[i];
|
||||||
|
|
||||||
|
if (begin == 0 && end != 0) {
|
||||||
|
*(end - 1) = '\0';
|
||||||
|
begin = strrchr(string_array[i], ' ');
|
||||||
|
module = NULL; // Ignore module.
|
||||||
|
}
|
||||||
|
|
||||||
if (begin != 0 && begin < end) {
|
if (begin != 0 && begin < end) {
|
||||||
int stat;
|
int stat;
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
*begin = '\0';
|
*begin = '\0';
|
||||||
char * module = string_array[i];
|
|
||||||
char * name = abi::__cxa_demangle(begin+1, 0, 0, &stat);
|
char * name = abi::__cxa_demangle(begin+1, 0, 0, &stat);
|
||||||
|
if (module == NULL) {
|
||||||
|
if (name == NULL || stat != 0) {
|
||||||
|
nvDebug( " In: '%s'\n", begin+1 );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
nvDebug( " In: '%s'\n", name );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
if (name == NULL || stat != 0) {
|
if (name == NULL || stat != 0) {
|
||||||
nvDebug( " In: [%s] '%s'\n", module, begin+1 );
|
nvDebug( " In: [%s] '%s'\n", module, begin+1 );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nvDebug( " In: [%s] '%s'\n", module, name );
|
nvDebug( " In: [%s] '%s'\n", module, name );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
free(name);
|
free(name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user