Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: joaoandreferro@sapo.pt
To: Doug Evans <dje@google.com>
Cc: gdb <gdb@sourceware.org>
Subject: Re: Can GDB support "temporal breakpoints"?
Date: Thu, 30 Oct 2014 12:18:00 -0000	[thread overview]
Message-ID: <20141030121815.Horde.8vqm4_U-9cztH4TOoUFeYQ2@mail.sapo.pt> (raw)
In-Reply-To: <CADPb22QdQuCi6Ca3Y5EVYXdsdVmq_sKzE91AVkcpAHLO9f80DA@mail.gmail.com>






Citando Doug Evans <dje@google.com>:

> On Wed, Oct 29, 2014 at 11:55 AM,  <joaoandreferro@sapo.pt> wrote:
>> Hello everyone, again,
>>
>> From what I've learned after reading GDB's excellent documentation, I know I
>> can set a memory trigger (i. e., a breakpoint that is set every time a
>> certain memory address changes) by setting a watchpoint at the desired
>> memory address (a practical example is available here:
>> http://stackoverflow.com/questions/58851/can-i-set-a-breakpoint-on-memory-access-in-gdb).
>> The question I have now is if I can set a temporal breakpoint (i. e., a
>> breakpoint that is only triggered after a user-defined amount of time has
>> passed), in few words a breakpoint that is only fired after some kind of
>> timer has expired. I haven't found anything related to this on the GDB docs,
>> so I guess it's not possible, but they are huge and maybe I've missed
>> something, somewhere. If anyone can confirm or deny this deduction, it would
>> be great, because this feature is crucial to my work.
>
> Hi.
>
> There is no such thing, per se, but you might be able to approximate it
> by a breakpoint on a line of code that only triggers when the time  
> has passed,
> or after the breakpoint is hit a certain number of times.

Hi Doug, thanks for your answer.

I know how I can set a breakpoint that only triggers after being hit a  
certain number of times, but how I'd be able to set a breakpoint on a  
line of code that only triggers after a certain time has passed? E.  
g., are you referring about writng a little piece of code (in C, for  
instance) executing something only after a timer manually set by  
myself, in that same code? If that's it, in that case I don't know if  
it will be possible, because I'm also using KGDB, and so I want the  
lowest intrusion possible.

>
> I can also imagine a hack where you run a side program
> that sleeps for the specified period of time and it sends SIGUSR1
> (or whatever) to the inferior, and then have gdb catch SIGUSR1,
> do whatever you want at that time,
> and then resume the inferior (discarding the signal).

I'll investigate this solution, although I think I'll have the sma  
intrusion problem (in the Linux kernel).

Thanks!



  reply	other threads:[~2014-10-30 12:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29 18:55 joaoandreferro
2014-10-29 23:11 ` Doug Evans
2014-10-30 12:18   ` joaoandreferro [this message]
2014-10-30 12:43     ` Pedro Alves

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=20141030121815.Horde.8vqm4_U-9cztH4TOoUFeYQ2@mail.sapo.pt \
    --to=joaoandreferro@sapo.pt \
    --cc=dje@google.com \
    --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