aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-09-29 15:53:52 +0200
committerTom de Vries <tdevries@suse.de>2021-09-29 15:53:52 +0200
commit6767cc642cffc86848887f9bdd1ffe57d93ef563 (patch)
tree924a860dffbe3d72c91abf776237373819ff2194 /gdb/source.c
parentf15ec499bf8c5328679e3f745b78ef03b83d6510 (diff)
downloadgdb-6767cc642cffc86848887f9bdd1ffe57d93ef563.zip
gdb-6767cc642cffc86848887f9bdd1ffe57d93ef563.tar.gz
gdb-6767cc642cffc86848887f9bdd1ffe57d93ef563.tar.bz2
[gdb/testsuite] Fix gdb.python/py-breakpoint.exp with python 2
With a gdb build using python 2.7, I run into: ... (gdb) python \ gdb.events.breakpoint_modified.connect(lambda bp: print(bp.enabled))^M File "<string>", line 1^M gdb.events.breakpoint_modified.connect(lambda bp: print(bp.enabled))^M ^^M SyntaxError: invalid syntax^M Error while executing Python code.^M (gdb) FAIL: gdb.python/py-breakpoint.exp: test_bkpt_auto_disable: \ trap breakpoint_modified event ... This is caused by the following: - a lambda function body needs to be an expression - in python 2, print is a statement, while in python 3 it's a function - a function call is an expression, and a statement is not. Fix this by defining a function print_bp_enabled: ... def print_bp_enabled (bp): print (bp.enabled) end ... and using that instead. Tested on x86_64-linux.
Diffstat (limited to 'gdb/source.c')
0 files changed, 0 insertions, 0 deletions