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

@@ -522,7 +522,7 @@ parseoptions(
* determine_ambiguities()
* figured out exactly how many characters are required to
* unambiguously differentiate one option from all others, and it
* placed that number into each option's alloption[n].minmatch.
* placed that number into each option's allopt[n].minmatch.
*
*/
if (!got_match)
@@ -1205,6 +1205,80 @@ optfn_catname(
return optn_ok;
}
static int
optfn_crash_email(int optidx UNUSED, int req, boolean negated UNUSED, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
if (req == do_set) {
if ((op = string_for_opt(opts, FALSE))
!= empty_optstr) {
gc.crash_email = dupstr(op);
} else
return optn_err;
return optn_ok;
}
if (req == get_val || req == get_cnf_val) {
if (!opts)
return optn_err;
Sprintf(opts, "%s", gc.crash_email);
return optn_ok;
}
return optn_ok;
}
static int
optfn_crash_name(int optidx UNUSED, int req, boolean negated UNUSED, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
if (req == do_set) {
if ((op = string_for_opt(opts, FALSE))
!= empty_optstr) {
gc.crash_name = dupstr(op);
} else
return optn_err;
return optn_ok;
}
if (req == get_val || req == get_cnf_val) {
if (!opts)
return optn_err;
Sprintf(opts, "%s", gc.crash_name);
return optn_ok;
}
return optn_ok;
}
static int
optfn_crash_urlmax(int optidx UNUSED, int req, boolean negated UNUSED, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
if (req == do_set) {
if ((op = string_for_opt(opts, FALSE))
!= empty_optstr) {
int temp = atoi(op);
if(temp < 75){
config_error_add("Invalid value %d for crash_urlmax. Minimum value is 75.",temp);
return optn_err;
}
gc.crash_urlmax = temp;
} else
return optn_err;
return optn_ok;
}
if (req == get_val || req == get_cnf_val) {
if (!opts)
return optn_err;
Sprintf(opts, "%d", gc.crash_urlmax);
return optn_ok;
}
return optn_ok;
}
#ifdef CURSES_GRAPHICS
static int
optfn_cursesgraphics(int optidx, int req, boolean negated,
@@ -6694,8 +6768,6 @@ initoptions(void)
{
int i;
go.opt_phase = builtin_opt;
initoptions_init();
/*
* Call each option function with an init flag and give it a chance
* to make any preparations that it might require. We do this
@@ -6740,6 +6812,7 @@ initoptions_init(void)
#endif
int i;
go.opt_phase = builtin_opt; // Did I need to move this here?
memcpy(allopt, allopt_init, sizeof(allopt));
determine_ambiguities();