Support thread local storage

This commit is contained in:
Justine Tunney 2022-05-16 13:20:08 -07:00
parent 91ee2b19d4
commit 55de4ca6b5
197 changed files with 1483 additions and 874 deletions

View file

@ -74,15 +74,18 @@ static int PrintBacktraceUsingAddr2line(int fd, const struct StackFrame *bp) {
return -1;
}
/*
* DWARF is a weak standard. Platforms that use LLVM or old GNU
* usually can't be counted upon to print backtraces correctly.
*/
// DWARF is a weak standard. Platforms that use LLVM or old GNU
// usually can't be counted upon to print backtraces correctly.
if (!IsLinux() && !IsWindows()) {
ShowHint("won't print addr2line backtrace because probably llvm");
return -1;
}
if (IsWindows()) {
// TODO: We need a way to *not* pass //?/C:/... paths to mingw
return -1;
}
i = 0;
j = 0;
argv[i++] = "addr2line";

View file

@ -277,6 +277,7 @@ relegated noinstrument void __oncrash(int sig, struct siginfo *si,
intptr_t rip;
int gdbpid, err;
static bool noreentry, notpossible;
STRACE("__oncrash rip %x", ctx->uc_mcontext.rip);
__atomic_fetch_sub(&g_ftrace, 1, __ATOMIC_RELAXED);
__atomic_fetch_sub(&__strace, 1, __ATOMIC_RELAXED);
if (_lockcmpxchg(&noreentry, false, true)) {