public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Question regarding setting breakpoints on 'C' labels and the handling of DW_TAG_label in new_symbol() in dwarf2read.c.
@ 2005-06-23 23:57 Cuthbertson, Reva D.
  2005-06-24  3:19 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Cuthbertson, Reva D. @ 2005-06-23 23:57 UTC (permalink / raw)
  To: gdb

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-07-28 12:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-23 23:57 Question regarding setting breakpoints on 'C' labels and the handling of DW_TAG_label in new_symbol() in dwarf2read.c Cuthbertson, Reva D.
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

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).