From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23016 invoked by alias); 24 Dec 2009 21:52:27 -0000 Received: (qmail 23008 invoked by uid 22791); 24 Dec 2009 21:52:27 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Dec 2009 21:52:23 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBOLqLW4008453 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 24 Dec 2009 16:52:21 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBOLqIQk015477 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 24 Dec 2009 16:52:20 -0500 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id nBOLqIKk000381; Thu, 24 Dec 2009 22:52:18 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id nBOLqHlp000380; Thu, 24 Dec 2009 22:52:17 +0100 Date: Thu, 24 Dec 2009 21:52:00 -0000 From: Jan Kratochvil To: Aravinda Cc: gdb@sourceware.org Subject: Re: Problem with manual watchpoints Message-ID: <20091224215217.GA32721@host0.dyn.jankratochvil.net> References: <26eb53620912241247i718992d6i422451f4b7f9931@mail.gmail.com> <20091224210825.GA29926@host0.dyn.jankratochvil.net> <26eb53620912241341w30a924afxf90f66166b8c552b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26eb53620912241341w30a924afxf90f66166b8c552b@mail.gmail.com> User-Agent: Mutt/1.5.20 (2009-08-17) 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: 2009-12/txt/msg00153.txt.bz2 On Thu, 24 Dec 2009 22:41:37 +0100, Aravinda wrote: > Yes, thats why I have a watchpoint added at &a[20]. So on accessing > the first element out of the allocated array, I want the program to > receive a SIGTRAP. Ah, OK. > Infact it gets this signal when the getc(stdin) is included, is it > something to do with the program should be in single step mode to get > SIGTRAPs No. > or is the loop way too simple that it executes in no time before the SIGTRAP > is even raised ? There may be some compiler optimization in effect such as if you have not used "volatile" keyword for the "a" array. You should rather check the code using "objdump -dS" or GDB "disass/m" how it got compiled. Still (with default -O0) I do not know the answer. Regards, Jan