From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30870 invoked by alias); 20 Sep 2002 20:13:08 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 30863 invoked from network); 20 Sep 2002 20:13:08 -0000 Received: from unknown (HELO satan.diablo.localnet) (64.164.47.8) by sources.redhat.com with SMTP; 20 Sep 2002 20:13:08 -0000 Received: from p by satan.diablo.localnet with local (Exim 3.35 #1 (Debian)) id 17sU9A-0007fp-00 for ; Fri, 20 Sep 2002 13:13:04 -0700 Date: Fri, 20 Sep 2002 13:13:00 -0000 To: Gdb Mailing List Subject: another conditional breakpoint question Message-ID: <20020920201304.GA29419@dirac.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i From: Peter Jay Salzman X-SW-Source: 2002-09/txt/msg00318.txt.bz2 in the program: #include int main(void) { double i = 0.0; double j = cos(i); return 0; } i set a breakpoint which should never be reached: p@satan% gdb mymath (gdb) break main if cos(0.0) > 1000.0 Breakpoint 1 at 0x8048426: file mymath.c, line 5. (gdb) run Breakpoint 1, main () at mymath.c:5 5 double i = 0.0; considering that cosine should be greater than 1 for a real variable, this is quite strange! i don't know if this is related, but i notice that cos(0) doesn't have a value of 1.0. not even close: (gdb) p cos(0) $3 = 14368 but just in case gdb doesn't know that cos() returns a double, i also tried: (gdb) p/f cos(0.0) $1 = 2.00890148e-41 neither of these are even close to being right. can someone tell me why gdb is reaching that breakpoint which should never be reaced? and is there any way of getting gdb to tell me that cos(0) is supposed to be equal to 1? :*) thanks! pete -- Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D