From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7639 invoked by alias); 27 Jun 2007 03:29:26 -0000 Received: (qmail 7628 invoked by uid 22791); 27 Jun 2007 03:29:25 -0000 X-Spam-Check-By: sourceware.org Received: from nitzan.inter.net.il (HELO nitzan.inter.net.il) (213.8.233.22) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 27 Jun 2007 03:29:23 +0000 Received: from HOME-C4E4A596F7 ([81.5.48.2]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id HBY64722 (AUTH halo1); Wed, 27 Jun 2007 06:29:26 +0300 (IDT) Date: Wed, 27 Jun 2007 03:29:00 -0000 Message-Id: From: Eli Zaretskii To: matze999@gmx.net CC: gdb@sourceware.org In-reply-to: <200706261013.39409.matze999@gmx.net> (message from Matt Funk on Tue, 26 Jun 2007 10:13:37 -0600) Subject: Re: basic gdb usage question Reply-to: Eli Zaretskii References: <467D4AE3.7020505@eagercon.com> <200706251708.34817.matze999@gmx.net> <200706261013.39409.matze999@gmx.net> 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/msg00332.txt.bz2 > From: Matt Funk > Date: Tue, 26 Jun 2007 10:13:37 -0600 > > > > I thought > > > about setting two breakpoints but that would not do what i need it to do. > > > > Why not? You could set the second breakpoint from the commands > > defined for the first breakpoint. Would this do what you want? > > Not sure what you mean by 'setting a breakpoint from the commands > defined for the first breakpoint' to be honest. Can you point me to somewhere > in the docs where it mentions how to do this? I meant the command "commands" which allows you to specify the commands executed when a breakpoint is hit. Those commands can include setting a breakpoint at another location. > > > Along the same lines, is it then possible to create a condition that > > > references a variable outside the local scope? > > > > AFAIK, only if it has global scope in its file. You can use the > > FILE:VARIABLE syntax. > > Ah, ok. So it is not possible to reference a member of class A while being in > a method of class B? Also, it doesn't seem to allow me to reference a public > member of class A in a method of class A. Should it, or am I simply being > ignorant about something? Please show sample code and the commands you were typing. It's hard to talk theoretically. > > Btw, I'd be eager to know which ones of the answers above cannot be > > found in the user's manual. That will help us improve the docs. > > Well, i didn't see the links to the expressions section the first time around. > Sorry. However, it still didn't help. I'm still curious why the command : > (gdb) break myfile_1.cpp:70 if ('myfile_1.cpp'::myvar == 4) > gives : > Junk at the end of arguments Lose the parentheses, you don't need them. If this isn't clear from the manual, we should improve it. > A way to improve the docs would be to give many (and diverse) examples of how > to set breakpoints. Maybe ranging from very simple to pretty complex > breakpoints. I think there are examples, but I will read that section again. Thanks.