Index: /branches/jch-memory/psLib/src/sys/psMemory.c
===================================================================
--- /branches/jch-memory/psLib/src/sys/psMemory.c	(revision 10899)
+++ /branches/jch-memory/psLib/src/sys/psMemory.c	(revision 10900)
@@ -9,6 +9,6 @@
 *  @author Joshua Hoblitt, University of Hawaii
 *
-*  @version $Revision: 1.88.2.10 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2007-01-04 21:09:32 $
+*  @version $Revision: 1.88.2.11 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2007-01-04 21:39:00 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -199,6 +199,6 @@
     bool abort_on_error = false;
 
-    if (psMemCheckCorruption(abort_on_error) > 0) {
-        fprintf(stderr,"Detected memory corruption\n"); // somewhere to set a breakpoint
+    if (psMemCheckCorruption(stderr, abort_on_error) > 0) {
+        fprintf(stderr, "Detected memory corruption\n"); // somewhere to set a breakpoint
     }
 
@@ -322,5 +322,5 @@
 }
 
-int psMemCheckCorruption(bool abort_on_error)
+int psMemCheckCorruption(FILE *output, bool abort_on_error)
 {
     psS32 nbad = 0;               // number of bad blocks
@@ -333,4 +333,14 @@
         if (badMemBlock(memBlock)) {
             nbad++;
+
+            fprintf(output,
+                    "Memory corruption detected in memBlock %lu\n"
+                    "\tSize %zd\n"
+                    "\tPosts: %p %p %p\n"
+                    "\tAllocated at %s (%s:%d) by thread %lu\n",
+                    memBlock->id,
+                    memBlock->userMemorySize,
+                    memBlock->startblock, memBlock->endblock, (memBlock + 1 + memBlock->userMemorySize),
+                    memBlock->func, memBlock->file, memBlock->lineno, memBlock->tid);
 
             if (abort_on_error) {
Index: /branches/jch-memory/psLib/src/sys/psMemory.h
===================================================================
--- /branches/jch-memory/psLib/src/sys/psMemory.h	(revision 10899)
+++ /branches/jch-memory/psLib/src/sys/psMemory.h	(revision 10900)
@@ -12,6 +12,6 @@
  *  @ingroup MemoryManagement
  *
- *  @version $Revision: 1.61.2.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-01-04 21:09:32 $
+ *  @version $Revision: 1.61.2.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-01-04 21:39:00 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -320,5 +320,6 @@
  */
 int psMemCheckCorruption(
-    bool abort_on_error                ///< Abort on detecting corruption?
+    FILE *output,                       ///< FILE to write corrupted blocks too
+    bool abort_on_error                 ///< Abort on detecting corruption?
 );
 
