summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2007-11-04 16:35:08 -0500
committerDwight <dmerriman@gmail.com>2007-11-04 16:35:08 -0500
commit426ea61db2255dca8b2800503b5d973cb1f5da69 (patch)
treeabbe0ceec25a2853022997e1a7b2250d999b7d85 /util
parent94b2fe996faacf21996f3fbf0bcccc40e9a9ff35 (diff)
downloadmongo-426ea61db2255dca8b2800503b5d973cb1f5da69.tar.gz
diagnostic
Diffstat (limited to 'util')
-rw-r--r--util/goodies.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/util/goodies.h b/util/goodies.h
new file mode 100644
index 00000000000..d412460b84d
--- /dev/null
+++ b/util/goodies.h
@@ -0,0 +1,25 @@
+// goodies.h
+// miscellaneous junk
+
+#pragma once
+
+#include "../stdafx.h"
+
+inline void dumpmemory(const char *data, int len) {
+ try {
+ const char *q = data;
+ const char *p = q;
+ while( len > 0 ) {
+ for( int i = 0; i < 16; i++ ) {
+ cout << (*p >= 32 && *p <= 126) ? *p : '.';
+ p++;
+ }
+ cout << " ";
+ for( int i = 0; i < 16; i++ )
+ cout << (unsigned) *p << ' ';
+ cout << endl;
+ len -= 16;
+ }
+ } catch(...) { }
+}
+