From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18668 invoked by alias); 30 Jun 2008 15:32:34 -0000 Received: (qmail 18660 invoked by uid 22791); 30 Jun 2008 15:32:34 -0000 X-Spam-Check-By: sourceware.org Received: from relay-pt3.poste.it (HELO relay-pt3.poste.it) (62.241.4.129) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 30 Jun 2008 15:32:14 +0000 Received: from geppetto.reilabs.com (212.123.91.176) by relay-pt3.poste.it (7.3.122) (authenticated as stefano.sabatini-lala@poste.it) id 48681436000066EA for gdb@sources.redhat.com; Mon, 30 Jun 2008 17:32:11 +0200 Received: from stefano by geppetto.reilabs.com with local (Exim 4.67) (envelope-from ) id 1KDLNP-0005P7-Fz for gdb@sources.redhat.com; Mon, 30 Jun 2008 17:33:11 +0200 Date: Mon, 30 Jun 2008 15:32:00 -0000 From: Stefano Sabatini To: gdb Mailing List Subject: [NEWBIE] How to exit from a loop Message-ID: <20080630153311.GA19538@geppetto> Mail-Followup-To: gdb Mailing List MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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: 2008-06/txt/msg00317.txt.bz2 Hi all, suppose I'm debugging some code like this: int i; for (i=0; i < a_big_number; i++) do_something(i); out_of_the_loop: do_something_else(); and I'd like to jump out of the loop. What I did everytime is to simply put a breakpoint just after out_of_the_loop and hit continue, then I need to unset the breakpoint. I wonder if there is a more efficient way to exit from the loop, without the need to set a breakpoint at the rigth place, continue and then unset the breakpoint but with just a single command/macro. Many thanks in advance, regards.