From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26574 invoked by alias); 29 Oct 2014 23:11:29 -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 26562 invoked by uid 89); 29 Oct 2014 23:11:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f54.google.com Received: from mail-qg0-f54.google.com (HELO mail-qg0-f54.google.com) (209.85.192.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 29 Oct 2014 23:11:27 +0000 Received: by mail-qg0-f54.google.com with SMTP id q108so3167423qgd.13 for ; Wed, 29 Oct 2014 16:11:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=FWe3+bqJ4x5M0ioZV5BZy97jCRxy8PuvIUkldyY8//c=; b=klxu1p6tQ4Agoem4F53Opwhn6FKwQYz2sirsHDTJUQwevTxsBHSKcO5ABPdOe7VAbo 57fpKhd5AZdgdAdXutZU7vx5NIBVpxNUzvA2h/k8CdUPsWO3N2ApSNce7iS7arOZ/bJq AFIUSB226J52kUhP0x5rQOfi79I8Z1SJdX89UjpgnP5qNKES0rRz7M6gaBzxw3cmkTlq xT4BC4cAg5DWdgNQt0HBn17MYNXXD+QPyeEbQCDmziI8UiHzJOTOvAumgx29Lz3df+lQ 1HMhS3QJLIhHb9H3JASomgnYda+UaLwF/UAf/9+eRUZCDyjA9qUVihMmihvO/ulq9e5B 7PVw== X-Gm-Message-State: ALoCoQmRAtlDBQWufOnpI6DMiM+l5wvVbnb0R1drAAtChnh5RPXOg7HKfEl2rCvnA+wyUtoc7Q4r MIME-Version: 1.0 X-Received: by 10.224.46.8 with SMTP id h8mr21242917qaf.26.1414624285435; Wed, 29 Oct 2014 16:11:25 -0700 (PDT) Received: by 10.229.250.4 with HTTP; Wed, 29 Oct 2014 16:11:25 -0700 (PDT) In-Reply-To: <20141029185541.Horde._3keczfPGLf4wL2j8_4tFw6@mail.sapo.pt> References: <20141029185541.Horde._3keczfPGLf4wL2j8_4tFw6@mail.sapo.pt> Date: Wed, 29 Oct 2014 23:11:00 -0000 Message-ID: Subject: Re: Can GDB support "temporal breakpoints"? From: Doug Evans To: joaoandreferro@sapo.pt Cc: gdb Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00130.txt.bz2 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. 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).