mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 01:51:14 -03:00
Switch show_stackframe to backtrace_symbols_fd
It's simpler and avoids calling into fprintf in contexts in which it might crash or deadlock.
This commit is contained in:
committed by
ridiculousfish
parent
f17a71de74
commit
fea798011b
@@ -90,17 +90,8 @@ void show_stackframe()
|
||||
int trace_size = 0;
|
||||
|
||||
trace_size = backtrace(trace, 32);
|
||||
char **messages = backtrace_symbols(trace, trace_size);
|
||||
|
||||
if (messages)
|
||||
{
|
||||
debug(0, L"Backtrace:");
|
||||
for (int i=0; i<trace_size; i++)
|
||||
{
|
||||
fwprintf(stderr, L"%s\n", messages[i]);
|
||||
}
|
||||
free(messages);
|
||||
}
|
||||
debug(0, L"Backtrace:");
|
||||
backtrace_symbols_fd(trace, trace_size, STDERR_FILENO);
|
||||
}
|
||||
|
||||
int fgetws2(wcstring *s, FILE *f)
|
||||
|
||||
Reference in New Issue
Block a user