From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10572 invoked by alias); 23 Jun 2005 23:57:54 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 8919 invoked by uid 22791); 23 Jun 2005 23:56:22 -0000 Received: from palrel11.hp.com (HELO palrel11.hp.com) (156.153.255.246) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 23 Jun 2005 23:56:22 +0000 Received: from cacexg13.americas.cpqcorp.net (cacexg13.americas.cpqcorp.net [16.92.1.76]) by palrel11.hp.com (Postfix) with ESMTP id BD02615368 for ; Thu, 23 Jun 2005 16:56:20 -0700 (PDT) Received: from cacexc04.americas.cpqcorp.net ([16.92.1.26]) by cacexg13.americas.cpqcorp.net with Microsoft SMTPSVC(6.0.3790.211); Thu, 23 Jun 2005 16:56:16 -0700 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Question regarding setting breakpoints on 'C' labels and the handling of DW_TAG_label in new_symbol() in dwarf2read.c. Date: Thu, 23 Jun 2005 23:57:00 -0000 Message-ID: From: "Cuthbertson, Reva D." To: X-SW-Source: 2005-06/txt/msg00220.txt.bz2 Hello, I was trying to set a breakpoint on a 'C' label in gdb and when I could not do it I tried to find out why. I noticed a few things and had a few questions. My compiler generates DWARF debug information. In new_symbol() in dwarf2read.c, it looks like the symbol created for a label (specified with DW_TAG_label) is never entered into the symbol table. Was this intentional or is there just a missing call to add_symbol_to_list() for this case? I got past that problem by making the call to add_symbol_to_list(), but again, when I tried to set the breakpoint on the label, I got the error=20 " is not a function". Looking at the gdb 6.2 sources, it looks like this error is coming from symbol_found() in linespec.c. The code that is producing the error is the following: if (SYMBOL_CLASS (sym) =3D=3D LOC_BLOCK) { ... } else { if (funfirstline) error ("\"%s\" is not a function", copy); ... It looks like the intention of funfirstline is to specify that the breakpoint should be set at the first real line of the function, but for labels, this probably does not make sense.=20=20 Would it be possible to make a check for (SYMBOL_CLASS (sym) !=3D LOC_LABEL) in addition to checking funfirstline before issuing the error or is there a better way to handle labels? Thanks so much! Reva Cuthbertson reva.cuthbertson@hp.com