From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8089 invoked by alias); 26 Mar 2009 22:50:07 -0000 Received: (qmail 8080 invoked by uid 22791); 26 Mar 2009 22:50:04 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Mar 2009 22:49:59 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 389AC2BAB3F; Thu, 26 Mar 2009 18:49:58 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id A2-l1I-dZ5ki; Thu, 26 Mar 2009 18:49:58 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 9F8812BAB0A; Thu, 26 Mar 2009 18:49:57 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 997415BD21; Thu, 26 Mar 2009 15:49:49 -0700 (PDT) Date: Thu, 26 Mar 2009 23:10:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFC: preserve line number when skipping prologue Message-ID: <20090326224949.GM9472@adacore.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-03/txt/msg00602.txt.bz2 > If I set a breakpoint on line 3, gdb reports line 7. > > (gdb) b 3 > Breakpoint 1 at 0x80483c5: file m.c, line 7. > > But if I set one on line 9, another non-executable line, gdb reports > line 9: > > (gdb) b 9 > Breakpoint 2 at 0x80483d1: file m.c, line 9. I agree that we need to be consistent between the two cases! I don't know which one I prefer, though. Actually, I think I would prefer if GDB reported the real line on which it was inserted. But that would be a change of behavior from before, and that could have ramifications that could potentially annoys the users (on the "clear" command, for instance). > 2009-03-26 Tom Tromey > > * breakpoint.c (resolve_sal_pc): Preserve original line number > when skipping prologue. So I think that your patch is the most reasonable approach -- Joel