Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: "Marc Brünink" <marc@nus.edu.sg>
Cc: Doug Evans <dje@google.com>, gdb <gdb@sourceware.org>
Subject: Re: Timer
Date: Tue, 07 May 2013 10:51:00 -0000	[thread overview]
Message-ID: <5188DC9C.7080606@redhat.com> (raw)
In-Reply-To: <AC3E31D9-B46C-423D-B414-F3C50C0896A9@nus.edu.sg>

On 05/07/2013 11:18 AM, Marc Brünink wrote:

>> You could also use another signal instead of SIGTRAP.
> 
> Yes, this is probably the way to go. However, I remember having some issues with different signals. Esp if an applications depends on the delivery of a signal and I use it to implement the timer interrupt. But I suppose using SIGPROF or something similar should be fine.
> 
>>
>>>> bash$ man setitimer
>>>
>>> I suppose you are suggesting to modify either GDB or the application. This is exactly what I don't want. Any other way to accomplish this (using gdb)?
>>
>> You could use LD_PRELOAD to inject a library that uses setitimer into your program.
> 
> Possible, but contradicts the gdb-only approach. 

Well, so does the "way to go" above.  :-)

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

GDB's event loop supports timer events.  I guess those could be hooked up
to python gdb somehow.  (you'd need to use "set target-async".)  But
that'd require changing gdb...

-- 
Pedro Alves


  reply	other threads:[~2013-05-07 10:51 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         ` Pedro Alves [this message]
2013-05-07 13:44         ` Timer Tom Tromey
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=5188DC9C.7080606@redhat.com \
    --to=palves@redhat.com \
    --cc=dje@google.com \
    --cc=gdb@sourceware.org \
    --cc=marc@nus.edu.sg \
    /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