aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/log.h
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-07-23 17:00:30 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-07-23 17:16:19 +0200
commiteb2473e9ea0a875b79612f84d1fae32b670d9b88 (patch)
tree5816446b2fb1323763a4ce58842b5dcc971631db /src/nvim/log.h
parent5fc775e2efd1adf4985d9abcb1d970dcaa944555 (diff)
downloadrneovim-eb2473e9ea0a875b79612f84d1fae32b670d9b88.tar.gz
rneovim-eb2473e9ea0a875b79612f84d1fae32b670d9b88.tar.bz2
rneovim-eb2473e9ea0a875b79612f84d1fae32b670d9b88.zip
log: log_callstack()
Diffstat (limited to 'src/nvim/log.h')
-rw-r--r--src/nvim/log.h22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/nvim/log.h b/src/nvim/log.h
index 48be7606e7..2bd18f5776 100644
--- a/src/nvim/log.h
+++ b/src/nvim/log.h
@@ -62,27 +62,7 @@
#endif
#if defined(__linux__)
-# include <execinfo.h>
-# define LOG_CALLSTACK(prefix) \
- do { \
- void *trace[100]; \
- int trace_size = backtrace(trace, 100); \
- \
- char exe[1024]; \
- ssize_t elen = readlink("/proc/self/exe", exe, sizeof(exe) - 1); \
- exe[elen] = 0; \
- \
- for (int i = 1; i < trace_size; i++) { \
- char buf[256]; \
- snprintf(buf, sizeof(buf), "addr2line -e %s -f -p %p", exe, trace[i]); \
- FILE *fp = popen(buf, "r"); \
- while (fgets(buf, sizeof(buf) - 1, fp) != NULL) { \
- buf[strlen(buf)-1] = 0; \
- do_log(DEBUG_LOG_LEVEL, __func__, __LINE__, true, prefix "%s", buf); \
- } \
- fclose(fp); \
- } \
- } while (0)
+# define LOG_CALLSTACK() log_callstack(__func__, __LINE__)
#endif
#ifdef INCLUDE_GENERATED_DECLARATIONS