diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index f88819443..6bca1ce8e 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -78,7 +78,10 @@ endif ifneq (0,$(RELEASE)) # Debugging disabled - debug=-fomit-frame-pointer -funswitch-loops -O$(OPTLEVEL) + debug=-funswitch-loops -O$(OPTLEVEL) + ifeq (0,$(DEBUGANYWAY)) + debug+= -fomit-frame-pointer + endif ifneq (0,$(LTO)) LIBS+= -flto debug+= -flto diff --git a/polymer/eduke32/Windows/src/backtrace.c b/polymer/eduke32/Windows/src/backtrace.c index 8a21cd9e2..496151d96 100644 --- a/polymer/eduke32/Windows/src/backtrace.c +++ b/polymer/eduke32/Windows/src/backtrace.c @@ -32,6 +32,9 @@ #include #include +#include +#include + #define BUFFER_MAX (16*1024) struct bfd_ctx { @@ -315,13 +318,22 @@ exception_filter(LPEXCEPTION_POINTERS info) SymCleanup(GetCurrentProcess()); } - int logfd = open("eduke32_or_mapster32.crashlog", O_APPEND | O_CREAT | O_WRONLY); + int logfd = open("eduke32_or_mapster32.crashlog", O_APPEND | O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); int written; if (logfd) { while ((written = write(logfd, g_output, strlen(g_output)))) { g_output += written; } + + time_t curtime = time(NULL); + struct tm *curltime = localtime(&curtime); + const char *theasctime = curltime ? asctime(curltime) : NULL; + const char *finistr = "---------------\n"; + + if (theasctime) + write(logfd, theasctime, strlen(theasctime)); + write(logfd, finistr, strlen(finistr)); close(logfd); } diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index cdf184d97..12c31e7ed 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -363,7 +363,12 @@ int32_t WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, in #endif #ifdef DEBUGGINGAIDS - LoadLibraryA("backtrace.dll"); + LoadLibraryA("ebacktrace1.dll"); +/* + wm_msgbox("boo","didn't load backtrace DLL (code %d)\n", (int)GetLastError()); + else + wm_msgbox("yay","loaded backtrace DLL\n"); +*/ #endif hdc = GetDC(NULL);