25 lines
575 B
C
25 lines
575 B
C
#ifndef UC_BACKTRACE_H_
|
|
#define UC_BACKTRACE_H_
|
|
|
|
#define UC_BACTRACE_STDERR uc_backtrace_fd(2)
|
|
#include <stddef.h>
|
|
|
|
/**
|
|
* Print a stacktrace to the given file descriptor.
|
|
*
|
|
* @param fd filedescriptor to write to.
|
|
*/
|
|
void uc_backtrace_fd(int fd);
|
|
/**
|
|
* Print a stactrace to the given buffer
|
|
* (Note that unlike uc_backtrace_fd(), this function
|
|
* does malloc() call and may fail in a signal handler or
|
|
* if memory is corrupted.
|
|
*
|
|
* @param buf buffer to place the stacktrace in.
|
|
* @param len length of buffer
|
|
*/
|
|
void uc_backtrace_buf(char *buf, size_t len);
|
|
|
|
#endif
|