mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-02 17:28:30 +00:00
Support thread local storage
This commit is contained in:
parent
91ee2b19d4
commit
55de4ca6b5
197 changed files with 1483 additions and 874 deletions
|
@ -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";
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue