public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Cuthbertson, Reva D." <reva_cuthbertson@hp.com>
To: <gdb@sources.redhat.com>
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	[thread overview]
Message-ID: <B6C7F31B85669143825614FC8FE64929045F0F11@cacexc04.americas.cpqcorp.net> (raw)

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 
"<label-name> 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) == 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.  

Would it be possible to make a check for (SYMBOL_CLASS (sym) !=
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



             reply	other threads:[~2005-06-23 23:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-23 23:57 Cuthbertson, Reva D. [this message]
2005-06-24  3:19 ` Daniel Jacobowitz
2005-07-28  4:24   ` Dave Trollope
2005-07-28  6:13     ` Monika Chaddha
2005-07-28 12:54     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B6C7F31B85669143825614FC8FE64929045F0F11@cacexc04.americas.cpqcorp.net \
    --to=reva_cuthbertson@hp.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).