Add a uc_backtrace_buf() functio
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <stdio.h>
|
||||
#include <ucore/ucore_backtrace.h>
|
||||
|
||||
//note , compiling this without -rdynamic does not
|
||||
@@ -7,9 +8,22 @@ void func2(void)
|
||||
uc_backtrace_fd(2);
|
||||
}
|
||||
|
||||
void func3(void)
|
||||
{
|
||||
uc_backtrace_fd(2);
|
||||
}
|
||||
|
||||
void func4(void)
|
||||
{
|
||||
char trace[256];
|
||||
uc_backtrace_buf(trace, sizeof trace);
|
||||
printf("Stacktrace from %s:\n%s", __func__, trace);
|
||||
}
|
||||
|
||||
void func1(void)
|
||||
{
|
||||
func2();
|
||||
func4();
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
Reference in New Issue
Block a user