From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16663 invoked by alias); 26 Jun 2007 03:12:22 -0000 Received: (qmail 16655 invoked by uid 22791); 26 Jun 2007 03:12:21 -0000 X-Spam-Check-By: sourceware.org Received: from heller.inter.net.il (HELO heller.inter.net.il) (213.8.233.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 26 Jun 2007 03:12:19 +0000 Received: from HOME-C4E4A596F7 (IGLD-80-230-9-221.inter.net.il [80.230.9.221]) by heller.inter.net.il (MOS 3.7.3a-GA) with ESMTP id CXP16100 (AUTH halo1); Tue, 26 Jun 2007 06:12:15 +0300 (IDT) Date: Tue, 26 Jun 2007 03:12:00 -0000 Message-Id: From: Eli Zaretskii To: matze999@gmx.net CC: gdb@sourceware.org In-reply-to: <200706251708.34817.matze999@gmx.net> (message from Matt Funk on Mon, 25 Jun 2007 17:08:34 -0600) Subject: Re: basic gdb usage question Reply-to: Eli Zaretskii References: <467D4AE3.7020505@eagercon.com> <468047F0.7060207@eagercon.com> <200706251708.34817.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/msg00289.txt.bz2 > From: Matt Funk > Date: Mon, 25 Jun 2007 17:08:34 -0600 > > I am just starting to use gdb and so have a lot to learn. Welcome! > So i want to set the breakpoint in file A at line M under condition X. > However, another condition that needs to be met before breaking is in file B > with condition Y. > > condition X: the value of a local variable is (say) 2. > condition Y: the value of a variable is (say) 3. > > Is this possible to set multiple conditions for one breakpoint? A condition could be complex: var1 == 2 && var2 == 3. Would that do the job? > 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? > 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. 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.