mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-12-27 06:21:02 +00:00
21 lines
494 B
C++
21 lines
494 B
C++
#pragma once
|
|
#include <util/types.hpp>
|
|
#include <util/logs.hpp>
|
|
|
|
namespace utils
|
|
{
|
|
std::vector<void*> get_backtrace(int max_depth = 255);
|
|
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack);
|
|
|
|
FORCE_INLINE void print_trace(logs::channel& logger, int max_depth = 255)
|
|
{
|
|
const auto trace = get_backtrace(max_depth);
|
|
const auto lines = get_backtrace_symbols(trace);
|
|
|
|
for (const auto& line : lines)
|
|
{
|
|
logger.error("%s", line);
|
|
}
|
|
}
|
|
}
|