From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31786 invoked by alias); 26 Jan 2007 21:04:22 -0000 Received: (qmail 31755 invoked by uid 22791); 26 Jan 2007 21:04:21 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 26 Jan 2007 21:04:16 +0000 Received: (qmail 4104 invoked from network); 26 Jan 2007 21:04:15 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 26 Jan 2007 21:04:15 -0000 To: Michael Snyder Cc: Joel Brobecker , gdb@sourceware.org Subject: Re: Breaking on C labels? References: <20070125194905.GB4262@adacore.com> <1169767203.22601.128.camel@localhost.localdomain> <1169839590.14604.31.camel@localhost.localdomain> From: Jim Blandy Date: Fri, 26 Jan 2007 21:04:00 -0000 In-Reply-To: <1169839590.14604.31.camel@localhost.localdomain> (Michael Snyder's message of "Fri, 26 Jan 2007 11:26:30 -0800") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-01/txt/msg00334.txt.bz2 Michael Snyder writes: > On Fri, 2007-01-26 at 10:55 -0800, Jim Blandy wrote: >> Michael Snyder writes: >> > There's a risk that some symbol-lookup function would then select that >> > label instead of the function entry label when you tried to look up the >> > nearest label preceeding a given address. >> >> This should be easy to avoid, shouldn't it? We would only recognize >> LOC_LABEL entries for breakpoints, and ignore them for lookups by >> address. > > I'm not sure, it's too long since I looked at it. > Are you sure LOC_LABEL is the correct attribute? > Seems to me, that might be what is used by the compiler > for all those ".L123" labels that it uses for loop > control etc. No --- those would be minsyms. LOC_LABEL is an 'enum address_class'; only symbols and partial symbols have those. The original question was about breaking on C 'goto' labels. Those are source-level constructs, recorded in the DWARF. We don't need to produce partial symbols for them, since they're local to a function: the user must refer to the function (by name or by address) before they can refer to the label, so the full symtabs for that compilation unit will always be loaded. We do need to produce full symbols for them, with the LOC_LABEL address class. We needn't make any changes at all to minsym handling.