summaryrefslogtreecommitdiff
path: root/tools/debug-debug.gdb
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-08-13 14:55:49 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-08-27 11:29:45 -0700
commit9951ad78c80e144c166a7d476cad7ffdf84332a9 (patch)
tree9f5498a9a3c23b62dc928288e72081e99f958f46 /tools/debug-debug.gdb
parent749fec734c4583153fb2dbc80f1d21db2c2ab457 (diff)
downloadtmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.tar.gz
tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.tar.bz2
tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.tar.xz
tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.zip
Debug debugging
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