Timer

Tom Tromey tromey@redhat.com
Tue May 7 13:44:00 GMT 2013


>>>>> "Marc" == Marc Brünink <marc@nus.edu.sg> writes:

Pedro> I guess you could do it with gdb python scripting too.

Marc> This would be nice but does not work. As far as I remember there is a
Marc> sigsupend in linux-nat.c which will thwart using a simple
Marc> threading.Timer. But I might be wrong here. Whatever the reason, it
Marc> does not work.

I would try making a new thread in Python and setting timers in this
thread.  Then, when a timer fires, have it use gdb.post_event to send an
event to the gdb thread.  This event would use gdb.execute("interrupt")
to stop the inferior and trigger some processing.

I'm not totally sure this will work.  If not it would be interesting to
know what is needed to make it work.  I think at the very least it shows
that inferior control isn't exposed very well to Python.

Tom



More information about the Gdb mailing list