split DUMPLOG

DUMPLOG requests the DUMPLOG feature as it does now
DUMPLOG_CORE requests the internal buffering only (used for CRASHREPORT)

This allows CRASHREPORT to access recent messages without performing
any file I/O.
This commit is contained in:
nhkeni
2024-02-20 21:37:06 -05:00
parent e76ab9558f
commit 3f5d1d3a36
14 changed files with 30 additions and 26 deletions

View File

@@ -1044,7 +1044,7 @@ curses_putmsghistory(const char *msg, boolean restoring_msghist)
stash_head = first_mesg, first_mesg = (nhprev_mesg *) 0;
last_mesg = (nhprev_mesg *) 0; /* no need to remember the tail */
initd = TRUE;
#ifdef DUMPLOG
#ifdef DUMPLOG_CORE
/* this suffices; there's no need to scrub g.saved_pline[] pointers */
gs.saved_pline_index = 0;
#endif
@@ -1058,7 +1058,7 @@ curses_putmsghistory(const char *msg, boolean restoring_msghist)
and those messages should have a normal turn value */
if (last_mesg) /* appease static analyzer */
last_mesg->turn = restoring_msghist ? (1L << 3) : gh.hero_seq;
#ifdef DUMPLOG
#ifdef DUMPLOG_CORE
dumplogmsg(last_mesg->str);
#endif
} else if (stash_count) {
@@ -1081,7 +1081,7 @@ curses_putmsghistory(const char *msg, boolean restoring_msghist)
/* added line became new tail */
if (last_mesg) /* appease static analyzer */
last_mesg->turn = mesg_turn;
#ifdef DUMPLOG
#ifdef DUMPLOG_CORE
dumplogmsg(mesg->str);
#endif
free((genericptr_t) mesg->str);