#ifndef WH_DEBUG_H_aaa37448_ #define WH_DEBUG_H_aaa37448_ /* * APIs exported by debug.c. These are, not surprisingly, mostly * debugging assist. */ #include "structs.h" /* * This is designed to be the signal handler routine for fatal signals. * It writes out a heck.debug (or, if that cannot be fopen()ed, * /tmp/heck.debug) containing a lot of state - enough, I hope, to * find and fix the bug post-mortem. It then tries to drop core. * * One exception: if the signal is SIGQUIT, it does all this in a * forked child, after which the parent carries on. */ extern void debugsig(int sig); /* * Given a MONST *, checks that it's in a sane location. */ extern void debug_checkm(MONST *); /* * Sets the signal handler for SIGQUIT, SIGILL, SIGEMT, SIGFPE, SIGBUS, * SIGSEGV, SIGSYS, and SIGPIPE to point to debugsig (see above). */ extern void debugcatch(void); /* * This is an interactive facility which lets the user inspect the * state of the entire dungeon, with time frozen. */ extern void probe(void); /* * This describes the topology of the dungeon in terms of stairs and * connected blobs. The idea is to see to what extent there are * things like "this piece of level 4 is accessible only by going via * levels 5 and 6". The display is not as clear as one might wish, * but the information is present in a much more compact form than * that displayed by probe(). */ extern void structure(void); /* * Set up tracing in response to -trace on the command line. The * argument here is the argument passed after -trace; we treat it as a * filename to write tracing output to. */ extern void trace_open(const char *); /* * Set up to replay a trace log. */ extern void trace_replay(const char *); /* * Generate trace of randomness seed. */ extern void trace_seed(unsigned long long int); /* * Generate free-form trace text. Call like printf. */ extern void trace_text(const char *, ...) __attribute__((__format__(__printf__,1,2))); /* * Call this instead of getch(), so the resulting characters can be * logged in the trace. */ extern int tget(void); #endif