1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

print backtraces on panic on mac and linux

This commit is contained in:
Delyan Angelov
2019-08-27 23:29:13 +03:00
committed by Alexander Medvednikov
parent 02fc7e14cd
commit 73c6bae480
3 changed files with 33 additions and 6 deletions

View File

@ -39,6 +39,11 @@ fn (v mut V) cc() {
else {
a << '-g'
}
if v.pref.is_debug {
a << ' -rdynamic ' // needed for nicer symbolic backtraces
}
if v.os != .msvc && v.os != .freebsd {
a << '-Werror=implicit-function-declaration'
}

View File

@ -21,6 +21,15 @@ CommonCHeaders = '
#include <execinfo.h> // backtrace and backtrace_symbols_fd
#endif
#ifdef __linux__
#include <execinfo.h> // backtrace and backtrace_symbols_fd
#endif
#ifdef __linux__
#include <sys/types.h>
#include <sys/wait.h> // os__wait uses wait on nix
#endif
#define EMPTY_STRUCT_DECLARATION
#define OPTION_CAST(x) (x)