mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-12 05:59:10 +00:00
Make improvements
- Fix unused local variable errors - Remove yoinks from sigaction() header - Add nox87 and aarch64 to github actions - Fix cosmocc -fportcosmo in linking mode - It's now possible to build `make m=llvm o/llvm/libc`
This commit is contained in:
parent
3dc86ce154
commit
f7ae50462a
118 changed files with 342 additions and 392 deletions
|
@ -46,14 +46,12 @@ relegated void __check_fail(const char *suffix, //
|
|||
int line, //
|
||||
const char *fmt, //
|
||||
...) {
|
||||
int e;
|
||||
char *p;
|
||||
size_t i;
|
||||
va_list va;
|
||||
char hostname[32];
|
||||
strace_enabled(-1);
|
||||
ftrace_enabled(-1);
|
||||
e = errno;
|
||||
__start_fatal(file, line);
|
||||
__stpcpy(hostname, "unknown");
|
||||
gethostname(hostname, sizeof(hostname));
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
relegated int(gdbexec)(const char *cmd) {
|
||||
struct StackFrame *bp;
|
||||
int pid, ttyin, ttyout;
|
||||
intptr_t continuetoaddr;
|
||||
const char *se, *elf, *gdb;
|
||||
char pidstr[11], breakcmd[40];
|
||||
if (!(gdb = GetGdbPath())) return -1;
|
||||
|
@ -43,7 +42,6 @@ relegated int(gdbexec)(const char *cmd) {
|
|||
elf = "-q";
|
||||
}
|
||||
bp = __builtin_frame_address(0);
|
||||
continuetoaddr = bp->addr;
|
||||
sprintf(breakcmd, "%s *%#p", "break", bp->addr);
|
||||
if (!(pid = vfork())) {
|
||||
execv(gdb, (char *const[]){
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/atomic.h"
|
||||
#include "libc/intrin/atomic.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/log/backtrace.internal.h"
|
||||
|
@ -67,7 +68,7 @@ static struct Memlog {
|
|||
long size;
|
||||
} * p;
|
||||
} allocs;
|
||||
long usage;
|
||||
atomic_long usage;
|
||||
} __memlog;
|
||||
|
||||
static pthread_mutex_t __memlog_lock_obj;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/calls/struct/utsname.h"
|
||||
#include "libc/calls/syscall-sysv.internal.h"
|
||||
#include "libc/calls/ucontext.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
|
@ -44,6 +45,7 @@
|
|||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
#include "libc/thread/thread.h"
|
||||
#include "libc/thread/tls.h"
|
||||
#ifdef __x86_64__
|
||||
|
@ -292,7 +294,9 @@ static wontreturn relegated dontinstrument void __minicrash(int sig,
|
|||
*/
|
||||
relegated void __oncrash_amd64(int sig, struct siginfo *si, void *arg) {
|
||||
int bZero;
|
||||
#ifdef ATTACH_GDB_ON_CRASH
|
||||
intptr_t rip;
|
||||
#endif
|
||||
int me, owner;
|
||||
int gdbpid, err;
|
||||
ucontext_t *ctx = arg;
|
||||
|
@ -307,13 +311,15 @@ relegated void __oncrash_amd64(int sig, struct siginfo *si, void *arg) {
|
|||
if (atomic_compare_exchange_strong_explicit(
|
||||
&once, &owner, me, memory_order_relaxed, memory_order_relaxed)) {
|
||||
if (!__vforked) {
|
||||
#ifdef ATTACH_GDB_ON_CRASH
|
||||
rip = ctx ? ctx->uc_mcontext.rip : 0;
|
||||
#endif
|
||||
err = errno;
|
||||
if ((gdbpid = IsDebuggerPresent(true))) {
|
||||
DebugBreak();
|
||||
} else if (__nocolor || g_isrunningundermake) {
|
||||
gdbpid = -1;
|
||||
#if 0
|
||||
#if ATTACH_GDB_ON_CRASH
|
||||
} else if (!IsTiny() && IsLinux() && FindDebugBinary() && !__isworker) {
|
||||
// RestoreDefaultCrashSignalHandlers();
|
||||
gdbpid = AttachDebugger(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue