Show file descriptors on crash on Windows

This commit is contained in:
Justine Tunney 2024-09-18 21:53:09 -07:00
parent 87a6669900
commit 8313dca982
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2 changed files with 4 additions and 1 deletions

View file

@ -20,6 +20,7 @@
#include "libc/atomic.h"
#include "libc/calls/blockcancel.internal.h"
#include "libc/calls/calls.h"
#include "libc/calls/internal.h"
#include "libc/calls/state.internal.h"
#include "libc/calls/struct/sigaction.h"
#include "libc/calls/struct/siginfo.h"
@ -242,6 +243,9 @@ static relegated void ShowCrashReport(int err, int sig, siginfo_t *si,
}
kprintf("\n");
__print_maps(15);
if (g_fds.n)
kprintf("\n");
__printfds(g_fds.p, g_fds.n);
if (__argv)
for (i = 0; i < __argc; ++i)
kprintf("%s ", __argv[i]);

View file

@ -39,7 +39,6 @@ textwindows int sys_getsockopt_nt(struct Fd *fd, int level, int optname,
uint64_t ms;
uint32_t in_optlen;
struct linger_nt linger;
npassert(fd->kind == kFdSocket);
if (out_opt_optval && inout_optlen) {
in_optlen = *inout_optlen;