Add a uc_backtrace_buf() functio

This commit is contained in:
Nils O. Selåsdal
2013-03-06 21:58:56 +01:00
parent e1bd10208e
commit ee8d9ae19d
3 changed files with 58 additions and 0 deletions
+16
View File
@@ -2,7 +2,23 @@
#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