mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-10-11 22:49:55 +00:00
Util/stack_trace.cpp: Clean duplicate functions in CallStack dump
This commit is contained in:
@@ -13,6 +13,33 @@
|
|||||||
|
|
||||||
namespace utils
|
namespace utils
|
||||||
{
|
{
|
||||||
|
void clean_backtrace(std::vector<std::string>& result)
|
||||||
|
{
|
||||||
|
for (usz it = 1, first_in_seq = 0, del_count = 0;;)
|
||||||
|
{
|
||||||
|
if (it >= result.size() || result[it] != result[first_in_seq])
|
||||||
|
{
|
||||||
|
if (del_count)
|
||||||
|
{
|
||||||
|
fmt::append(result[first_in_seq], " x%u", del_count + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (it < result.size())
|
||||||
|
{
|
||||||
|
first_in_seq = it;
|
||||||
|
it++;
|
||||||
|
del_count = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
result.erase(result.begin() + it);
|
||||||
|
del_count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
std::string wstr_to_utf8(LPWSTR data, int str_len)
|
std::string wstr_to_utf8(LPWSTR data, int str_len)
|
||||||
{
|
{
|
||||||
@@ -139,6 +166,7 @@ namespace utils
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clean_backtrace(result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -166,6 +194,7 @@ namespace utils
|
|||||||
|
|
||||||
free(symbols);
|
free(symbols);
|
||||||
#endif
|
#endif
|
||||||
|
clean_backtrace(result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user