From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 233D63858C54; Mon, 26 Feb 2024 16:05:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 233D63858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1708963540; bh=WYsqbPZdqIr09Nmfo8iNe5nBDmYS23MG5WcAC+Xsh+k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EPmZhdorUYBZcJpMjCP2LRBE/4c0SWw+u7K83/a/INEnOa9zzf7QCs9efHZAADTZM GEvJxAGCyG4SUsrdMTxB0ISaPwxGY4i41S4+NtJRZiuI8/owpD1bbZDN8VrsQRgfhv g54BOvHdO4O/lbdsMdDDLZhQ2yNixPKWhYEr4z+A= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug python/31391] Incorrect FinishBreakpoint test Date: Mon, 26 Feb 2024 16:05:39 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31391 Tom de Vries changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vries at gcc dot gnu.org --- Comment #1 from Tom de Vries --- (In reply to Tom Tromey from comment #0) > py-finishbreakpoint.exp does this: >=20 > gdb_test "python print (finishbp_default.hit_count)" "1.*" "check > finishBP on default frame has been hit" >=20 > It is trying to check the hit count of this breakpoint. > However, the actual output is: >=20 > python print (finishbp_default.hit_count) > Traceback (most recent call last): > File "", line 1, in > RuntimeError: Breakpoint 3 is invalid. > Error while executing Python code. >=20 >=20 > ... which matches by mistake. > This came up in a patch series I'm working on. >=20 > I plan to kfail this but not close this bug; I think > this probably is a real problem of some sort. I think this may be the behaviour specified here ( https://sourceware.org/gdb/current/onlinedocs/gdb.html/Breakpoints-In-Pytho= n.html ): ... The optional temporary argument makes the breakpoint a temporary breakpoint. Temporary breakpoints are deleted after they have been hit. Any further acc= ess to the Python breakpoint after it has been hit will result in a runtime err= or (as that breakpoint has now been automatically deleted). ... So AFAIU, this happens: - finish breakpoints 3 and 4 are set at the same location - a continue hits both finish breakpoints - the hit_count is not available in either breakpoint, as per the doc, beca= use both temporary breakpoints have been deleted. - the return_value is available in both finish breakpoints, because it does= n't rely on accessing the underlying python breakpoint I think the test-case can be updated to accept the current behaviour, or we= can even remove the hit_count test. --=20 You are receiving this mail because: You are on the CC list for the bug.=