projects
/
satune.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
15959a3
)
Adding stack trace procedure
author
Hamed Gorjiara
<hgorjiar@uci.edu>
Mon, 1 Jul 2019 19:35:11 +0000
(12:35 -0700)
committer
Hamed Gorjiara
<hgorjiar@uci.edu>
Mon, 1 Jul 2019 19:35:11 +0000
(12:35 -0700)
src/common.cc
patch
|
blob
|
history
diff --git
a/src/common.cc
b/src/common.cc
index f54756b523ea07abca8f8c1256b3492965cad416..b66fc4423332e6341e2f4c9d8174eeb67f850e21 100644
(file)
--- a/
src/common.cc
+++ b/
src/common.cc
@@
-1,6
+1,18
@@
#include "common.h"
+#include <stdio.h>
+#include <execinfo.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <unistd.h>
void assert_hook(void)
{
model_print("Add breakpoint to line %u in file %s.\n", __LINE__, __FILE__);
}
+
+void print_trace(void){
+ void *array[10];
+ size_t size;
+ size = backtrace(array, 10);
+ backtrace_symbols_fd(array, size, STDERR_FILENO);
+}