From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17594 invoked by alias); 30 Oct 2014 12:18:23 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 17580 invoked by uid 89); 30 Oct 2014 12:18:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: sapo.pt Received: from relay2.ptmail.sapo.pt (HELO sapo.pt) (212.55.154.22) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 30 Oct 2014 12:18:21 +0000 Received: (qmail 20822 invoked by uid 0); 30 Oct 2014 12:18:16 -0000 Received: from unknown (HELO php11) (10.134.37.60) by relay2 with SMTP; 30 Oct 2014 12:18:16 -0000 Received: (qmail 11729 invoked by uid 64140); 30 Oct 2014 12:18:15 -0000 Received: from gtDEI-NATgw2.dei.uc.pt (gtDEI-NATgw2.dei.uc.pt [193.137.203.231]) by mail.sapo.pt (Horde Framework) with HTTP; Thu, 30 Oct 2014 12:18:15 +0000 Date: Thu, 30 Oct 2014 12:18:00 -0000 Message-ID: <20141030121815.Horde.8vqm4_U-9cztH4TOoUFeYQ2@mail.sapo.pt> From: joaoandreferro@sapo.pt To: Doug Evans Cc: gdb Subject: Re: Can GDB support "temporal breakpoints"? References: <20141029185541.Horde._3keczfPGLf4wL2j8_4tFw6@mail.sapo.pt> In-Reply-To: User-Agent: Dynamic Internet Messaging Program (DIMP) PTMail 5.3.1 X-PTMail-Version: PTMail 5.3.1 X-PTMail-User: eyJpdiI6InVMdTlIOHpNaGRxT0RZZkMzXC9rWnpnPT0iLCJkIjoiUXl4dk5nTHRia1ZwUlp5bzg0cnZOMkdsY3NqRm44WEt0NnRXMmVCSXgyYz0ifQ== Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00135.txt.bz2 Citando Doug Evans : > On Wed, Oct 29, 2014 at 11:55 AM, 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!