src/hg/lib/web.c 1.169

1.169 2009/07/10 01:40:38 markd
moved stackDump stuff to hCommon; added function for user errAbort
Index: src/hg/lib/web.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/web.c,v
retrieving revision 1.168
retrieving revision 1.169
diff -b -B -U 4 -r1.168 -r1.169
--- src/hg/lib/web.c	11 Jun 2009 23:49:10 -0000	1.168
+++ src/hg/lib/web.c	10 Jul 2009 01:40:38 -0000	1.169
@@ -31,54 +31,8 @@
 
 /* global: a cart for use in error handlers. */
 static struct cart *errCart = NULL;
 
-static boolean stackDumpHasBeenDone = FALSE;  // prevent accidental recursion, only allow once
-
-static void webDumpStackAbortHandler()
-/* abort handle that prints stack dump then invokes the previous abort
- * handler on the stack. */
-{
-if (!stackDumpHasBeenDone)
-    {
-    stackDumpHasBeenDone = TRUE;
-    popWarnHandler(); // remove us from the stack
-    dumpStack("Stack dump:");
-    // continue with next abort handler
-    noWarnAbort();
-    }
-}
-
-boolean webDumpStackEnabled(void)
-/* is browser.pstack enabled?  */
-{
-return cfgOptionBooleanDefault("browser.dumpStack", FALSE);
-}
-
-void webDumpStackDisallow(void)
-/* prevent any dumping of the stack */
-{
-stackDumpHasBeenDone = TRUE;
-}
-
-void webDumpStackPushAbortHandler(void)
-/* push the stack dump abort handler on the stack if it's enabled.  This should be pushed
- * after the warn handle that will do the actual reporting */
-{
-if (webDumpStackEnabled())
-    {
-    errAbortDebugnPushPopErr();
-    pushAbortHandler(webDumpStackAbortHandler);
-    }
-}
-
-void webDumpStackPopAbortHandler(void)
-/* pop the stack dump abort handler from the stack if it's enabled */
-{
-if (webDumpStackEnabled() && !stackDumpHasBeenDone)
-    popAbortHandler();
-}
-
 void textVaWarn(char *format, va_list args)
 {
 vprintf(format, args);
 puts("\n");
@@ -95,9 +49,9 @@
 if (webInTextMode)
     pushWarnHandler(textVaWarn);
 else
     pushWarnHandler(webVaWarn);
-webDumpStackPushAbortHandler();
+hDumpStackPushAbortHandler();
 pushAbortHandler(softAbort);
 }
 
 void webPushErrHandlersCart(struct cart *cart)
@@ -110,9 +64,9 @@
 void webPopErrHandlers(void)
 /* Pop warn and abort handler for errAbort(). */
 {
 popWarnHandler();
-webDumpStackPopAbortHandler();
+hDumpStackPopAbortHandler();
 popAbortHandler();
 }
 
 void webSetStyle(char *style)