MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / decipher_trace

Function decipher_trace

sources/utils/DefaultSignalHandler.cpp:50–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 }
49
50 std::string decipher_trace(const std::string& trace)
51 {
52 std::string result;
53
54 if (trace.empty())
55 {
56 result += "??\n";
57 return result;
58 }
59
60 auto* begin = strchr(trace.c_str(), '(') + 1;
61 auto* end = strchr(begin, '+');
62
63 if (!end)
64 end = strchr(begin, ')');
65
66 std::string mangled_name(begin, end);
67
68 int status;
69 char* realname = abi::__cxa_demangle(mangled_name.c_str(), 0, 0, &status);
70 result.insert(result.end(), trace.c_str(), begin);
71
72 if (realname)
73 result += realname;
74 else
75 result.insert(result.end(), begin, end);
76
77 free(realname);
78 result.insert(result.size(), end);
79
80 return result;
81 }
82
83 void print_trace()
84 {

Callers 1

print_traceFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected