From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26102 invoked by alias); 12 May 2006 12:45:35 -0000 Received: (qmail 26092 invoked by uid 22791); 12 May 2006 12:45:33 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 12 May 2006 12:45:31 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FeX1L-0000zu-71; Fri, 12 May 2006 08:45:27 -0400 Date: Fri, 12 May 2006 13:53:00 -0000 From: Daniel Jacobowitz To: Fabio De Bona , Eli Zaretskii Cc: gdb@sources.redhat.com Subject: Re: conditional breakpoint with (char* ) string condition Message-ID: <20060512124527.GB3460@nevyn.them.org> Mail-Followup-To: Fabio De Bona , Eli Zaretskii , gdb@sources.redhat.com References: <44645774.8060503@gmx.net> <44645774.8060503@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44645774.8060503@gmx.net> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00163.txt.bz2 On Fri, May 12, 2006 at 11:37:56AM +0200, Fabio De Bona wrote: > Hi everyone, > I would like to set a conditional breakpoint with a condition that > depends on the value of > a char* string, i.e. something like > > b gui/R.cpp:190 if cmd=="train" (doesn't work of course) > > resp. > > b gui/R.cpp:190 if strcmp(cmd,"train") This should actually work - although it's a bit slow to implement. On Fri, May 12, 2006 at 02:21:16PM +0300, Eli Zaretskii wrote: > > Date: Fri, 12 May 2006 11:37:56 +0200 > > From: Fabio De Bona > > > > b gui/R.cpp:190 if cmd=="train" (doesn't work of course) > > But this should: > > b gui/R.cpp:190 if cmd[0]=='t' && cmd[1]=='r' && cmd[2]=='a' && cmd[3]=='i' > > etc., you get the point. I wonder. Should we add some common builtin functions to GDB? b gui/R.cpp:190 if $gdb_strcmp (cmd, "train") [This might be quite a lot of work, since right now parsing "train" will cause us to malloc() in the program.] -- Daniel Jacobowitz CodeSourcery