From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4609 invoked by alias); 6 Jan 2012 02:30:15 -0000 Received: (qmail 4591 invoked by uid 22791); 6 Jan 2012 02:30:14 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from imr4.ericy.com (HELO imr4.ericy.com) (198.24.6.9) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Jan 2012 02:30:00 +0000 Received: from eusaamw0706.eamcs.ericsson.se ([147.117.20.31]) by imr4.ericy.com (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id q062Tkhi016505; Thu, 5 Jan 2012 20:29:47 -0600 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.43]) by eusaamw0706.eamcs.ericsson.se ([147.117.20.31]) with mapi; Thu, 5 Jan 2012 21:29:40 -0500 From: Marc Khouzam To: Joel Brobecker CC: "'gdb@sourceware.org'" Date: Fri, 06 Jan 2012 02:30:00 -0000 Subject: RE: Pending breakpoints on lines that don't exist Message-ID: References: ,<20120104035128.GP2742@adacore.com> In-Reply-To: <20120104035128.GP2742@adacore.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.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: 2012-01/txt/msg00013.txt.bz2 > From: Joel Brobecker [brobecker@adacore.com] > Sent: January 3, 2012 10:51 PM > To: Marc Khouzam > Cc: 'gdb@sourceware.org' > Subject: Re: Pending breakpoints on lines that don't exist >=20 > I can imagine that it is a bit of a pain to see pending breakpoints > being created for human-entry errors. I tend to make this type of > error regularly, for instance. But it apparently it is only an issue > if you use the "console" interpreter, since "-break-insert" flat out > refuses the breakpoint for me: >=20 > (gdb) > -break-insert foo.c:100 > ^error,msg=3D"No line 100 in file \"foo.c\"." Just a clarification FYI. In Eclipse, we always use -break-insert -f which requests pending breakpoints: (gdb)=20 -break-insert -f loopfirst.cc:100 &"No line 100 in file \"loopfirst.cc\".\n" ^done,bkpt=3D{number=3D"1",type=3D"breakpoint",disp=3D"keep",enabled=3D"y",= addr=3D"",pending=3D"loopfirst.cc:100",times=3D"0",original-locati= on=3D"loopfirst.cc:100"} > ... whereas "break" asks me whether I want to insert a breakpoint: >=20 > (gdb) b foo.c:100 > No line 100 in file "foo.c". > Make breakpoint pending on future shared library load? (y or [n]) n > (gdb) b bar.c:100 > No source file named bar.c. > Make breakpoint pending on future shared library load? (y or [n]) n To have a consistent behavior between UI and console, we always set: "-gdb-set breakpoint pending on". So, for the gdb console in eclipse, the pending breakpoint also gets set in the case of invalid lines or files. Although GDB indicates this clearly: b foo.c:100 No source file named foo.c. Breakpoint 7 (foo.c:100) pending. b 10000 No line 10000 in the current file. Breakpoint 9 (10000) pending. =20 Note that all this is fine, I just wanted to make sure it was planned. =20 Thanks for explaining things. =20 Marc