MCPcopy Create free account
hub / github.com/apache/cloudberry / gp_stacktrace

Function gp_stacktrace

src/backend/utils/error/elog.c:5223–5242  ·  view source on GitHub ↗

* Build stack trace */

Source from the content-addressed store, hash-verified

5221 * Build stack trace
5222 */
5223char *gp_stacktrace(void **stackAddresses, uint32 stackDepth)
5224{
5225 StringInfoData append;
5226 initStringInfo(&append);
5227
5228#ifdef HAVE_BACKTRACE_SYMBOLS
5229 append_stacktrace(NULL /*PipeProtoChunk*/, &append, stackAddresses, stackDepth,
5230 false/*amsyslogger*/);
5231#else
5232 appendStringInfoString(&append, "stack trace is not available for this platform");
5233#endif
5234
5235 /* we may fail to retrieve stack on opt build */
5236 if (0 == append.len)
5237 {
5238 appendStringInfoString(&append, "failed to retrieve stack");
5239 }
5240
5241 return append.data;
5242}
5243
5244/*
5245 * SignalName

Callers 1

Calls 3

initStringInfoFunction · 0.85
appendStringInfoStringFunction · 0.85
append_stacktraceFunction · 0.70

Tested by

no test coverage detected