add debugger window support via _RPT*; add regex

currently it's locked behind _MSC_VER, but anything that runs on Win32
should be able to use those functions as long as it has something that
can pass as a debug window.

also, add a non-wildcard-accepting version of showdebug for the dumpit()
functions in dungeon.c and questpgr.c; this makes DEBUGFILES=* workable
without being excruciatingly painful
This commit is contained in:
Derek S. Ray
2015-04-15 18:19:16 -04:00
parent f244fd34f8
commit df52ba17ec
8 changed files with 60 additions and 28 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 dungeon.c $NHDT-Date: 1426465434 2015/03/16 00:23:54 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.39 $ */
/* NetHack 3.5 dungeon.c $NHDT-Date: 1429135381 2015/04/15 22:03:01 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.49 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -80,7 +80,7 @@ dumpit()
s_level *x;
branch *br;
if (!showdebug(__FILE__)) return;
if (!explicitdebug(__FILE__)) return;
for(i = 0; i < n_dgns; i++) {
fprintf(stderr, "\n#%d \"%s\" (%s):\n", i,

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 files.c $NHDT-Date: 1427337311 2015/03/26 02:35:11 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.141 $ */
/* NetHack 3.5 files.c $NHDT-Date: 1429136302 2015/04/15 22:18:22 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.166 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3267,11 +3267,16 @@ assure_syscf_file() {
#ifdef DEBUG
/* used by debugpline() to decide whether to issue a message
from a partiular source file; caller passes __FILE__ and we check
whether it is in the source file list supplied by SYSCF's DEBUGFILES */
* from a partiular source file; caller passes __FILE__ and we check
* whether it is in the source file list supplied by SYSCF's DEBUGFILES
*
* pass FALSE to override wildcard matching; useful for files
* like dungeon.c and questpgr.c, which generate a ridiculous amount of
* output if DEBUG is defined and effectively block the use of a wildcard */
boolean
showdebug(filename)
debugcore(filename, wildcards)
const char *filename;
boolean wildcards;
{
const char *debugfiles, *p;
@@ -3314,7 +3319,7 @@ const char *filename;
* attempt a wildcard match against each element, but that would be
* overkill for the intended usage.]
*/
if (pmatch(debugfiles, filename))
if (wildcards && pmatch(debugfiles, filename))
return TRUE;
/* check whether filename is an element of the list */
@@ -3327,6 +3332,7 @@ const char *filename;
}
return FALSE;
}
#endif /*DEBUG*/
/* ---------- BEGIN TRIBUTE ----------- */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 questpgr.c $NHDT-Date: 1426465439 2015/03/16 00:23:59 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.18 $ */
/* NetHack 3.5 questpgr.c $NHDT-Date: 1429135390 2015/04/15 22:03:10 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.26 $ */
/* Copyright 1991, M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */
@@ -46,7 +46,7 @@ dump_qtlist() /* dump the character msg list to check appearance */
{
struct qtmsg *msg;
if (!showdebug(__FILE__)) return;
if (!explicitdebug(__FILE__)) return;
for (msg = qt_list.chrole; msg->msgnum > 0; msg++) {
pline("msgnum %d: delivery %c",