setting a breakpoint on a break statement

Tristan Gingold gingold@adacore.com
Wed Mar 14 11:08:00 GMT 2007


Hi,

in some cases, a breakpoint can't be set on a continue or break  
statement.  Here is a simple example:

void foc (void)
{
   int a, i;

   for (i = 1; i <= 10; i++) {
     if (i < 3)
       a = 1;
     else
       break; // line 9
     a = 5;
   }
}

int main(void)
{
   foc ();
}

The reason is quiet simple: even at -O0 -g, there is no insn (and no  
BB) corresponding to the break/continue statement.
Here is a small patch which fixes the issue.
I wonder if this is the right approach.  This patch makes the code  
generated at -O0 uglier...

I think this issue has already been discussed, at least for gcc 3.4

Tristan.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bp.diff
Type: application/octet-stream
Size: 3017 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20070314/8f62838e/attachment.obj>


More information about the Gcc mailing list