Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Breaking on C labels?
@ 2007-01-25 19:48 Joel Brobecker
  2007-01-25 21:19 ` Jim Blandy
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2007-01-25 19:48 UTC (permalink / raw)
  To: gdb

Hello,

A customer asked us a question about the ability of breaking on labels
inside C code. Consider for instance:

        void
        procedure foo (void)
        {
           [...]
        error_handler:
           [...]
        }

The customer asked if it was possible to break at the error_handler
label. We are helping them with finding alternative solutions, but
I still did a bit of researching...

I discovered without much surprise that DWARF does indeed have provision
for labels (DW_TAG_label). However, I also noticed that GCC already
generates the associated DIEs. We actually even process them. However,
all my attempts in trying to reference them from the debugger failed.
I tried "break error_handler", or more simply "p error_handler", etc.

Did we ever make any attempt in implementing this sort of functionality
in the past?

Looking at the source code, I found in new_symbol ():

        case DW_TAG_label:
          attr = dwarf2_attr (die, DW_AT_low_pc, cu);
          if (attr)
            {
              SYMBOL_VALUE_ADDRESS (sym) = DW_ADDR (attr) + baseaddr;
            }
          SYMBOL_CLASS (sym) = LOC_LABEL;
          break;

So we setup the symbol, but we don't add to any of our symbol lists...
I am left wondering what it is that we'll be doing with this symbol.

Thanks,
-- 
Joel, curious


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

end of thread, other threads:[~2007-01-26 21:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-25 19:48 Breaking on C labels? Joel Brobecker
2007-01-25 21:19 ` Jim Blandy
2007-01-26  0:05   ` Michael Snyder
2007-01-26  1:01     ` Joel Brobecker
2007-01-26 18:55     ` Jim Blandy
2007-01-26 19:41       ` Michael Snyder
2007-01-26 21:04         ` Jim Blandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox