Add support for symbol table in .com files

This change fixes minor bugs and adds a feature, which lets us store the
ELF symbol table, inside the ZIP directory. We use the path /zip/.symtab
which can be safely removed using a zip editing tool, to make the binary
smaller after compilation. This supplements the existing method of using
a separate .com.dbg file, which is still supported. The intent is people
don't always know that it's a good idea to download the debug file. It's
not great having someone's first experience be a crash report, that only
has numbers rather than symbols. This will help fix that!
This commit is contained in:
Justine Tunney 2022-03-23 06:31:55 -07:00
parent 393ca4be40
commit 23b72eb617
61 changed files with 963 additions and 510 deletions

View file

@ -31,6 +31,7 @@
#include "libc/log/log.h"
#include "libc/macros.internal.h"
#include "libc/nexgen32e/stackframe.h"
#include "libc/runtime/internal.h"
#include "libc/runtime/pc.internal.h"
/**
@ -275,7 +276,8 @@ static wontreturn relegated noinstrument void __minicrash(int sig,
"%n",
kind, TinyStrSignal(sig), __argv[0], ctx ? ctx->uc_mcontext.rip : 0,
ctx ? ctx->uc_mcontext.rsp : 0, ctx ? ctx->uc_mcontext.rbp : 0);
quick_exit(119);
__restorewintty();
_Exit(119);
}
/**
@ -316,6 +318,7 @@ relegated noinstrument void __oncrash(int sig, struct siginfo *si,
if (!(gdbpid > 0 && (sig == SIGTRAP || sig == SIGQUIT))) {
__restore_tty(1);
ShowCrashReport(err, sig, si, ctx);
__restorewintty();
_Exit(128 + sig);
}
} else {