This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch to preserve programmer specified labels in flow.c




  In message <199903211915.LAA24929@elmo.cygnus.com>you write:
  > Because the label was created by the programmer, so they expect to be
  > able to put a breakpoint on it.  For example, in the source fragment I
  > mentioned before: 
  > 
  >       switch (c)
  > 	{
  > 	case '%':
  > 	literal:
  >           lptr = fmt - nbytes;
  > 
  > 
  > GCC eliminates the label 'literal' because it is also represented by
  > the case '%' in the switch table.  An earlier "goto literal" is
  > replaced with "goto case '%'" (effectively!), but if we eliminate the
  > information about label 'literal' from the debug output then it will
  > be impossible for the user to put a break on the destination of the
  > goto instruction.
This sounds like typical problems debugging optimized code.

One can not expect to debug optimized code and have it work 100% like
debuggin unoptimized code.  However, it looks like we can do something for
this case (at the expense of making the debug symbols larger).

Looking at the code a little more closely, I think you need to make a
similar change in dwarfout.c in output_label_die.

So I think you should update dwarfout.c too and install your patch.

Thanks,
jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]