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

* Re: 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 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
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2005-06-24  3:19 UTC (permalink / raw)
  To: Cuthbertson, Reva D.; +Cc: gdb

On Thu, Jun 23, 2005 at 04:56:15PM -0700, Cuthbertson, Reva D. wrote:
> 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.

Simply, GDB does not support this.  It may have once upon a time, but
no one has used the feature for years.


-- 
Daniel Jacobowitz
CodeSourcery, LLC

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

* Re: Question regarding setting breakpoints on 'C' labels and the handling of DW_TAG_label in new_symbol() in dwarf2read.c.
  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
  0 siblings, 2 replies; 5+ messages in thread
From: Dave Trollope @ 2005-07-28  4:24 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Cuthbertson, Reva D., gdb


I too tried this recently and was disappointed to find it didn't work. 
Heres why I was trying it:

We have a number of source trees where code changes regularly. By using 
a label, we can write generic breakpoint scripts that are source tree 
independant (I.E. Don't need line numbers to place the breakpoint. etc).

Is there an alternative way to do what we are trying to achieve?

Cheers
Dave
Daniel Jacobowitz wrote:

>On Thu, Jun 23, 2005 at 04:56:15PM -0700, Cuthbertson, Reva D. wrote:
>  
>
>>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.
>>    
>>
>
>Simply, GDB does not support this.  It may have once upon a time, but
>no one has used the feature for years.
>
>
>  
>

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

* RE: Question regarding setting breakpoints on 'C' labels and the handling of DW_TAG_label in new_symbol() in dwarf2read.c.
  2005-07-28  4:24   ` Dave Trollope
@ 2005-07-28  6:13     ` Monika Chaddha
  2005-07-28 12:54     ` Daniel Jacobowitz
  1 sibling, 0 replies; 5+ messages in thread
From: Monika Chaddha @ 2005-07-28  6:13 UTC (permalink / raw)
  To: 'Dave Trollope'
  Cc: 'Cuthbertson, Reva D.', 'Daniel Jacobowitz', gdb

I think that this can be achieved by putting breakpoints using function
names.

>-----Original Message-----
>From: gdb-owner@sources.redhat.com
[mailto:gdb-owner@sources.redhat.com] On
>Behalf Of Dave Trollope
>Sent: Thursday, July 28, 2005 9:54 AM
>To: Daniel Jacobowitz
>Cc: Cuthbertson, Reva D.; gdb@sources.redhat.com
>Subject: Re: Question regarding setting breakpoints on 'C' labels and
the
>handling of DW_TAG_label in new_symbol() in dwarf2read.c.
>
>
>I too tried this recently and was disappointed to find it didn't work.
>Heres why I was trying it:
>
>We have a number of source trees where code changes regularly. By using
>a label, we can write generic breakpoint scripts that are source tree
>independant (I.E. Don't need line numbers to place the breakpoint.
etc).
>
>Is there an alternative way to do what we are trying to achieve?
>
>Cheers
>Dave
>Daniel Jacobowitz wrote:
>
>>On Thu, Jun 23, 2005 at 04:56:15PM -0700, Cuthbertson, Reva D. wrote:
>>
>>
>>>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.
>>>
>>>
>>
>>Simply, GDB does not support this.  It may have once upon a time, but
>>no one has used the feature for years.
>>
>>
>>
>>

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

* Re: Question regarding setting breakpoints on 'C' labels and the handling of DW_TAG_label in new_symbol() in dwarf2read.c.
  2005-07-28  4:24   ` Dave Trollope
  2005-07-28  6:13     ` Monika Chaddha
@ 2005-07-28 12:54     ` Daniel Jacobowitz
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2005-07-28 12:54 UTC (permalink / raw)
  To: Dave Trollope; +Cc: Cuthbertson, Reva D., gdb

On Wed, Jul 27, 2005 at 11:23:37PM -0500, Dave Trollope wrote:
> 
> I too tried this recently and was disappointed to find it didn't work. 
> Heres why I was trying it:
> 
> We have a number of source trees where code changes regularly. By using 
> a label, we can write generic breakpoint scripts that are source tree 
> independant (I.E. Don't need line numbers to place the breakpoint. etc).
> 
> Is there an alternative way to do what we are trying to achieve?

Depending on what sort of scripts they are, this may not be enough, but
you can do this with "search".  Since it doesn't set the default
breakpoint address, you can do this with expect scripts, but not with
gdb's source command.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

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