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

@@ -108,7 +108,7 @@ chainin_procs_chain(
tdp->nprocs = 0;
tdp->ndata = 0;
tdp->linknum = n;
cibase = 0;
cibase = tdp;
break;
case WINCHAIN_INIT:
tdp = me;
@@ -584,7 +584,7 @@ chainin_ctrl_nhwindow(
int request,
win_request_info *wri)
{
boolean rv;
win_request_info *rv;
rv = (*cibase->nprocs->win_ctrl_nhwindow)(cibase->ndata, window,
request, wri);
@@ -609,7 +609,7 @@ struct window_procs chainin_procs = {
chainin_display_nhwindow, chainin_destroy_nhwindow, chainin_curs,
chainin_putstr, chainin_putmixed, chainin_display_file,
chainin_start_menu, chainin_add_menu, chainin_end_menu,
chainin_select_menu, chainin_message_menu, chainin_update_inventory,
chainin_select_menu, chainin_message_menu,
chainin_mark_synch, chainin_wait_synch,
#ifdef CLIPPING
chainin_cliparound,

View File

@@ -702,12 +702,13 @@ chainout_can_suspend(void *vp)
win_request_info *
chainout_ctrl_nhwindow(
void *vp,
winid window,
int request,
win_request_info *wri)
{
struct chainout_data *tdp = vp;
boolean rv;
win_request_info *rv;
rv = (*tdp->nprocs->win_ctrl_nhwindow)(window,
request, wri);
@@ -733,7 +734,8 @@ struct chain_procs chainout_procs = {
chainout_destroy_nhwindow, chainout_curs, chainout_putstr,
chainout_putmixed, chainout_display_file, chainout_start_menu,
chainout_add_menu, chainout_end_menu, chainout_select_menu,
chainout_message_menu, chainout_update_inventory, chainout_mark_synch,
chainout_message_menu,
chainout_mark_synch,
chainout_wait_synch,
#ifdef CLIPPING
chainout_cliparound,

View File

@@ -9,8 +9,15 @@
#include <ctype.h>
#include <errno.h>
FILE *wc_tracelogf; /* Should be static, but it's just too useful to have
* access to this logfile from arbitrary other files. */
#ifdef WIN32
long getpid(void);
long
getpid(){
return 0;
}
#endif
FILE *wc_tracelogf;
static unsigned int indent_level; /* Some winfuncs call other winfuncs, so
* we need to support nesting. */
@@ -55,7 +62,6 @@ void trace_add_menu(void *,winid, const glyph_info *, const ANY_P *,
void trace_end_menu(void *,winid, const char *);
int trace_select_menu(void *,winid, int, MENU_ITEM_P **);
char trace_message_menu(void *,char, int, const char *);
void trace_update_inventory(void *,int);
void trace_mark_synch(void *);
void trace_wait_synch(void *);
#ifdef CLIPPING
@@ -101,6 +107,8 @@ void trace_status_update(void *,int, genericptr_t, int, int, int,
unsigned long *);
boolean trace_can_suspend(void *);
void trace_update_inventory(void *,int);
win_request_info *trace_ctrl_nhwindow(void *, winid, int, win_request_info *);
void trace_procs_init(int dir);
void *trace_procs_chain(int cmd, int n, void *me, void *nextprocs, void *nextdata);
@@ -144,7 +152,7 @@ trace_procs_chain(
void
trace_procs_init(int dir)
{
char fname[200];
char tfile[20];
long pid;
/* processors shouldn't need this test, but just in case */
@@ -152,8 +160,14 @@ trace_procs_init(int dir)
return;
pid = (long) getpid();
Sprintf(fname, "%s/tlog.%ld", HACKDIR, pid);
Sprintf(tfile, "tlog.%ld", pid);
// XXX FQN_NUMBUF is private to files.c
const char *fname = fqname(tfile, TROUBLEPREFIX,7);
printf("TRACEFILE: %s\n",fname);
fflush(stdout);
wc_tracelogf = fopen(fname, "w");
(void)setvbuf(wc_tracelogf, NULL, _IONBF, 0);
if (!wc_tracelogf) {
fprintf(stderr, "Can't open trace log file %s: %s\n", fname,
strerror(errno));
@@ -578,6 +592,16 @@ trace_update_inventory(void *vp, int arg)
POST;
}
win_request_info *
trace_ctrl_nhwindow(void *vp, winid w, int request, win_request_info *wri){
struct trace_data *tdp = vp;
fprintf(wc_tracelogf, "%sctrl_nhwindow(%d, %d, %p)\n", INDENT, w, request, wri);
PRE;
(*tdp->nprocs->win_ctrl_nhwindow)(tdp->ndata, w, request, wri);
POST;
}
void
trace_mark_synch(void *vp)
{
@@ -1186,7 +1210,8 @@ trace_can_suspend(void *vp)
}
struct chain_procs trace_procs = {
"+trace", 0, /* wincap */
"+trace", wp_trace,
0, /* wincap */
0, /* wincap2 */
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
/*
@@ -1202,7 +1227,7 @@ struct chain_procs trace_procs = {
trace_create_nhwindow, trace_clear_nhwindow, trace_display_nhwindow,
trace_destroy_nhwindow, trace_curs, trace_putstr, trace_putmixed,
trace_display_file, trace_start_menu, trace_add_menu, trace_end_menu,
trace_select_menu, trace_message_menu, trace_update_inventory,
trace_select_menu, trace_message_menu,
trace_mark_synch, trace_wait_synch,
#ifdef CLIPPING
trace_cliparound,
@@ -1228,4 +1253,6 @@ struct chain_procs trace_procs = {
trace_status_init, trace_status_finish, trace_status_enablefield,
trace_status_update,
trace_can_suspend,
trace_update_inventory,
trace_ctrl_nhwindow
};