This is the mail archive of the gcc@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]
Other format: [Raw text]

setting a breakpoint on a break statement


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.

Attachment: bp.diff
Description: Binary data


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