From 9951ad78c80e144c166a7d476cad7ffdf84332a9 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Wed, 13 Aug 2014 14:55:49 -0700 Subject: Debug debugging --- tools/debug-debug.gdb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tools/debug-debug.gdb (limited to 'tools/debug-debug.gdb') 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 -- cgit v1.2.3-60-g2f50