summaryrefslogtreecommitdiff
path: root/tools/debug-debug.gdb
diff options
context:
space:
mode:
Diffstat (limited to 'tools/debug-debug.gdb')
-rw-r--r--tools/debug-debug.gdb35
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/debug-debug.gdb b/tools/debug-debug.gdb
new file mode 100644
index 0000000..0389341
--- /dev/null
+++ b/tools/debug-debug.gdb
@@ -0,0 +1,35 @@
+# vim: ft=python
+set logging file /dev/null
+set logging redirect on
+set logging off
+
+python
+import sys
+
+def hit_breakpoint():
+ sys.stdout.write('.')
+ value = str(gdb.parse_and_eval('*&value'))
+ expected = gdb.parse_and_eval('expected').string()
+ if value != expected:
+ print 'Error: mismatch, aborting ...'
+ print 'actual: %r' % value
+ print 'expect: %r' % str(expected)
+ gdb.execute('bt')
+ sys.exit(1)
+end
+
+# register a pretty-printer for 'char *' instead
+#set print address off
+set print static-members off
+set print elements unlimited
+set print frame-arguments none
+
+set logging on
+rbreak do_breakpoint
+set logging off
+commands
+silent
+python hit_breakpoint()
+continue
+end
+run