aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-dap.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-02-27 16:18:32 +0100
committerTom de Vries <tdevries@suse.de>2024-02-27 16:18:32 +0100
commitcfb9cb1afd93dc71ea94ec7c7d9bfc0e43ace0bc (patch)
tree49c2e275a679424765f953e76396ddadf7b0ea7d /gdb/python/py-dap.c
parentdfec66ffff42d8274132f6df20d5281e10f0e746 (diff)
downloadbinutils-cfb9cb1afd93dc71ea94ec7c7d9bfc0e43ace0bc.zip
binutils-cfb9cb1afd93dc71ea94ec7c7d9bfc0e43ace0bc.tar.gz
binutils-cfb9cb1afd93dc71ea94ec7c7d9bfc0e43ace0bc.tar.bz2
[gdb/testsuite] Fix test in gdb.python/py-finish-breakpoint.exp
With test-case gdb.python/py-finish-breakpoint.exp, we run into: ... (gdb) python print (finishbp_default.hit_count) Traceback (most recent call last): File "<string>", line 1, in <module> RuntimeError: Breakpoint 3 is invalid. Error while executing Python code. (gdb) PASS: gdb.python/py-finish-breakpoint.exp: normal conditions: \ check finishBP on default frame has been hit ... The test producing the pass is: ... gdb_test "python print (finishbp_default.hit_count)" "1.*" \ "check finishBP on default frame has been hit" ... so the pass is produced because the 1 in "line 1" matches "1.*". Temporary breakpoints are removed when hit, and consequently accessing the hit_count attribute of a temporary python breakpoint (gdb.Breakpoint class) is not possible, and as per spec we get a RuntimeError. So the RuntimeError is correct, and not specific to finish breakpoints. The test presumably attempts to match: ... (gdb) python print (finishbp_default.hit_count) 1 ... but most likely this output was never produced by any gdb version. Fix this by checking whether the finishbp_default breakpoint has hit by checking that finishbp_default.is_valid() is False. Tested on aarch64-linux. Approved-By: Tom Tromey <tom@tromey.com> PR testsuite/31391 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31391
Diffstat (limited to 'gdb/python/py-dap.c')
0 files changed, 0 insertions, 0 deletions