From 7245589dcbc08c377f783a637deeaa09604c6213 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 28 Aug 2014 14:28:43 -0700 Subject: Compatibility with gdb 7.4 --- tools/debug-debug.gdb | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/debug-debug.gdb b/tools/debug-debug.gdb index 23a934c..72a45e1 100644 --- a/tools/debug-debug.gdb +++ b/tools/debug-debug.gdb @@ -1,18 +1,32 @@ # vim: ft=python -set auto-load safe-path / +# set auto-load safe-path / +python +try: + gdb.execute('set auto-load safe-path /') +except: + pass +end file bin/test-debug-debug set logging file /dev/null set logging redirect on set logging off python +import re 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: + if expected.startswith('regex:'): + def compare(value, expected): + m = re.match(expected[6:], value) + return m and m.end() == m.endpos + else: + def compare(value, expected): + return value == expected + if not compare(value, expected): print 'Error: mismatch, aborting ...' print 'actual: %r' % value print 'expect: %r' % str(expected) @@ -23,7 +37,7 @@ end # register a pretty-printer for 'char *' instead #set print address off set print static-members off -set print elements unlimited +set print elements 9999 set print frame-arguments none set logging on -- cgit v1.2.3-70-g09d2