From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20273 invoked by alias); 25 Jun 2007 23:36:33 -0000 Received: (qmail 20265 invoked by uid 22791); 25 Jun 2007 23:36:32 -0000 X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.31) with SMTP; Mon, 25 Jun 2007 23:36:30 +0000 Received: (qmail invoked by alias); 25 Jun 2007 23:36:28 -0000 Received: from matze2.NMSU.Edu (EHLO matze2.nmsu.edu) [128.123.132.132] by mail.gmx.net (mp042) with SMTP; 26 Jun 2007 01:36:28 +0200 X-Authenticated: #21774340 From: Matt Funk Reply-To: matze999@gmx.net To: "Michael Snyder" , gdb@sourceware.org Subject: Re: basic gdb usage question Date: Mon, 25 Jun 2007 23:36:00 -0000 User-Agent: KMail/1.9.5 References: <467D4AE3.7020505@eagercon.com> <200706251708.34817.matze999@gmx.net> <655C3D4066B7954481633935A40BB36F041415@ussunex02.svl.access-company.com> In-Reply-To: <655C3D4066B7954481633935A40BB36F041415@ussunex02.svl.access-company.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706251736.22816.matze999@gmx.net> X-Y-GMX-Trusted: 0 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: 2007-06/txt/msg00284.txt.bz2 thanks for the reply first of all, well, with respect to the local scope this is what i thought i tried. In particular this is what i did: break myfile_1.cpp:700 if (myfile_1.cpp:mylocalvar_1==1 && myfile_2.cpp:myothervar==2) but gdb gave me: "Junk at end of arguments." So i figure something is wrong with my syntax. Is there anything wrong with the above? mat On Monday 25 June 2007 17:22, Michael Snyder wrote: > The condition on a breakpoint can be anything that could be expressed as a > C expression, eg: > > (gdb) break : if (X && Y) > > You're right, two breakpoints would not meet that requirement. > However, you CAN have arbitrarily many breakpoints at the same > location, and their conditions will all be evaluated, so if you > had an "or" instead of an "and" (if you wanted to stop if X or Y), > you could use multiple breakpoints: > > break foo.c:17 if (X) > break foo.c:17 if (Y) > > X and Y don't have to be in the local scope, so long as they are > in "visible scope". gdb's concept of visible scope is a bit more > permissive than C -- a static variable from another source file > can be used so long as it is unambiguous. If it is ambiguous, it > can be specified as "foo.c:var".