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:
@@ -84,3 +84,8 @@ OPTIONS=catname:Ghisteslwchlohm
|
||||
# 048 035 064 042 \
|
||||
# 047 045 092 124 124 092 045 047 \
|
||||
# 047 064 092 064 064 064 092 064 047
|
||||
|
||||
# CRASHREPORTURL must be set in syscf to enable these options.
|
||||
# These identify you in crash reports
|
||||
#OPTIONS=crash_name:Your Name
|
||||
#OPTIONS=crash_email:user@example.com
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/osascript -l JavaScript
|
||||
|
||||
// NetHack 3.7 tile.h $NHDT-Date: 1693083762 2023/08/26 21:02:42 $ $NHDT-Branch: keni-crashweb2 $:$NHDT-Revision: 1.1 $
|
||||
// Copyright (c) 2023 Kenneth Lorber
|
||||
// NetHack may be freely redistributed. See license for details.
|
||||
|
||||
// Call with URL then field value pairs. Opens a new browser window
|
||||
// to: URL?field=value+field=value.....
|
||||
// This program encodes the values; fieldnames don't require encoding.
|
||||
|
||||
// Should be installed in the playground.
|
||||
|
||||
function run(argv){
|
||||
|
||||
var url = argv[0];
|
||||
var argcp = 1;
|
||||
|
||||
url += "?cos=1"; // Start the query string and set mode
|
||||
while(argcp < argv.length){
|
||||
url += "&" + argv[argcp] + "=" + encodeURIComponent(argv[argcp+1])
|
||||
argcp += 2;
|
||||
}
|
||||
|
||||
var safari = Application('Safari');
|
||||
var nw = safari.make({ new:"document" });
|
||||
nw.url = url;
|
||||
safari.activate();
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
#!./nhlua
|
||||
-- NetHack 3.7 nhcrashreport.lua $NHDT-Date: 1693083824 2023/08/26 21:03:44 $ $NHDT-Branch: keni-crashweb2 $:$NHDT-Revision: 1.0 $
|
||||
-- Copyright (c) 2023 Kenneth Lorber
|
||||
-- NetHack may be freely redistributed. See license for details.
|
||||
|
||||
-- Call with URL then field value pairs. Opens a new browser window
|
||||
-- to: URL?field=value+field=value.....
|
||||
-- This program encodes the values; fieldnames don't require encoding.
|
||||
--
|
||||
-- Should be installed in the playground.
|
||||
|
||||
----
|
||||
-- from
|
||||
-- https://github.com/daurnimator/lua-http/blob/master/http/util.lua
|
||||
-- Encodes a character as a percent encoded string
|
||||
local function char_to_pchar(c)
|
||||
return string.format("%%%02X", c:byte(1,1))
|
||||
end
|
||||
-- encodeURIComponent escapes all characters except the following: alphabetic, decimal digits, - _ . ! ~ * ' ( )
|
||||
local function encodeURIComponent(str)
|
||||
return (str:gsub("[^%w%-_%.%!%~%*%'%(%)]", char_to_pchar))
|
||||
end
|
||||
----
|
||||
|
||||
function un20(str)
|
||||
return str:gsub("%%20","+")
|
||||
end
|
||||
|
||||
url = table.remove(arg,1) .. "?cos=1"; -- Start the query string and set mode
|
||||
while #arg > 0 do
|
||||
local field = table.remove(arg,1)
|
||||
local value = table.remove(arg,1)
|
||||
url = url .. "&" .. field .. "=" .. un20(encodeURIComponent(value))
|
||||
end
|
||||
--print("url='"..url.."'")
|
||||
cmd = '/usr/bin/xdg-open "'..url..'"'
|
||||
os.execute(cmd)
|
||||
os.exit()
|
||||
Reference in New Issue
Block a user