This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Timer
- From: Tom Tromey <tromey at redhat dot com>
- To: Marc BrÃnink <marc at nus dot edu dot sg>
- Cc: Pedro Alves <palves at redhat dot com>, Doug Evans <dje at google dot com>, gdb <gdb at sourceware dot org>
- Date: Tue, 07 May 2013 07:43:57 -0600
- Subject: Re: Timer
- References: <A941B6D9-B0CA-4EC2-AEFE-476014555337 at nus dot edu dot sg> <CADPb22Q0rQCQMee992CZBPHkjJOvBkCZMhqHx0V_y7v=VWDORA at mail dot gmail dot com> <52771B43-9617-412D-B9F8-5730757D6BAF at nus dot edu dot sg> <5188BFC1 dot 8090607 at redhat dot com> <AC3E31D9-B46C-423D-B414-F3C50C0896A9 at nus dot edu dot sg>
>>>>> "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