From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13809 invoked by alias); 5 Jan 2012 12:56:33 -0000 Received: (qmail 13800 invoked by uid 22791); 5 Jan 2012 12:56:31 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com) (209.85.212.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Jan 2012 12:56:16 +0000 Received: by wibhq12 with SMTP id hq12so447847wib.0 for ; Thu, 05 Jan 2012 04:56:14 -0800 (PST) Received: by 10.180.81.72 with SMTP id y8mr3853410wix.14.1325768174642; Thu, 05 Jan 2012 04:56:14 -0800 (PST) Received: from [192.168.0.103] ([2.82.184.26]) by mx.google.com with ESMTPS id fv13sm32082248wbb.21.2012.01.05.04.56.12 (version=SSLv3 cipher=OTHER); Thu, 05 Jan 2012 04:56:13 -0800 (PST) Message-ID: <4F059DEB.1030007@gmail.com> Date: Thu, 05 Jan 2012 12:56:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Tom Tromey CC: Marc Khouzam , "'gdb@sourceware.org'" Subject: Re: Pending breakpoints on lines that don't exist References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00012.txt.bz2 On 01/04/2012 08:49 PM, Tom Tromey wrote: >>>>>> "Marc" == Marc Khouzam writes: > > Marc> (gdb) b 2 > Marc> No line 2 in the current file. > Marc> Make breakpoint pending on future shared library load? (y or [n]) y > Marc> Breakpoint 1 (2) pending. > > This is intended, but I wonder whether it would make sense to have > different behavior in the case where the file is implicit. > > That is, "b 2" would just give the old error, but "b currentfile.c:2" > would prompt for a pending breakpoint. > > The rationale for this would be that, in the implicit filename case, the > user is presumably asking for exactly the current file. It sounds tempting, but it goes back to guessing user's intentions? I'm left wondering if the real problem isn't that > No line 2 in the current file. > Make breakpoint pending on future shared library load? (y or [n]) y > Breakpoint 1 (2) pending. Isn't super clear that "2" doesn't actually mean "line 2 in any file", but currentfile.c:2. Or does it not? Note (debugging gdb): (top-gdb) b 56 No line 56 in the current file. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 4 (56) pending. (top-gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y 0x00000000006a419a in internal_error at ../../src/gdb/utils.c:1046 2 breakpoint keep y 0x00000000004ccc49 in info_command at ../../src/gdb/cli/cli-cmds.c:229 silent return 4 breakpoint keep y 56 (top-gdb) When read this, I go "where will breakpoint 4 resolve again?". It feels like gdb should show the (normalized) spec back to the user. "What" isn't exactly that. I find myself confused like that with e.g., `*' breakpoints. As in, was that a * breakpoint I set there, or not?: (top-gdb) b *main Breakpoint 5 at 0x455314: file ../../src/gdb/gdb.c, line 26. (top-gdb) info breakpoints 5 Num Type Disp Enb Address What 5 breakpoint keep y 0x0000000000455314 in main at ../../src/gdb/gdb.c:26 (top-gdb) b main Breakpoint 6 at 0x455323: file ../../src/gdb/gdb.c, line 29. (top-gdb) info breakpoints 5-6 Num Type Disp Enb Address What 5 breakpoint keep y 0x0000000000455314 in main at ../../src/gdb/gdb.c:26 6 breakpoint keep y 0x0000000000455323 in main at ../../src/gdb/gdb.c:29 -- Pedro Alves