Merge branch 'keni-crdumplog' into NetHack-3.7
This commit is contained in:
@@ -199,6 +199,7 @@ steps:
|
|||||||
sed -i '/^#[ ]*define CRASHREPORT/d' include/config.h
|
sed -i '/^#[ ]*define CRASHREPORT/d' include/config.h
|
||||||
#sed -i '/^#[ ]*define DOAGAIN/d' include/config.h
|
#sed -i '/^#[ ]*define DOAGAIN/d' include/config.h
|
||||||
sed -i '/^#[ ]*define DUMPLOG/d' include/config.h
|
sed -i '/^#[ ]*define DUMPLOG/d' include/config.h
|
||||||
|
sed -i '/^#[ ]*define DUMPLOG_CORE/d' include/config.h
|
||||||
#sed -i '/^#[ ]*define GDBPATH/d' include/config.h
|
#sed -i '/^#[ ]*define GDBPATH/d' include/config.h
|
||||||
#sed -i '/^#[ ]*define GREPPATH/d' include/config.h
|
#sed -i '/^#[ ]*define GREPPATH/d' include/config.h
|
||||||
sed -i '/^#[ ]*define INSURANCE/d' include/config.h
|
sed -i '/^#[ ]*define INSURANCE/d' include/config.h
|
||||||
|
|||||||
@@ -262,8 +262,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CRASHREPORT
|
#ifdef CRASHREPORT
|
||||||
# ifndef DUMPLOG
|
# ifndef DUMPLOG_CORE
|
||||||
# define DUMPLOG // required to get ^P info
|
# define DUMPLOG_CORE // required to get ^P info
|
||||||
# endif
|
# endif
|
||||||
# ifdef MACOS
|
# ifdef MACOS
|
||||||
# define PANICTRACE
|
# define PANICTRACE
|
||||||
@@ -726,9 +726,7 @@ typedef unsigned char uchar;
|
|||||||
#endif /* LIVELOG */
|
#endif /* LIVELOG */
|
||||||
|
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG
|
||||||
#ifndef DUMPLOG_MSG_COUNT
|
#define DUMPLOG_CORE
|
||||||
#define DUMPLOG_MSG_COUNT 50
|
|
||||||
#endif /* DUMPLOG_MSG_COUNT */
|
|
||||||
#ifndef DUMPLOG_FILE
|
#ifndef DUMPLOG_FILE
|
||||||
#define DUMPLOG_FILE "/tmp/nethack.%n.%d.log"
|
#define DUMPLOG_FILE "/tmp/nethack.%n.%d.log"
|
||||||
/* DUMPLOG_FILE allows following placeholders:
|
/* DUMPLOG_FILE allows following placeholders:
|
||||||
@@ -745,5 +743,10 @@ typedef unsigned char uchar;
|
|||||||
*/
|
*/
|
||||||
#endif /* DUMPLOG_FILE */
|
#endif /* DUMPLOG_FILE */
|
||||||
#endif /* DUMPLOG */
|
#endif /* DUMPLOG */
|
||||||
|
#ifdef DUMPLOG_CORE
|
||||||
|
#ifndef DUMPLOG_MSG_COUNT
|
||||||
|
#define DUMPLOG_MSG_COUNT 50
|
||||||
|
#endif /* DUMPLOG_MSG_COUNT */
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_H */
|
#endif /* CONFIG_H */
|
||||||
|
|||||||
@@ -917,7 +917,7 @@ struct instance_globals_s {
|
|||||||
boolean shop_filter;
|
boolean shop_filter;
|
||||||
|
|
||||||
/* pline.c */
|
/* pline.c */
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
unsigned saved_pline_index; /* slot in saved_plines[] to use next */
|
unsigned saved_pline_index; /* slot in saved_plines[] to use next */
|
||||||
char *saved_plines[DUMPLOG_MSG_COUNT];
|
char *saved_plines[DUMPLOG_MSG_COUNT];
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2356,7 +2356,7 @@ extern boolean autopick_testobj(struct obj *, boolean) NONNULLARG1;
|
|||||||
|
|
||||||
/* ### pline.c ### */
|
/* ### pline.c ### */
|
||||||
|
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
extern void dumplogmsg(const char *);
|
extern void dumplogmsg(const char *);
|
||||||
extern void dumplogfreemessages(void);
|
extern void dumplogfreemessages(void);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6611,7 +6611,7 @@ yn_function(
|
|||||||
{
|
{
|
||||||
char res = '\033', qbuf[QBUFSZ];
|
char res = '\033', qbuf[QBUFSZ];
|
||||||
struct _cmd_queue cq, *cmdq;
|
struct _cmd_queue cq, *cmdq;
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
unsigned idx = gs.saved_pline_index;
|
unsigned idx = gs.saved_pline_index;
|
||||||
/* buffer to hold query+space+formatted_single_char_response */
|
/* buffer to hold query+space+formatted_single_char_response */
|
||||||
char dumplog_buf[QBUFSZ + 1 + 15]; /* [QBUFSZ+1+7] should suffice */
|
char dumplog_buf[QBUFSZ + 1 + 15]; /* [QBUFSZ+1+7] should suffice */
|
||||||
@@ -6653,7 +6653,7 @@ yn_function(
|
|||||||
cmdq_add_key(CQ_REPEAT, res);
|
cmdq_add_key(CQ_REPEAT, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
if (idx == gs.saved_pline_index) {
|
if (idx == gs.saved_pline_index) {
|
||||||
/* when idx is still the same as gs.saved_pline_index, the interface
|
/* when idx is still the same as gs.saved_pline_index, the interface
|
||||||
didn't put the prompt into gs.saved_plines[]; we put a simplified
|
didn't put the prompt into gs.saved_plines[]; we put a simplified
|
||||||
|
|||||||
@@ -775,7 +775,7 @@ const struct instance_globals_s g_init_s = {
|
|||||||
/* pickup.c */
|
/* pickup.c */
|
||||||
FALSE, /* shop_filter */
|
FALSE, /* shop_filter */
|
||||||
/* pline.c */
|
/* pline.c */
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
0U, /* saved_pline_index */
|
0U, /* saved_pline_index */
|
||||||
{ NULL }, /* saved_plines */
|
{ NULL }, /* saved_plines */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -537,7 +537,7 @@ submit_web_report(int cos, const char *msg, const char *why){
|
|||||||
#endif // !WIN32
|
#endif // !WIN32
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
// config.h turns this on, but make it easy to turn off if needed
|
// config.h turns this on, but make it easy to turn off if needed
|
||||||
if(cos==1) {
|
if(cos==1) {
|
||||||
int k;
|
int k;
|
||||||
@@ -1191,6 +1191,7 @@ dump_plines(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* DUMPLOG */
|
||||||
|
|
||||||
#ifdef CRASHREPORT
|
#ifdef CRASHREPORT
|
||||||
// lineno==0 gives the most recent message (e.g. "Do you want to call panic..."
|
// lineno==0 gives the most recent message (e.g. "Do you want to call panic..."
|
||||||
@@ -1214,7 +1215,6 @@ get_saved_pline(int lineno){
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif /* CRASHREPORT */
|
#endif /* CRASHREPORT */
|
||||||
#endif /* DUMPLOG */
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -1787,7 +1787,7 @@ do_look(int mode, coord *click_cc)
|
|||||||
if (found) {
|
if (found) {
|
||||||
/* use putmixed() because there may be an encoded glyph present */
|
/* use putmixed() because there may be an encoded glyph present */
|
||||||
putmixed(WIN_MESSAGE, 0, out_str);
|
putmixed(WIN_MESSAGE, 0, out_str);
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
{
|
{
|
||||||
char dmpbuf[BUFSZ];
|
char dmpbuf[BUFSZ];
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ static void execplinehandler(const char *);
|
|||||||
#ifdef USER_SOUNDS
|
#ifdef USER_SOUNDS
|
||||||
extern void maybe_play_sound(const char *);
|
extern void maybe_play_sound(const char *);
|
||||||
#endif
|
#endif
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
|
|
||||||
/* keep the most recent DUMPLOG_MSG_COUNT messages */
|
/* keep the most recent DUMPLOG_MSG_COUNT messages */
|
||||||
void
|
void
|
||||||
@@ -205,7 +205,7 @@ vpline(const char *line, va_list the_args)
|
|||||||
}
|
}
|
||||||
msgtyp = MSGTYP_NORMAL;
|
msgtyp = MSGTYP_NORMAL;
|
||||||
|
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
/* We hook here early to have options-agnostic output.
|
/* We hook here early to have options-agnostic output.
|
||||||
* Unfortunately, that means Norep() isn't honored (general issue) and
|
* Unfortunately, that means Norep() isn't honored (general issue) and
|
||||||
* that short lines aren't combined into one longer one (tty behavior).
|
* that short lines aren't combined into one longer one (tty behavior).
|
||||||
|
|||||||
@@ -1233,7 +1233,7 @@ freedynamicdata(void)
|
|||||||
#ifdef USER_SOUNDS
|
#ifdef USER_SOUNDS
|
||||||
release_sound_mappings();
|
release_sound_mappings();
|
||||||
#endif
|
#endif
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
dumplogfreemessages();
|
dumplogfreemessages();
|
||||||
#endif
|
#endif
|
||||||
discard_gamelog();
|
discard_gamelog();
|
||||||
|
|||||||
@@ -962,7 +962,7 @@ void NetHackQtBind::qt_putmsghistory(const char *msg, boolean is_restoring)
|
|||||||
if (msg) {
|
if (msg) {
|
||||||
//raw_printf("msg='%s'", msg);
|
//raw_printf("msg='%s'", msg);
|
||||||
window->PutStr(ATR_NONE, QString::fromLatin1(msg));
|
window->PutStr(ATR_NONE, QString::fromLatin1(msg));
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
dumplogmsg(msg);
|
dumplogmsg(msg);
|
||||||
#endif
|
#endif
|
||||||
} else if (msgs_saved) {
|
} else if (msgs_saved) {
|
||||||
@@ -970,7 +970,7 @@ void NetHackQtBind::qt_putmsghistory(const char *msg, boolean is_restoring)
|
|||||||
for (int i = 0; i < msgs_strings->size(); ++i) {
|
for (int i = 0; i < msgs_strings->size(); ++i) {
|
||||||
const QString &nxtmsg = msgs_strings->at(i);
|
const QString &nxtmsg = msgs_strings->at(i);
|
||||||
window->PutStr(ATR_NONE, nxtmsg);
|
window->PutStr(ATR_NONE, nxtmsg);
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
dumplogmsg(nxtmsg.toLatin1().constData());
|
dumplogmsg(nxtmsg.toLatin1().constData());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1044,7 +1044,7 @@ curses_putmsghistory(const char *msg, boolean restoring_msghist)
|
|||||||
stash_head = first_mesg, first_mesg = (nhprev_mesg *) 0;
|
stash_head = first_mesg, first_mesg = (nhprev_mesg *) 0;
|
||||||
last_mesg = (nhprev_mesg *) 0; /* no need to remember the tail */
|
last_mesg = (nhprev_mesg *) 0; /* no need to remember the tail */
|
||||||
initd = TRUE;
|
initd = TRUE;
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
/* this suffices; there's no need to scrub g.saved_pline[] pointers */
|
/* this suffices; there's no need to scrub g.saved_pline[] pointers */
|
||||||
gs.saved_pline_index = 0;
|
gs.saved_pline_index = 0;
|
||||||
#endif
|
#endif
|
||||||
@@ -1058,7 +1058,7 @@ curses_putmsghistory(const char *msg, boolean restoring_msghist)
|
|||||||
and those messages should have a normal turn value */
|
and those messages should have a normal turn value */
|
||||||
if (last_mesg) /* appease static analyzer */
|
if (last_mesg) /* appease static analyzer */
|
||||||
last_mesg->turn = restoring_msghist ? (1L << 3) : gh.hero_seq;
|
last_mesg->turn = restoring_msghist ? (1L << 3) : gh.hero_seq;
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
dumplogmsg(last_mesg->str);
|
dumplogmsg(last_mesg->str);
|
||||||
#endif
|
#endif
|
||||||
} else if (stash_count) {
|
} else if (stash_count) {
|
||||||
@@ -1081,7 +1081,7 @@ curses_putmsghistory(const char *msg, boolean restoring_msghist)
|
|||||||
/* added line became new tail */
|
/* added line became new tail */
|
||||||
if (last_mesg) /* appease static analyzer */
|
if (last_mesg) /* appease static analyzer */
|
||||||
last_mesg->turn = mesg_turn;
|
last_mesg->turn = mesg_turn;
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
dumplogmsg(mesg->str);
|
dumplogmsg(mesg->str);
|
||||||
#endif
|
#endif
|
||||||
free((genericptr_t) mesg->str);
|
free((genericptr_t) mesg->str);
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ hooked_tty_getlin(
|
|||||||
/* prevent next message from pushing current query+answer into
|
/* prevent next message from pushing current query+answer into
|
||||||
tty message history */
|
tty message history */
|
||||||
*gt.toplines = '\0';
|
*gt.toplines = '\0';
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
} else {
|
} else {
|
||||||
/* needed because we've bypassed pline() */
|
/* needed because we've bypassed pline() */
|
||||||
dumplogmsg(gt.toplines);
|
dumplogmsg(gt.toplines);
|
||||||
|
|||||||
@@ -534,7 +534,7 @@ tty_yn_function(
|
|||||||
(void) key2txt(q, rtmp);
|
(void) key2txt(q, rtmp);
|
||||||
/* addtopl(rtmp); -- rewrite gt.toplines instead */
|
/* addtopl(rtmp); -- rewrite gt.toplines instead */
|
||||||
Sprintf(gt.toplines, "%s%s", prompt, rtmp);
|
Sprintf(gt.toplines, "%s%s", prompt, rtmp);
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
dumplogmsg(gt.toplines);
|
dumplogmsg(gt.toplines);
|
||||||
#endif
|
#endif
|
||||||
ttyDisplay->inread--;
|
ttyDisplay->inread--;
|
||||||
@@ -684,7 +684,7 @@ tty_putmsghistory(const char *msg, boolean restoring_msghist)
|
|||||||
restored ones are being put into place */
|
restored ones are being put into place */
|
||||||
msghistory_snapshot(TRUE);
|
msghistory_snapshot(TRUE);
|
||||||
initd = TRUE;
|
initd = TRUE;
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
/* this suffices; there's no need to scrub saved_pline[] pointers */
|
/* this suffices; there's no need to scrub saved_pline[] pointers */
|
||||||
gs.saved_pline_index = 0;
|
gs.saved_pline_index = 0;
|
||||||
#endif
|
#endif
|
||||||
@@ -701,7 +701,7 @@ tty_putmsghistory(const char *msg, boolean restoring_msghist)
|
|||||||
/* move most recent message to history, make this become most recent */
|
/* move most recent message to history, make this become most recent */
|
||||||
remember_topl();
|
remember_topl();
|
||||||
Strcpy(gt.toplines, msg);
|
Strcpy(gt.toplines, msg);
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
dumplogmsg(gt.toplines);
|
dumplogmsg(gt.toplines);
|
||||||
#endif
|
#endif
|
||||||
} else if (snapshot_mesgs) {
|
} else if (snapshot_mesgs) {
|
||||||
@@ -712,7 +712,7 @@ tty_putmsghistory(const char *msg, boolean restoring_msghist)
|
|||||||
for (idx = 0; snapshot_mesgs[idx]; ++idx) {
|
for (idx = 0; snapshot_mesgs[idx]; ++idx) {
|
||||||
remember_topl();
|
remember_topl();
|
||||||
Strcpy(gt.toplines, snapshot_mesgs[idx]);
|
Strcpy(gt.toplines, snapshot_mesgs[idx]);
|
||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG_CORE
|
||||||
dumplogmsg(gt.toplines);
|
dumplogmsg(gt.toplines);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user