public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Simon Sobisch <simonsobisch@gnu.org>
To: gdb@sourceware.org
Subject: How to recognize `exec-interrupt` via Python events
Date: Mon, 6 Dec 2021 21:11:23 +0100	[thread overview]
Message-ID: <74ce7f64-4368-aee4-1150-28cbd9cc6ae1@gnu.org> (raw)

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.

             reply	other threads:[~2021-12-06 20:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06 20:11 Simon Sobisch [this message]
2021-12-07 11:08 ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74ce7f64-4368-aee4-1150-28cbd9cc6ae1@gnu.org \
    --to=simonsobisch@gnu.org \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).