Get Fat Emacs working in Windows Console

This commit is contained in:
Justine Tunney 2023-08-18 04:55:57 -07:00
parent bf835de612
commit 7100b1cf91
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
34 changed files with 479 additions and 168 deletions

View file

@ -284,9 +284,11 @@ dontasan textstartup void __printargs(const char *prologue) {
}
if ((n = poll(u.pfds, ARRAYLEN(u.pfds), 0)) != -1) {
for (i = 0; i < ARRAYLEN(u.pfds); ++i) {
char oflagbuf[128];
if (i && (u.pfds[i].revents & POLLNVAL)) continue;
PRINT(" ☼ %d (revents=%#hx fcntl(F_GETFL)=%#x isatty()=%hhhd)", i,
u.pfds[i].revents, fcntl(i, F_GETFL), isatty(i));
PRINT(" ☼ %d (revents=%#hx fcntl(F_GETFL)=%s isatty()=%hhhd)", i,
u.pfds[i].revents, (DescribeOpenFlags)(oflagbuf, fcntl(i, F_GETFL)),
isatty(i));
}
} else {
PRINT(" poll() returned %d %m", n);
@ -449,15 +451,18 @@ dontasan textstartup void __printargs(const char *prologue) {
PRINT(" ☼ %s = %#s", "kNtSystemDirectory", kNtSystemDirectory);
PRINT(" ☼ %s = %#s", "kNtWindowsDirectory", kNtWindowsDirectory);
#endif
PRINT(" ☼ %s = %#s", "__argv[0]", __argv[0]);
PRINT(" ☼ %s = %#s", "getenv(\"_\")", getenv("_"));
PRINT(" ☼ %s = %#s", "getauxval(AT_EXECFN)", getauxval(AT_EXECFN));
PRINT(" ☼ %s = %#s", "GetProgramExecutableName", GetProgramExecutableName());
PRINT(" ☼ %s = %#s", "GetInterpreterExecutableName",
GetInterpreterExecutableName(u.path, sizeof(u.path)));
PRINT(" ☼ %s = %p", "RSP", __builtin_frame_address(0));
PRINT(" ☼ %s = %p", "GetStackSize()", GetStackSize());
PRINT(" ☼ %s = %p", "GetGuardSize()", GetGuardSize());
PRINT(" ☼ %s = %p", "GetStackAddr()", GetStackAddr());
PRINT(" ☼ %s = %p", "GetStaticStackSize()", GetStaticStackSize());
PRINT(" ☼ %s = %p", "GetStaticStackAddr(0)", GetStaticStackAddr(0));
PRINT(" ☼ %s = %p", "__builtin_frame_address(0)", __builtin_frame_address(0));
PRINT("");
PRINT("MEMTRACK");
@ -509,46 +514,34 @@ dontasan textstartup void __printargs(const char *prologue) {
if (termios.c_oflag & OFILL) kprintf(" OFILL");
if (termios.c_oflag & OFDEL) kprintf(" OFDEL");
if (termios.c_oflag & OLCUC) kprintf(" OLCUC");
if ((termios.c_oflag & NLDLY) == NL0) {
kprintf(" NL0");
} else if ((termios.c_oflag & NLDLY) == NL1) {
if ((termios.c_oflag & NLDLY) == NL1) {
kprintf(" NL1");
} else if ((termios.c_oflag & NLDLY) == NL2) {
kprintf(" NL2");
} else if ((termios.c_oflag & NLDLY) == NL3) {
kprintf(" NL3");
}
if ((termios.c_oflag & CRDLY) == CR0) {
kprintf(" CR0");
} else if ((termios.c_oflag & CRDLY) == CR1) {
if ((termios.c_oflag & CRDLY) == CR1) {
kprintf(" CR1");
} else if ((termios.c_oflag & CRDLY) == CR2) {
kprintf(" CR2");
} else if ((termios.c_oflag & CRDLY) == CR3) {
kprintf(" CR3");
}
if ((termios.c_oflag & TABDLY) == TAB0) {
kprintf(" TAB0");
} else if ((termios.c_oflag & TABDLY) == TAB1) {
if ((termios.c_oflag & TABDLY) == TAB1) {
kprintf(" TAB1");
} else if ((termios.c_oflag & TABDLY) == TAB2) {
kprintf(" TAB2");
} else if ((termios.c_oflag & TABDLY) == TAB3) {
kprintf(" TAB3");
}
if ((termios.c_oflag & BSDLY) == BS0) {
kprintf(" BS0");
} else if ((termios.c_oflag & BSDLY) == BS1) {
if ((termios.c_oflag & BSDLY) == BS1) {
kprintf(" BS1");
}
if ((termios.c_oflag & VTDLY) == VT0) {
kprintf(" VT0");
} else if ((termios.c_oflag & VTDLY) == VT1) {
if ((termios.c_oflag & VTDLY) == VT1) {
kprintf(" VT1");
}
if ((termios.c_oflag & FFDLY) == FF0) {
kprintf(" FF0");
} else if ((termios.c_oflag & FFDLY) == FF1) {
if ((termios.c_oflag & FFDLY) == FF1) {
kprintf(" FF1");
}
kprintf("\n");