From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by sourceware.org (Postfix) with ESMTPS id BC29B3858401 for ; Mon, 6 Dec 2021 20:11:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BC29B3858401 Received: from [2001:470:142:3::e] (port=39980 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muKKe-00020J-4w for gdb@sourceware.org; Mon, 06 Dec 2021 15:11:28 -0500 Received: from ip5f5a8896.dynamic.kabel-deutschland.de ([95.90.136.150]:55173 helo=[192.168.111.41]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muKKd-0007Si-PQ for gdb@sourceware.org; Mon, 06 Dec 2021 15:11:28 -0500 Message-ID: <74ce7f64-4368-aee4-1150-28cbd9cc6ae1@gnu.org> Date: Mon, 6 Dec 2021 21:11:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 From: Simon Sobisch Subject: How to recognize `exec-interrupt` via Python events To: gdb@sourceware.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2021 20:11:30 -0000 It is possible that I've just overlooked something, but I can't seem to get an event triggered at all: gdb.events.stop.connect(stop_handler) is triggered after each step/next, a expected; also on signals including SIGINT, also when pressing CTRL+C when the inferior is running, type can be checked with if type(event) is gdb.StopEvent When the MI frontend (Vim in this case, but this should also apply to Emacs and others) executes `-exec-step` or `-exec-next` the event is triggered, when the inferior is running and a breakpoint/watchpint is triggered, too. But when the inferior is running and `-exec-interrupt` is triggered then the python code seems to not get an event at all - do I need to connect to a different event registry? The main _problem_ that this issue creates lies in the GDB python extension implementing an "auto-step" (starter code at [1]) and stopping when interrupted... but now I see that this does not work with clients that interrupt with `-exec-interrupt`, which _does_ stop the running process, but the python extension does not recognize it and steps further, so the interrupt is actually not working. [1]: https://stackoverflow.com/a/67470758/5027456 Note: the new and better one catching more events and implementing a gdb.Parameter got lost there, I'll update that answerit when I know how to solve this issue.