From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31262 invoked by alias); 1 Jun 2011 21:22:13 -0000 Received: (qmail 31233 invoked by uid 22791); 1 Jun 2011 21:22:11 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-gx0-f169.google.com (HELO mail-gx0-f169.google.com) (209.85.161.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Jun 2011 21:21:56 +0000 Received: by gxk23 with SMTP id 23so121014gxk.0 for ; Wed, 01 Jun 2011 14:21:56 -0700 (PDT) Received: by 10.236.192.230 with SMTP id i66mr9123572yhn.482.1306963316119; Wed, 01 Jun 2011 14:21:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.201.35 with HTTP; Wed, 1 Jun 2011 14:21:36 -0700 (PDT) From: Niko Sams Date: Wed, 01 Jun 2011 21:22:00 -0000 Message-ID: Subject: watchpoint on variable in function scope To: gdb Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes 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 X-SW-Source: 2011-06/txt/msg00007.txt.bz2 Hi again, please have a look at the example code below. How can i set a watchpoint on i before starting the appliaction? it used to work with "watch foo::i" thanks, Niko ------------------ void foo() { static int i=0; ++i; } int main(int argc, char **argv) { foo(); return 0; }