From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28180 invoked by alias); 26 Sep 2002 14:23:57 -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 28173 invoked from network); 26 Sep 2002 14:23:56 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 26 Sep 2002 14:23:56 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17uaUI-0006Xr-00; Thu, 26 Sep 2002 10:23:34 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17uZYY-0007k3-00; Thu, 26 Sep 2002 10:23:54 -0400 Date: Thu, 26 Sep 2002 07:23:00 -0000 From: Daniel Jacobowitz To: Peter Jay Salzman Cc: Eli Zaretskii , Gdb Mailing List Subject: Re: rules for conditional breakpoints Message-ID: <20020926142354.GA29419@nevyn.them.org> Mail-Followup-To: Peter Jay Salzman , Eli Zaretskii , Gdb Mailing List References: <20020926051031.GA24523@dirac.org> <20020926064006.GA25116@dirac.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020926064006.GA25116@dirac.org> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-09/txt/msg00428.txt.bz2 On Wed, Sep 25, 2002 at 11:40:06PM -0700, Peter Jay Salzman wrote: > hi eli, > > unfortunately, the user manual doesn't really say much about this. the > relevent section is 5.1.6 (break conditions) which references section > 8.1 (expressions). > > in the first paragraph os 5.1.6: > > A condition is just a Boolean expression in your programming language > (see section 8.1 Expressions). > > but this is where my confusion is coming from. here is a boolean > expression: > > break main if cos(0.0) == 1.0 > > the condition "cos(0.0) == 1.0" is a boolean expression. it's either > true or false. yet it's not valid in a conditional breakpoint. If you had debugging information in your library, it would work, as I tried to explain last time. Or you can do this: (gdb) set $p = (double (*) (double)) cos (gdb) ptype $p type = double (*)() (gdb) p cos(2.) $2 = 14880 (gdb) p $p(2.) $4 = -0.41614683654714241 > looking further down the section 5.1.6, it mentions that user defined > functions are allowed in conditions. > > > > looking at section 8.1, it has something relevent: > > Any kind of constant, variable or operator defined by the programming > language you are using is valid in an expression in GDB. This > includes conditional expressions, function calls, casts and string > constants. It unfortunately does no include symbols defined by > preprocessor #define commands. That's out of date. Macros work now if you have the right debug info. > this is kind of ambiguous whether "the programming language" includes > glibc or not. if it doesn't, then i'm unsure what "functions" this > paragraph is talking about. if it does, then it directly conflicts with > my "cos(0.0) == 1.0" as an example of something that should work but > doesn't. Perhaps it could be clearer. What it means is, the _concept_ of a function call, as an operation, is valid. The function you call has to be defined with debug info. This is actually misleading since a lot of what is in glibc is specified by the language standard... -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer