* Build stack trace */
| 5221 | * Build stack trace |
| 5222 | */ |
| 5223 | char *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 |
no test coverage detected