mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-06 00:40:11 +00:00
Fix linux build
This commit is contained in:
parent
bacf518189
commit
edb39039dd
@ -30,7 +30,7 @@ namespace utils
|
|||||||
return out.data();
|
return out.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<void*> backtrace(int max_depth)
|
std::vector<void*> get_backtrace(int max_depth)
|
||||||
{
|
{
|
||||||
std::vector<void*> result = {};
|
std::vector<void*> result = {};
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ namespace utils
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> backtrace_symbols(const std::vector<void*>& stack)
|
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack)
|
||||||
{
|
{
|
||||||
std::vector<std::string> result = {};
|
std::vector<std::string> result = {};
|
||||||
std::vector<u8> symbol_buf(sizeof(SYMBOL_INFO) + sizeof(TCHAR) * 256);
|
std::vector<u8> symbol_buf(sizeof(SYMBOL_INFO) + sizeof(TCHAR) * 256);
|
||||||
@ -117,7 +117,7 @@ namespace utils
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
std::vector<void*> backtrace(int max_depth)
|
std::vector<void*> get_backtrace(int max_depth)
|
||||||
{
|
{
|
||||||
std::vector<void*> result(max_depth);
|
std::vector<void*> result(max_depth);
|
||||||
int depth = backtrace(result.data(), max_depth);
|
int depth = backtrace(result.data(), max_depth);
|
||||||
@ -126,7 +126,7 @@ namespace utils
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> backtrace_symbols(const std::vector<void*>& stack)
|
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack)
|
||||||
{
|
{
|
||||||
std::vector<std::string> result;
|
std::vector<std::string> result;
|
||||||
result.reserve(stack.size());
|
result.reserve(stack.size());
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
|
|
||||||
namespace utils
|
namespace utils
|
||||||
{
|
{
|
||||||
std::vector<void*> backtrace(int max_depth = 255);
|
std::vector<void*> get_backtrace(int max_depth = 255);
|
||||||
std::vector<std::string> backtrace_symbols(const std::vector<void*>& stack);
|
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack);
|
||||||
|
|
||||||
FORCE_INLINE void print_trace(logs::channel& logger, int max_depth = 255)
|
FORCE_INLINE void print_trace(logs::channel& logger, int max_depth = 255)
|
||||||
{
|
{
|
||||||
const auto trace = backtrace(max_depth);
|
const auto trace = get_backtrace(max_depth);
|
||||||
const auto lines = backtrace_symbols(trace);
|
const auto lines = get_backtrace_symbols(trace);
|
||||||
|
|
||||||
for (const auto& line : lines)
|
for (const auto& line : lines)
|
||||||
{
|
{
|
||||||
|
@ -59,6 +59,7 @@ target_sources(rpcs3_emu PRIVATE
|
|||||||
../../Utilities/rXml.cpp
|
../../Utilities/rXml.cpp
|
||||||
../../Utilities/sema.cpp
|
../../Utilities/sema.cpp
|
||||||
../../Utilities/simple_ringbuf.cpp
|
../../Utilities/simple_ringbuf.cpp
|
||||||
|
../../Utilities/stack_trace.cpp
|
||||||
../../Utilities/StrFmt.cpp
|
../../Utilities/StrFmt.cpp
|
||||||
../../Utilities/Thread.cpp
|
../../Utilities/Thread.cpp
|
||||||
../../Utilities/version.cpp
|
../../Utilities/version.cpp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user