MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / __linux_stack_walkback

Function __linux_stack_walkback

util/walkback.c:468–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466******************************************************************************/
467
468static int __linux_stack_walkback(ucontext_t *context, unsigned maxframes,
469 void (*handler)(void *returnaddr,
470 void *handlerarg),
471 void *handlerarg)
472{
473 unw_cursor_t cursor;
474 unsigned int i;
475 unw_word_t ip;
476 ucontext_t uc;
477
478 if (context == 0) {
479 context = &uc;
480 unw_getcontext(context);
481 }
482 unw_init_local(&cursor, context);
483 for (i = 0; i < maxframes; ++i) {
484 unw_get_reg(&cursor, UNW_REG_IP, &ip);
485 (*handler)((void *)ip, handlerarg);
486 if (unw_step(&cursor) <= 0) {
487 break;
488 }
489 }
490 return 0;
491}
492#endif
493
494#if defined(__APPLE__)

Callers 1

stack_pc_walkbackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected