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
|
||||
{
|
||||
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
|
||||
std::string wstr_to_utf8(LPWSTR data, int str_len)
|
||||
{
|
||||
@@ -139,6 +166,7 @@ namespace utils
|
||||
}
|
||||
}
|
||||
|
||||
clean_backtrace(result);
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
@@ -166,6 +194,7 @@ namespace utils
|
||||
|
||||
free(symbols);
|
||||
#endif
|
||||
clean_backtrace(result);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user