add CRASHREPORT directly to browser

add CRASHREPORT for Windows
add ^P info to report (via DUMPLOG)

new options: crash_email, crash_name, crash_urlmax
new game command: #bugreport
new config option: CRASHREPORT_EXEC_NOSTDERR
new command line option: --bidshow

deleted helper scripts:
    NetHackCrashReport.Javascript
    nhcrashreport.lua

misc:
    update CRASHREPORTURL (will need to be updated before release)
    update bitrot in winchain
    winchain for Windows
    add missing synch_wait for NetHackW --showpaths
    add PANICTRACE (and CRASHREPORT) in mdlib.c:build_opts

missing:
    packaging (Windows needs the pdb file)
    no testing with MSVC command line build

port status:
    linux: working, but glibc's backtrace doesn't show static functions
    Windows VS: working.  pdb file is large - looking into options
    MacOS: working
    msdos: not supported
    VMS: not supported
    MSVC: planned, but not attempted
    MSYS2: working, but libbacktrace not showing symbols (yet?)
This commit is contained in:
nhkeni
2024-02-06 18:33:59 -05:00
parent cf3cbcf832
commit dbe5c98dca
37 changed files with 1001 additions and 315 deletions

View File

@@ -112,7 +112,7 @@ LUA2NHTOP = ../../..
LUABASELIB = liblua-$(LUA_VERSION).a
TOPLUALIB = lib/lua/$(LUABASELIB)
ALLDEP = $(GAME) recover Guidebook $(VARDAT) spec_levs check-dlb check-nhlua
ALLDEP = $(GAME) recover Guidebook $(VARDAT) spec_levs check-dlb
# first target is also the default target for 'make' without any arguments
all: $(ALLDEP)
@@ -148,10 +148,6 @@ luabin:
( cd $(LUATOP) \
&& make $(LUAMAKEFILES) all && cd $(LUA2NHTOP) )
check-nhlua:
( util/makedefs --grep-defined CRASHREPORT && ( \
cd $(LUATOP) && make $(LUAMAKEFLAGS) ); true )
# hints file could set LUATESTTARGET to this if GITSUBMODULES is defined
submodules/lua/lua.h:
git submodule init submodules/lua

View File

@@ -291,11 +291,7 @@ VARDIR = $(HACKDIR)
POSTINSTALL+= cp -n sys/unix/sysconf $(INSTDIR)/sysconf; \
$(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; \
$(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; \
chmod $(VARFILEPERM) $(INSTDIR)/sysconf; \
( util/makedefs --grep-defined CRASHREPORT && \
( cp win/share/nhcrashreport.lua $(INSTDIR) ; \
chmod 555 $(INSTDIR)/nhcrashreport.lua ; \
cp $(LUATOP)/lua $(INSTDIR)/nhlua); true)
chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
ifneq "$(CCISCLANG)" ""
# gdb may not be installed if clang is chosen compiler so the game

View File

@@ -31,6 +31,8 @@ ifndef LIBXPM
LIBXPM= -L/opt/X11/lib -lXpm
endif
#WANT_WIN_CHAIN=1
# 4. Other
#-----------------------------------------------------------------------------
@@ -98,7 +100,7 @@ NHCFLAGS+=-DNOMAIL
#NHCFLAGS+=-DNO_CHRONICLE
#NHCFLAGS+=-DLIVELOG
# not NHCFLAGS - needed for makedefs
CFLAGS+=-DCRASHREPORT=\"NetHackCrashReport.JavaScript\"
CFLAGS+=-DCRASHREPORT=\"/usr/bin/open\"
ifdef MAKEFILE_SRC
# default
@@ -334,10 +336,7 @@ PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); \
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; \
$(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; \
$(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; \
chmod $(VARFILEPERM) $(HACKDIR)/sysconf; \
util/makedefs --grep-defined CRASHREPORT && \
( cp win/macosx/NetHackCrashReport.JavaScript $(HACKDIR) && \
chmod 0500 $(HACKDIR)/NetHackCrashReport.JavaScript )
chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
else ifdef WANT_SOURCE_INSTALL
@@ -353,10 +352,7 @@ CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; \
util/makedefs --grep-defined CRASHREPORT && \
( cp win/macosx/NetHackCrashReport.JavaScript $(HACKDIR) && \
chmod 0500 $(HACKDIR)/NetHackCrashReport.JavaScript )
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf;
# We can use "make all" to build the whole thing - but it misses some things:
MOREALL=$(MAKE) install
@@ -385,10 +381,7 @@ PREINSTALL+= (mkdir $(SHELLDIR) || true);
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; \
$(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; \
$(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; \
chmod $(VARFILEPERM) $(HACKDIR)/sysconf; \
util/makedefs --grep-defined CRASHREPORT && \
( cp win/macosx/NetHackCrashReport.JavaScript $(HACKDIR) && \
chmod 0500 $(HACKDIR)/NetHackCrashReport.JavaScript )
chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
endif # !WANT_SHARE_INSTALL
@@ -731,7 +724,6 @@ build_package_root:
install -p doc/recover.6 $(PKGROOT_UG)/man/man6
install -p doc/Guidebook $(PKGROOT_UG)/doc
install -p dat/nhdat $(PKGROOT_UGLN)
#XXX no code to package NetHackCrashReport.JavaScript
sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(PKGROOT_UGLN)/sysconf
cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN)
# XXX these files should be somewhere else for good Mac form

View File

@@ -159,6 +159,9 @@ GREPPATH=/bin/grep
PANICTRACE_GDB=1
PANICTRACE_LIBC=2
# URL loaded for creating reports to the NetHack DevTeam
#CRASHREPORTURL=https://nethack.org/links/cr-37BETA.html
# 'portable_device_paths' is only supported for Windows. Starting with
# 3.6.3, nethack on Windows treats the folder containing nethack.exe and
# nethackW.exe as read-only and puts data files which are generated or

View File

@@ -151,6 +151,7 @@ main(int argc, char *argv[])
check_linux_console();
#endif
initoptions_init();
initoptions();
#ifdef PANICTRACE
ARGV0 = gh.hname; /* save for possible stack trace */
@@ -766,6 +767,7 @@ opt_showpaths(const char *dir)
nhUse(dir);
#endif
iflags.initoptions_noterminate = TRUE;
initoptions_init();
initoptions();
iflags.initoptions_noterminate = FALSE;
reveal_paths();