From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C58163858D32; Tue, 11 Apr 2023 22:03:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C58163858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681250599; bh=NVeNO1KGntGxLgpo9VKAFv/MzRf4IqxPA59NnJZHjwc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NNCNVv6skb9LP8tzdZaK5ExSRvCA6iLX0SlwZdefPVXP6cRjUdZtq4kl/tWQEQjps F2NV6t5QO75IE1flia6IVimEG1AfCenDDmmjiFI8kuCDyxeQQtw72kzKXvNA1ogjzX cRWF9yM6gNuRX5sJzfP24FjNlsfdKB36F97jZdfg= From: "dominik.b.czarnota+bugzilla at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/29831] event loop deadlocks when using continue in breakpoint command and using gdb.execute in stop event hook written in Python Date: Tue, 11 Apr 2023 22:03:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dominik.b.czarnota+bugzilla at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: 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=3D29831 --- Comment #1 from Disconnect3d --- This can be worked around in the following way. However, this is not a good solution since this means one can't script GDB using both its native CLI commands and Python at the same time. ``` import gdb def stop_handler (event): print("Python stop handler started") print("Thread is stopped: " + str(gdb.selected_thread().is_stopped())) print("Thread is running: " + str(gdb.selected_thread().is_running())) (gdb.execute("",to_string=3DTrue)) print("Thread is stopped: " + str(gdb.selected_thread().is_stopped())) print("Thread is running: " + str(gdb.selected_thread().is_running())) print("Python Stop handler finished\n") gdb.events.stop.connect (stop_handler) class Bp(gdb.Breakpoint): def stop(self): print("Breakpoint hit!") return True Bp("foo") ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=