Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: "Marc Brünink" <marc@nus.edu.sg>
Cc: Pedro Alves <palves@redhat.com>, Doug Evans <dje@google.com>,
	       gdb <gdb@sourceware.org>
Subject: Re: Timer
Date: Tue, 07 May 2013 13:44:00 -0000	[thread overview]
Message-ID: <87d2t2x5uq.fsf@fleche.redhat.com> (raw)
In-Reply-To: <AC3E31D9-B46C-423D-B414-F3C50C0896A9@nus.edu.sg> ("Marc	\=\?utf-8\?Q\?Br\=C3\=BCnink\=22's\?\= message of "Tue, 7 May 2013 18:18:22 +0800")

>>>>> "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


  parent reply	other threads:[~2013-05-07 13:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06  9:52 Timer Marc Brünink
2013-05-07  4:43 ` Timer Doug Evans
2013-05-07  6:42   ` Timer Marc Brünink
2013-05-07  8:48     ` Timer Pedro Alves
2013-05-07 10:18       ` Timer Marc Brünink
2013-05-07 10:51         ` Timer Pedro Alves
2013-05-07 13:44         ` Tom Tromey [this message]
2013-05-07 13:28 ` Timer Phil Muldoon

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=87d2t2x5uq.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=dje@google.com \
    --cc=gdb@sourceware.org \
    --cc=marc@nus.edu.sg \
    --cc=palves@redhat.com \
    /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