mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Native Linux backtrace.
This commit is contained in:
committed by
Christoffer Lerno
parent
f39aa1a41e
commit
dc0aa35522
@@ -87,11 +87,11 @@ struct CallstackElement
|
||||
uint line;
|
||||
}
|
||||
|
||||
fn bool print_backtrace(String message, int backtraces_to_ignore) @if(env::DARWIN)
|
||||
fn bool print_backtrace(String message, int backtraces_to_ignore) @if(env::DARWIN || env::LINUX)
|
||||
{
|
||||
@pool()
|
||||
{
|
||||
BacktraceList! backtrace = darwin::backtrace_load(mem::temp());
|
||||
BacktraceList! backtrace = backtrace::backtrace_load(mem::temp());
|
||||
if (catch backtrace) return false;
|
||||
if (backtrace.len() <= backtraces_to_ignore) return false;
|
||||
io::eprint("\nERROR: '");
|
||||
|
||||
Reference in New Issue
Block a user